FEMTIC
ObservedDataStationHTF.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_HTF
25 #define DBLDEF_OBSERVED_DATA_HTF
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 HTF station
37  public:
38  // Constructer
39  explicit ObservedDataStationHTF();
40 
41  // Destructer
43 
44  // Read data from input file
45  void inputObservedData( std::ifstream& inFile );
46 
47  // Calulate horizontal magnetic field transfer function
48  void calculateHTF( const double freq, const ObservedDataStationPoint* const ptrStationOfMagneticField, int& icount );
49 
50  // Initialize horizontal magnetic field transfer functions and errors
52 
53  // Allocate memory for the calculated values of horizontal magnetic field transfer functions and errors
55 
56  // Output calculated values of horizontal magnetic field transfer functions
57  void outputCalculatedValues() const;
58 
59  // Calulate sensitivity matrix of HTF
60  void calculateSensitivityMatrix( const double freq, const int nModel,
61  const ObservedDataStationPoint* const ptrStationOfMagneticField,
62  const std::complex<double>* const derivativesOfEMFieldExPol,
63  const std::complex<double>* const derivativesOfEMFieldEyPol,
64  double* const sensitivityMatrix ) const;
65 
66  // Calculate data vector of this PE
67  void calculateResidualVectorOfDataThisPE( const double freq, const int offset, double* vector ) const;
68 
69  // Calulate sum of square of misfit
70  double calculateErrorSumOfSquaresThisPE() const;
71 
72  private:
73  std::complex<double>* m_TxxObserved;
74  std::complex<double>* m_TxyObserved;
75  std::complex<double>* m_TyxObserved;
76  std::complex<double>* m_TyyObserved;
77 
82 
83  std::complex<double>* m_TxxCalculated;
84  std::complex<double>* m_TxyCalculated;
85  std::complex<double>* m_TyxCalculated;
86  std::complex<double>* m_TyyCalculated;
87 
92 
97 
98  // Copy constructer
100 
101  // Copy assignment operator
103 
104 };
105 
106 #endif
Definition: ObservedDataStationHTF.h:36
CommonParameters::InitComplexValues * m_dataIDOfTyx
Definition: ObservedDataStationHTF.h:95
std::complex< double > * m_TxyObserved
Definition: ObservedDataStationHTF.h:74
CommonParameters::DoubleComplexValues * m_TxyResidual
Definition: ObservedDataStationHTF.h:89
void inputObservedData(std::ifstream &inFile)
Definition: ObservedDataStationHTF.cpp:168
CommonParameters::DoubleComplexValues * m_TyxSD
Definition: ObservedDataStationHTF.h:80
CommonParameters::InitComplexValues * m_dataIDOfTyy
Definition: ObservedDataStationHTF.h:96
void calculateHTF(const double freq, const ObservedDataStationPoint *const ptrStationOfMagneticField, int &icount)
Definition: ObservedDataStationHTF.cpp:271
std::complex< double > * m_TyxObserved
Definition: ObservedDataStationHTF.h:75
std::complex< double > * m_TxxCalculated
Definition: ObservedDataStationHTF.h:83
CommonParameters::DoubleComplexValues * m_TyyResidual
Definition: ObservedDataStationHTF.h:91
std::complex< double > * m_TyyObserved
Definition: ObservedDataStationHTF.h:76
CommonParameters::DoubleComplexValues * m_TyxResidual
Definition: ObservedDataStationHTF.h:90
std::complex< double > * m_TyyCalculated
Definition: ObservedDataStationHTF.h:86
void outputCalculatedValues() const
Definition: ObservedDataStationHTF.cpp:445
CommonParameters::InitComplexValues * m_dataIDOfTxy
Definition: ObservedDataStationHTF.h:94
ObservedDataStationHTF & operator=(const ObservedDataStationHTF &rhs)
CommonParameters::DoubleComplexValues * m_TyySD
Definition: ObservedDataStationHTF.h:81
~ObservedDataStationHTF()
Definition: ObservedDataStationHTF.cpp:63
std::complex< double > * m_TyxCalculated
Definition: ObservedDataStationHTF.h:85
CommonParameters::DoubleComplexValues * m_TxySD
Definition: ObservedDataStationHTF.h:79
CommonParameters::InitComplexValues * m_dataIDOfTxx
Definition: ObservedDataStationHTF.h:93
CommonParameters::DoubleComplexValues * m_TxxSD
Definition: ObservedDataStationHTF.h:78
void calculateResidualVectorOfDataThisPE(const double freq, const int offset, double *vector) const
Definition: ObservedDataStationHTF.cpp:548
void initializeHTFsAndErrors()
Definition: ObservedDataStationHTF.cpp:317
CommonParameters::DoubleComplexValues * m_TxxResidual
Definition: ObservedDataStationHTF.h:88
ObservedDataStationHTF(const ObservedDataStationHTF &rhs)
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: ObservedDataStationHTF.cpp:469
std::complex< double > * m_TxxObserved
Definition: ObservedDataStationHTF.h:73
void allocateMemoryForCalculatedValues()
Definition: ObservedDataStationHTF.cpp:338
ObservedDataStationHTF()
Definition: ObservedDataStationHTF.cpp:37
std::complex< double > * m_TxyCalculated
Definition: ObservedDataStationHTF.h:84
double calculateErrorSumOfSquaresThisPE() const
Definition: ObservedDataStationHTF.cpp:567
Definition: ObservedDataStationPoint.h:33
Definition: CommonParameters.h:64
Definition: CommonParameters.h:69