FEMTIC
ObservedDataStationPT.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_PT
25 #define DBLDEF_OBSERVED_DATA_PT
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 PT station
37  public:
38  // Constructer
39  explicit ObservedDataStationPT();
40 
41  // Destructer
43 
44  // Read data from input file
45  void inputObservedData( std::ifstream& inFile );
46 
47  // Calulate electric field
48  void calculateElectricField( const Forward3D* const ptrForward3D, const int rhsVectorIDOfEx, const int rhsVectorIDOfEy );
49 
50  // Calulate phase tensor
51  void calculatePhaseTensor( const double freq, const ObservedDataStationPoint* const ptrStationOfMagneticField, int& icount );
52 
53  // Initialize electric field
54  void initializeElectricField( const int iPol );
55 
56  // Initialize phase tensors and errors
58 
59  // Allocate memory for the calculated values of phase tensors and errors
61 
62  // Output calculated values of phase tensors
63  void outputCalculatedValues() const;
64 
65  // Calulate interpolator vector of electric field
66  void calcInterpolatorVectorOfElectricField( Forward3D* const ptrForward3D );
67 
68  // Calulate sensitivity matrix of phase tensor
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 type of the electric field used to calculate response functions
82  int getTypeOfElectricField() const;
83 
84  // Set type of the electric field used to calculate response functions
85  void setTypeOfElectricField( const int type );
86 
87  private:
88  double* m_PTxxObserved;
89  double* m_PTxyObserved;
90  double* m_PTyxObserved;
91  double* m_PTyyObserved;
92 
93  double* m_PTxxSD;
94  double* m_PTxySD;
95  double* m_PTyxSD;
96  double* m_PTyySD;
97 
102 
103  double* m_PTxxResidual;
104  double* m_PTxyResidual;
105  double* m_PTyxResidual;
106  double* m_PTyyResidual;
107 
108  std::complex<double> m_ExCalculated[2];
109  std::complex<double> m_EyCalculated[2];
110 
113 
118 
119  // Type of the electric field used to calculated response functions
121 
122  // Copy constructer
124 
125  // Copy assignment operator
127 
128 };
129 
130 #endif
Definition: Forward3D.h:37
Definition: ObservedDataStationPT.h:36
void calculateResidualVectorOfDataThisPE(const double freq, const int offset, double *vector) const
Definition: ObservedDataStationPT.cpp:834
double * m_PTyyObserved
Definition: ObservedDataStationPT.h:91
double * m_PTyyResidual
Definition: ObservedDataStationPT.h:106
double * m_PTxySD
Definition: ObservedDataStationPT.h:94
~ObservedDataStationPT()
Definition: ObservedDataStationPT.cpp:71
double * m_PTxyObserved
Definition: ObservedDataStationPT.h:89
double * m_PTyxCalculated
Definition: ObservedDataStationPT.h:100
double * m_PTyxSD
Definition: ObservedDataStationPT.h:95
double * m_PTyxObserved
Definition: ObservedDataStationPT.h:90
double calculateErrorSumOfSquaresThisPE() const
Definition: ObservedDataStationPT.cpp:850
void setTypeOfElectricField(const int type)
Definition: ObservedDataStationPT.cpp:867
int getTypeOfElectricField() const
Definition: ObservedDataStationPT.cpp:864
void inputObservedData(std::ifstream &inFile)
Definition: ObservedDataStationPT.cpp:174
double * m_PTxxResidual
Definition: ObservedDataStationPT.h:103
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: ObservedDataStationPT.cpp:645
double * m_PTyySD
Definition: ObservedDataStationPT.h:96
void calcInterpolatorVectorOfElectricField(Forward3D *const ptrForward3D)
Definition: ObservedDataStationPT.cpp:577
void calculateElectricField(const Forward3D *const ptrForward3D, const int rhsVectorIDOfEx, const int rhsVectorIDOfEy)
Definition: ObservedDataStationPT.cpp:292
void outputCalculatedValues() const
Definition: ObservedDataStationPT.cpp:548
double * m_PTxxSD
Definition: ObservedDataStationPT.h:93
ObservedDataStationPT()
Definition: ObservedDataStationPT.cpp:39
int m_typeOfElectricField
Definition: ObservedDataStationPT.h:120
int * m_dataIDOfPTyx
Definition: ObservedDataStationPT.h:116
int * m_dataIDOfPTyy
Definition: ObservedDataStationPT.h:117
double * m_PTyxResidual
Definition: ObservedDataStationPT.h:105
double * m_PTxyResidual
Definition: ObservedDataStationPT.h:104
double * m_PTxxCalculated
Definition: ObservedDataStationPT.h:98
ObservedDataStationPT & operator=(const ObservedDataStationPT &rhs)
void allocateMemoryForCalculatedValues()
Definition: ObservedDataStationPT.cpp:452
double * m_PTxxObserved
Definition: ObservedDataStationPT.h:88
int * m_dataIDOfPTxx
Definition: ObservedDataStationPT.h:114
int * m_dataIDOfPTxy
Definition: ObservedDataStationPT.h:115
int m_rhsVectorIDOfEx
Definition: ObservedDataStationPT.h:111
std::complex< double > m_ExCalculated[2]
Definition: ObservedDataStationPT.h:108
void initializePhaseTensorsAndErrors()
Definition: ObservedDataStationPT.cpp:436
int m_rhsVectorIDOfEy
Definition: ObservedDataStationPT.h:112
double * m_PTyyCalculated
Definition: ObservedDataStationPT.h:101
void initializeElectricField(const int iPol)
Definition: ObservedDataStationPT.cpp:430
std::complex< double > m_EyCalculated[2]
Definition: ObservedDataStationPT.h:109
void calculatePhaseTensor(const double freq, const ObservedDataStationPoint *const ptrStationOfMagneticField, int &icount)
Definition: ObservedDataStationPT.cpp:364
ObservedDataStationPT(const ObservedDataStationPT &rhs)
double * m_PTxyCalculated
Definition: ObservedDataStationPT.h:99
Definition: ObservedDataStationPoint.h:33