FEMTIC
ObservedDataStationNMT.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_NMT
25 #define DBLDEF_OBSERVED_DATA_NMT
26 
27 #include <vector>
28 #include <complex>
29 
30 #include "ObservedDataStation.h"
32 #include "Forward3D.h"
33 #include "CommonParameters.h"
34 #include "MeshDataTetraElement.h"
35 
36 // Observed data of NMT station ( line )
38  public:
39  // Constructer
40  explicit ObservedDataStationNMT();
41 
42  // Destructer
44 
45  // Read data from input file
46  void inputObservedData( std::ifstream& inFile );
47 
48  // Find elements including dipole
50 
51  // Calulate difference of voltages
52  void calculateVoltageDifferences( const Forward3D* const ptrForward3D, const int rhsVectorIDOfVoltageDifference );
53 
54  // Calulate Network-MT response
55  void calculateNetworkMTResponse( const double freq, const ObservedDataStationPoint* const ptrStationOfMagneticField, int& icount );
56 
57  // Initialize difference of voltages
58  void initializeVoltageDifferences( const int iPol );
59 
60  // Initialize Network-MT responses and errors
62 
63  // Allocate memory for the calculated values of Network-MT responses and errors
65 
66  // Output calculated values of Network-MT responses
67  void outputCalculatedValues() const;
68 
69  // Calulate interpolator vector of voltage difference
70  void calcInterpolatorVectorOfVoltageDifference( Forward3D* const ptrForward3D );
71 
72  // Calulate sensitivity matrix of Network-MT response
73  void calculateSensitivityMatrix( const double freq, const int nModel,
74  const ObservedDataStationPoint* const ptrStationOfMagneticField,
75  const std::complex<double>* const derivativesOfEMFieldExPol,
76  const std::complex<double>* const derivativesOfEMFieldEyPol,
77  double* const sensitivityMatrix ) const;
78 
79  // Calculate data vector of this PE
80  void calculateResidualVectorOfDataThisPE( const double freq, const int offset, double* vector ) const;
81 
82  // Calulate sum of square of misfit
83  double calculateErrorSumOfSquaresThisPE() const;
84 
85  // Get location of the station
87 
88  // Get Z coordinate of the point
89  double getZCoordOfPoint( const int num ) const;
90 
91  private:
92  // Location of the station
94 
95  std::complex<double>* m_YxObserved;
96  std::complex<double>* m_YyObserved;
97 
100 
101  std::complex<double>* m_YxCalculated;
102  std::complex<double>* m_YyCalculated;
103 
106 
107  std::complex<double> m_voltageCalculated[2];
108 
109  //int m_columnNumberOfVoltageDifferenceInRhsMatrix;
111 
112  //int* m_dataIDOfYx;
113  //int* m_dataIDOfYy;
116 
117  // Total number of elemenst including dipole
119 
120  // Elements including dipole
122 
123  // Faces including dipole
125 
126  // local coordinate values of the location of start point of line segment for hexahedral mesh
128 
129  // local coordinate values of the location of end point of line segment for hexahedral mesh
131 
133  //CommonParameters::VolumeCoords* m_volumeCoordinateValuesStartPoint;
134 
136  //CommonParameters::VolumeCoords* m_volumeCoordinateValuesEndPoint;
137 
138  // Area coordinate values of the location of start point of line segment for tetrahedral mesh
140 
141  // Area coordinate values of the location of start point of line segment for tetrahedral mesh
143 
144  // Copy constructer
146 
147  // Copy assignment operator
149 
150 };
151 #endif
Definition: Forward3D.h:37
Definition: ObservedDataStationNMT.h:37
int m_rhsVectorIDOfVoltageDifference
Definition: ObservedDataStationNMT.h:110
CommonParameters::InitComplexValues * m_dataIDOfYx
Definition: ObservedDataStationNMT.h:114
void initializeVoltageDifferences(const int iPol)
Definition: ObservedDataStationNMT.cpp:391
CommonParameters::AreaCoords * m_areaCoordinateValuesEndPoint
Definition: ObservedDataStationNMT.h:142
void initializeNetworkMTResponsesAndErrors()
Definition: ObservedDataStationNMT.cpp:398
CommonParameters::locationXY * m_localCoordinateValuesEndPoint
Definition: ObservedDataStationNMT.h:130
double getZCoordOfPoint(const int num) const
Definition: ObservedDataStationNMT.cpp:610
void outputCalculatedValues() const
Definition: ObservedDataStationNMT.cpp:473
ObservedDataStationNMT(const ObservedDataStationNMT &rhs)
void findElementsIncludingDipole()
Definition: ObservedDataStationNMT.cpp:219
CommonParameters::DoubleComplexValues * m_YySD
Definition: ObservedDataStationNMT.h:99
ObservedDataStationNMT()
Definition: ObservedDataStationNMT.cpp:37
void allocateMemoryForCalculatedValues()
Definition: ObservedDataStationNMT.cpp:413
CommonParameters::locationXY * m_localCoordinateValuesStartPoint
Definition: ObservedDataStationNMT.h:127
void calcInterpolatorVectorOfVoltageDifference(Forward3D *const ptrForward3D)
Definition: ObservedDataStationNMT.cpp:501
CommonParameters::InitComplexValues * m_dataIDOfYy
Definition: ObservedDataStationNMT.h:115
void calculateVoltageDifferences(const Forward3D *const ptrForward3D, const int rhsVectorIDOfVoltageDifference)
Definition: ObservedDataStationNMT.cpp:332
int * m_facesIncludingDipole
Definition: ObservedDataStationNMT.h:124
std::complex< double > * m_YyObserved
Definition: ObservedDataStationNMT.h:96
CommonParameters::DoubleComplexValues * m_YxSD
Definition: ObservedDataStationNMT.h:98
CommonParameters::locationDipole m_location
Definition: ObservedDataStationNMT.h:93
CommonParameters::DoubleComplexValues * m_YyResidual
Definition: ObservedDataStationNMT.h:105
CommonParameters::AreaCoords * m_areaCoordinateValuesStartPoint
Definition: ObservedDataStationNMT.h:139
ObservedDataStationNMT & operator=(const ObservedDataStationNMT &rhs)
std::complex< double > * m_YxCalculated
Definition: ObservedDataStationNMT.h:101
void inputObservedData(std::ifstream &inFile)
Definition: ObservedDataStationNMT.cpp:156
std::complex< double > * m_YxObserved
Definition: ObservedDataStationNMT.h:95
int * m_elementsIncludingDipole
Definition: ObservedDataStationNMT.h:121
CommonParameters::DoubleComplexValues * m_YxResidual
Definition: ObservedDataStationNMT.h:104
void calculateNetworkMTResponse(const double freq, const ObservedDataStationPoint *const ptrStationOfMagneticField, int &icount)
Definition: ObservedDataStationNMT.cpp:352
int m_numElementsIncludingDipole
Definition: ObservedDataStationNMT.h:118
std::complex< double > * m_YyCalculated
Definition: ObservedDataStationNMT.h:102
void calculateResidualVectorOfDataThisPE(const double freq, const int offset, double *vector) const
Definition: ObservedDataStationNMT.cpp:571
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: ObservedDataStationNMT.cpp:512
double calculateErrorSumOfSquaresThisPE() const
Definition: ObservedDataStationNMT.cpp:587
const CommonParameters::locationDipole & getLocationOfStation() const
Definition: ObservedDataStationNMT.cpp:603
~ObservedDataStationNMT()
Definition: ObservedDataStationNMT.cpp:71
std::complex< double > m_voltageCalculated[2]
Definition: ObservedDataStationNMT.h:107
Definition: ObservedDataStationPoint.h:33
Definition: ObservedDataStation.h:35
Definition: CommonParameters.h:99
Definition: CommonParameters.h:64
Definition: CommonParameters.h:69
Definition: CommonParameters.h:59
Definition: CommonParameters.h:38