FEMTIC
ObservedDataStationVTF.h
Go to the documentation of this file.
1 //-------------------------------------------------------------------------------------------------------
2 // The MIT License (MIT)
3 //
4 // Copyright (c) 2021 Yoshiya Usui
5 //
6 // Permission is hereby granted, free of charge, to any person obtaining a copy
7 // of this software and associated documentation files (the "Software"), to deal
8 // in the Software without restriction, including without limitation the rights
9 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 // copies of the Software, and to permit persons to whom the Software is
11 // furnished to do so, subject to the following conditions:
12 //
13 // The above copyright notice and this permission notice shall be included in all
14 // copies or substantial portions of the Software.
15 //
16 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 // SOFTWARE.
23 //-------------------------------------------------------------------------------------------------------
24 #ifndef DBLDEF_OBSERVED_DATA_VTF
25 #define DBLDEF_OBSERVED_DATA_VTF
26 
27 #include <vector>
28 #include <complex>
29 
31 #include "Forward3D.h"
32 #include "CommonParameters.h"
33 #include "MeshDataTetraElement.h"
34 
35 // Observed data of VTF station
37  public:
38  // Constructer
39  explicit ObservedDataStationVTF();
40 
41  // Destructer
43 
44  // Read data from input file
45  void inputObservedData( std::ifstream& inFile );
46 
47  // Calulate vertical magnetic field
48  void calculateVerticalMagneticField( const Forward3D* const ptrForward3D, const int rhsVectorIDOfHz );
49 
50  // Calulate vertical magnetic field transfer function
51  void calculateVTF( const double freq, const ObservedDataStationPoint* const ptrStationOfMagneticField, int& icount );
52 
53  // Initialize vertical magnetic field
54  void initializeVerticalMagneticField( const int iPol );
55 
56  // Initialize vertical magnetic field transfer functions and errors
58 
59  // Allocate memory for the calculated values of vertical magnetic field transfer functions and errors
61 
62  // Output calculated values of vertical magnetic field transfer functions
63  void outputCalculatedValues() const;
64 
65  // Calulate interpolator vector of vertical magnetic field
66  void calcInterpolatorVectorOfVerticalMagneticField( Forward3D* const ptrForward3D );
67 
68  // Calulate sensitivity matrix of VTF
69  void calculateSensitivityMatrix( const double freq, const int nModel,
70  const ObservedDataStationPoint* const ptrStationOfMagneticField,
71  const std::complex<double>* const derivativesOfEMFieldExPol,
72  const std::complex<double>* const derivativesOfEMFieldEyPol,
73  double* const sensitivityMatrix ) const;
74 
75  // Calculate data vector of this PE
76  void calculateResidualVectorOfDataThisPE( const double freq, const int offset, double* vector ) const;
77 
78  // Calulate sum of square of misfit
79  double calculateErrorSumOfSquaresThisPE() const;
80 
81  // Get VTK
82  bool getVTF( const double freq, std::complex<double>& Tzx, std::complex<double>& Tzy ) const;
83 
84  private:
85  std::complex<double>* m_TzxObserved;
86  std::complex<double>* m_TzyObserved;
87 
90 
91  std::complex<double>* m_TzxCalculated;
92  std::complex<double>* m_TzyCalculated;
93 
96 
97  std::complex<double> m_HzCalculated[2];
98 
99  //int m_columnNumberOfHzInRhsMatrix;
101 
102  //int* m_dataIDOfTzx;
103  //int* m_dataIDOfTzy;
106 
107  // Copy constructer
109 
110  // Copy assignment operator
112 
113 };
114 
115 #endif
Definition: Forward3D.h:37
Definition: ObservedDataStationPoint.h:33
Definition: ObservedDataStationVTF.h:36
CommonParameters::InitComplexValues * m_dataIDOfTzx
Definition: ObservedDataStationVTF.h:104
CommonParameters::DoubleComplexValues * m_TzyResidual
Definition: ObservedDataStationVTF.h:95
void calculateResidualVectorOfDataThisPE(const double freq, const int offset, double *vector) const
Definition: ObservedDataStationVTF.cpp:439
void inputObservedData(std::ifstream &inFile)
Definition: ObservedDataStationVTF.cpp:107
double calculateErrorSumOfSquaresThisPE() const
Definition: ObservedDataStationVTF.cpp:454
CommonParameters::DoubleComplexValues * m_TzxResidual
Definition: ObservedDataStationVTF.h:94
ObservedDataStationVTF(const ObservedDataStationVTF &rhs)
bool getVTF(const double freq, std::complex< double > &Tzx, std::complex< double > &Tzy) const
Definition: ObservedDataStationVTF.cpp:470
std::complex< double > * m_TzxObserved
Definition: ObservedDataStationVTF.h:85
ObservedDataStationVTF()
Definition: ObservedDataStationVTF.cpp:37
void outputCalculatedValues() const
Definition: ObservedDataStationVTF.cpp:337
CommonParameters::DoubleComplexValues * m_TzxSD
Definition: ObservedDataStationVTF.h:88
std::complex< double > * m_TzyCalculated
Definition: ObservedDataStationVTF.h:92
int m_rhsVectorIDOfHz
Definition: ObservedDataStationVTF.h:100
~ObservedDataStationVTF()
Definition: ObservedDataStationVTF.cpp:57
std::complex< double > m_HzCalculated[2]
Definition: ObservedDataStationVTF.h:97
void calculateVTF(const double freq, const ObservedDataStationPoint *const ptrStationOfMagneticField, int &icount)
Definition: ObservedDataStationVTF.cpp:211
void calculateSensitivityMatrix(const double freq, const int nModel, const ObservedDataStationPoint *const ptrStationOfMagneticField, const std::complex< double > *const derivativesOfEMFieldExPol, const std::complex< double > *const derivativesOfEMFieldEyPol, double *const sensitivityMatrix) const
Definition: ObservedDataStationVTF.cpp:380
void calculateVerticalMagneticField(const Forward3D *const ptrForward3D, const int rhsVectorIDOfHz)
Definition: ObservedDataStationVTF.cpp:190
std::complex< double > * m_TzxCalculated
Definition: ObservedDataStationVTF.h:91
CommonParameters::DoubleComplexValues * m_TzySD
Definition: ObservedDataStationVTF.h:89
void initializeVerticalMagneticField(const int iPol)
Definition: ObservedDataStationVTF.cpp:251
void allocateMemoryForCalculatedValues()
Definition: ObservedDataStationVTF.cpp:274
void initializeVTFsAndErrors()
Definition: ObservedDataStationVTF.cpp:258
ObservedDataStationVTF & operator=(const ObservedDataStationVTF &rhs)
void calcInterpolatorVectorOfVerticalMagneticField(Forward3D *const ptrForward3D)
Definition: ObservedDataStationVTF.cpp:365
std::complex< double > * m_TzyObserved
Definition: ObservedDataStationVTF.h:86
CommonParameters::InitComplexValues * m_dataIDOfTzy
Definition: ObservedDataStationVTF.h:105
Definition: CommonParameters.h:64
Definition: CommonParameters.h:69