Kaynağa Gözat

Moved around some more files and working toward FDEM1D module ported.

enhancement_3
T-bone 8 yıl önce
ebeveyn
işleme
7a2adfe63a

+ 7
- 0
Modules/FDEM1D/include/FDEM1D Dosyayı Görüntüle

@@ -1,5 +1,12 @@
1 1
 #include "LayeredEarthEM.h"
2 2
 #include "FieldPoints.h"
3
+#include "WireAntenna.h"
4
+#include "DipoleSource.h"
5
+
6
+// internal
7
+//#include "KernelEM1DManager.h"
8
+//#include "KernelEM1DSpec.h"
9
+//#include "KernelEM1DReflSpec.h"
3 10
 
4 11
 /* vim: set tabstop=4 expandtab: */
5 12
 /* vim: set filetype=cpp: */

Modules/FDEM1D/include/hankeltransformhankel2.h → Modules/FDEM1D/include/FHTAnderson801.h Dosyayı Görüntüle

@@ -11,22 +11,28 @@
11 11
   @version  $Id: hankeltransformhankel2.h 201 2015-01-03 00:07:47Z tirons $
12 12
  **/
13 13
 
14
-#ifndef __HANKEL2_H
15
-#define __HANKEL2_H
14
+#ifndef __FHTANDERSON801_H
15
+#define __FHTANDERSON801_H
16 16
 
17
-#include "hankeltransform.h"
18 17
 #include "KernelEM1DBase.h"
19 18
 #include "KernelEM1DSpec.h"
20 19
 #include "CubicSplineInterpolator.h"
20
+#include "HankelTransform.h"
21 21
 
22 22
 namespace Lemma {
23 23
 
24 24
 // ==========================================================================
25
-//        Class:  Hankel2
25
+//        Class:  FHTAnderson801
26 26
 /** \brief   Computes the Hankel transform of orders 0 and 1 using lagged
27 27
              and related convolutions.
28 28
     \details A rewrite of work by Anderson who wrote a FORTRAN program
29
-             that he released while working at the USGS.
29
+             that he released while working at the USGS:
30
+             Anderson, W. L., 1989, A hybrid fast hankel transform algorithm for
31
+             electromagnetic modeling: Geophysics, 54, 263-266.
32
+
33
+             This function does not provide the Hybrid functionality however, merely the
34
+             digital filter implimentation.
35
+
30 36
              The  transform evaluates an integral of the form:
31 37
              \f[ \int_0^\infty K(\lambda) J_I (\lambda r) ~ d \lambda
32 38
              \f]
@@ -45,29 +51,49 @@ namespace Lemma {
45 51
              \f]
46 52
              This can only be done where there is radial symmetry. Hence
47 53
              its application to 1D solutions here.
54
+    \note In previous versions of Lemma, this class was called HankelTransformHankel2,
55
+        which more closely follows Anderson's procedural routine names, but was non-descriptive
56
+        regarding where the algorithm is derived from.
48 57
  */
49 58
 // ==========================================================================
50 59
 
51
-class Hankel2 : public HankelTransform {
60
+class FHTAnderson801 : public HankelTransform {
61
+
62
+    friend std::ostream &operator<<(std::ostream &stream, const FHTAnderson801 &ob);
52 63
 
53
-    friend std::ostream &operator<<(std::ostream &stream, const Hankel2 &ob);
64
+    struct ctor_key {};
54 65
 
55 66
     public:
56 67
 
57 68
         // ====================  LIFECYCLE     ==============================
58 69
         /**
59
-         *  Returns pointer to new Hankel2. Location is
60
-         *  initialized to (0,0,0) type and polarization are
61
-         *  initialized  to nonworking values that will throw
62
-         *  exceptions if used.
70
+         *  Returns shared_ptr to new FHTAnderson801.
63 71
          */
64
-        static Hankel2 *New();
72
+        static std::shared_ptr<FHTAnderson801> NewSP();
65 73
 
66 74
         /**
67
-         * @copybrief LemmaObject::Delete()
68
-         * @copydetails LemmaObject::Delete()
75
+         *  Returns unique_ptr to new FHTAnderson801.
69 76
          */
70
-        void Delete();
77
+        static std::unique_ptr<FHTAnderson801> NewUP();
78
+
79
+        /// Default locked constructor
80
+        FHTAnderson801( const ctor_key& );
81
+
82
+        /** Locked deserializing constructor. */
83
+		FHTAnderson801 ( const YAML::Node& node, const ctor_key& );
84
+
85
+        /// Default destructor
86
+        ~FHTAnderson801();
87
+
88
+        /**
89
+         *   YAML Serializing method
90
+         */
91
+        YAML::Node Serialize() const;
92
+
93
+        /**
94
+         *   Constructs an object from a YAML::Node.
95
+         */
96
+        static std::shared_ptr< FHTAnderson801 > DeSerialize(const YAML::Node& node);
71 97
 
72 98
         // ====================  OPERATORS     ==============================
73 99
 
@@ -83,16 +109,16 @@ class Hankel2 : public HankelTransform {
83 109
         void Compute(const Real &rho, const int& ntol, const Real &tol);
84 110
 
85 111
         /// Computes the related
86
-        void ComputeRelated(const Real &rho, KernelEm1DBase* Kernel);
112
+        void ComputeRelated(const Real &rho, std::shared_ptr<KernelEM1DBase> Kernel);
87 113
 
88 114
         /// Computes the related
89
-        void ComputeRelated(const Real &rho,  std::vector< KernelEm1DBase* > KernelVec);
115
+        void ComputeRelated(const Real &rho,  std::vector< std::shared_ptr<KernelEM1DBase> > KernelVec);
90 116
 
91 117
         /// Computes the related
92
-        void ComputeRelated(const Real &rho,  KernelEM1DManager* Manager);
118
+        void ComputeRelated(const Real &rho,  std::shared_ptr<KernelEM1DManager> Manager);
93 119
 
94 120
         /// Computes the related and lagged convolutions
95
-        void ComputeLaggedRelated(const Real &rho, const int& nlag,  KernelEM1DManager* Manager);
121
+        void ComputeLaggedRelated(const Real &rho, const int& nlag,  std::shared_ptr<KernelEM1DManager> Manager);
96 122
 
97 123
         // ====================  ACCESS        ==============================
98 124
 
@@ -108,7 +134,6 @@ class Hankel2 : public HankelTransform {
108 134
         /// Sets the lagged kernel index so that the proper value is returned
109 135
         void SetLaggedArg(const Real& rho);
110 136
 
111
-
112 137
         // ====================  INQUIRY       ==============================
113 138
 
114 139
         /// Calculates Hankel Transform using filtering.
@@ -120,13 +145,20 @@ class Hankel2 : public HankelTransform {
120 145
         /// = omega * sqrt( EP*AMU )  amu = 4 pi e-7  ep = 8.85e-12
121 146
         Complex Zgauss(const int &ikk, const EMMODE &imode,
122 147
                         const int &itype, const Real &rho,
123
-                        const Real &wavef, KernelEm1DBase *Kernel);
148
+                        const Real &wavef, std::shared_ptr<KernelEM1DBase> Kernel);
149
+
150
+        /** Returns the name of the underlying class, similiar to Python's type */
151
+        virtual inline std::string GetName() const {
152
+            return CName;
153
+        }
124 154
 
125 155
     protected:
126 156
 
157
+    private:
158
+
127 159
         // ====================  LIFECYCLE     ==============================
128 160
 
129
-        /** A rewrite of Anderson's Pseudo-subroutine. */
161
+        /** A rewrite of Anderson's "Pseudo-subroutine" computed GOTO madness. */
130 162
         inline void StoreRetreive(const int &idx, const int &lag,
131 163
                         Complex &Zsum, const int &irel, Complex &C, const Real& rho0) {
132 164
 
@@ -149,18 +181,6 @@ class Hankel2 : public HankelTransform {
149 181
 		    return;
150 182
 	    }
151 183
 
152
-        /// Default protected constructor
153
-        Hankel2(const std::string& name);
154
-
155
-        /// Default protected destructor
156
-        ~Hankel2();
157
-
158
-        /**
159
-         * @copybrief LemmaObject::Release()
160
-         * @copydetails LemmaObject::Release()
161
-         */
162
-        void Release();
163
-
164 184
         // ====================  OPERATIONS    ==============================
165 185
 
166 186
         void DeleteSplines();
@@ -194,7 +214,7 @@ class Hankel2 : public HankelTransform {
194 214
         //bool cacheResults;
195 215
 
196 216
         /** Related Kernel Manager */
197
-        KernelEM1DManager*          Manager;
217
+        std::shared_ptr<KernelEM1DManager>     Manager;
198 218
 
199 219
         /// Used as base for filter abscissa generation
200 220
         static const Real ABSCISSA;
@@ -209,13 +229,13 @@ class Hankel2 : public HankelTransform {
209 229
         int icount;
210 230
 
211 231
         /// Kernel Calculator
212
-        std::vector <KernelEm1DBase*> kernelVec;
232
+        std::vector < std::shared_ptr<KernelEM1DBase> > kernelVec;
213 233
 
214 234
         /// Spines for lagged convolutions (real part)
215
-        std::vector <CubicSplineInterpolator*> splineVecReal;
235
+        std::vector <std::shared_ptr<CubicSplineInterpolator> > splineVecReal;
216 236
 
217 237
         /// Spines for lagged convolutions (imaginary part)
218
-        std::vector <CubicSplineInterpolator*> splineVecImag;
238
+        std::vector < std::shared_ptr<CubicSplineInterpolator> > splineVecImag;
219 239
 
220 240
         /// Key used internally
221 241
         Eigen::Matrix<int, 801, 1> Key;
@@ -239,8 +259,11 @@ class Hankel2 : public HankelTransform {
239 259
         /// Holds the arguments for lagged convolutions
240 260
         VectorXr Arg;
241 261
 
242
-}; // -----  end of class  HankelTransform  -----
262
+        /** ASCII string representation of the class name */
263
+        static constexpr auto CName = "FHTAnderson801";
264
+
265
+}; // -----  end of class  FHTAnderson801  -----
243 266
 
244 267
 }
245 268
 
246
-#endif // __HANKEL2_h
269
+#endif // __FHTAnderson801_h

Modules/FDEM1D/include/hankeltransform.h → Modules/FDEM1D/include/HankelTransform.h Dosyayı Görüntüle

@@ -8,7 +8,6 @@
8 8
   @file
9 9
   @author   Trevor Irons
10 10
   @date     01/28/2010
11
-  @version  $Id: hankeltransform.h 270 2015-08-24 15:45:41Z tirons $
12 11
  **/
13 12
 
14 13
 #ifndef __hankeltransform_h
@@ -19,12 +18,11 @@
19 18
 
20 19
 namespace Lemma {
21 20
 
22
-
23 21
         class KernelEM1DBase;
24 22
 
25 23
         // ===================================================================
26 24
         //        Class:  HankelTransform
27
-        /// \brief  Pure abstract class for hankel transforms
25
+        /// \brief   Abstract class for hankel transforms
28 26
         /// \details
29 27
         // ===================================================================
30 28
         class HankelTransform : public LemmaObject {
@@ -37,10 +35,6 @@ namespace Lemma {
37 35
 
38 36
                 // ====================  LIFECYCLE     =======================
39 37
 
40
-                //static HankelTransform* New();
41
-
42
-                //void Delete();
43
-
44 38
                 // ====================  OPERATORS     =======================
45 39
 
46 40
                 // ====================  OPERATIONS    =======================
@@ -60,7 +54,7 @@ namespace Lemma {
60 54
 
61 55
                 /// Computes related kernels, if applicable, otherwise this is
62 56
                 /// just a dummy function.
63
-                virtual void ComputeRelated(const Real& rho, KernelEm1DBase* Kernel);
57
+                virtual void ComputeRelated(const Real& rho, std::shared_ptr<KernelEM1DBase> Kernel);
64 58
 
65 59
                 virtual void ComputeRelated(const Real& rho, std::vector< std::shared_ptr<KernelEM1DBase> > KernelVec);
66 60
 
@@ -69,6 +63,10 @@ namespace Lemma {
69 63
                 // ====================  ACCESS        =======================
70 64
 
71 65
                 // ====================  INQUIRY       =======================
66
+                /** Returns the name of the underlying class, similiar to Python's type */
67
+                virtual inline std::string GetName() const {
68
+                    return CName;
69
+                }
72 70
 
73 71
                 // ====================  DATA MEMBERS  =======================
74 72
 
@@ -77,13 +75,16 @@ namespace Lemma {
77 75
                 // ====================  LIFECYCLE     =======================
78 76
 
79 77
                 /// Default protected constructor.
80
-                HankelTransform (const std::string &name);
78
+                HankelTransform ( );
81 79
 
82 80
                 /// Default protected constructor.
83
-                ~HankelTransform ();
81
+                ~HankelTransform ( );
84 82
 
85 83
             private:
86 84
 
85
+                /** ASCII string representation of the class name */
86
+                static constexpr auto CName = "HankelTransform";
87
+
87 88
     }; // -----  end of class  HankelTransform  -----
88 89
 
89 90
 }

+ 5
- 2
Modules/FDEM1D/src/CMakeLists.txt Dosyayı Görüntüle

@@ -1,8 +1,7 @@
1 1
 set (FDEM1DSOURCE
2 2
 	${FDEM1DSOURCE}
3 3
 
4
-	#${CMAKE_CURRENT_SOURCE_DIR}/AEMSurvey.cpp
5
-	#${CMAKE_CURRENT_SOURCE_DIR}/AEMSurveyReader.cpp
4
+
6 5
 
7 6
 	${CMAKE_CURRENT_SOURCE_DIR}/LayeredEarthEM.cpp
8 7
 	
@@ -16,7 +15,11 @@ set (FDEM1DSOURCE
16 15
 	${CMAKE_CURRENT_SOURCE_DIR}/KernelEM1DSpec.cpp
17 16
 	${CMAKE_CURRENT_SOURCE_DIR}/KernelEM1DReflSpec.cpp
18 17
 
18
+	${CMAKE_CURRENT_SOURCE_DIR}/HankelTransform.cpp
19
+	${CMAKE_CURRENT_SOURCE_DIR}/FHTAnderson801.cpp
19 20
 
21
+	#${CMAKE_CURRENT_SOURCE_DIR}/AEMSurvey.cpp
22
+	#${CMAKE_CURRENT_SOURCE_DIR}/AEMSurveyReader.cpp
20 23
 	#${CMAKE_CURRENT_SOURCE_DIR}/UngroundedElectricDipole.cpp
21 24
 	PARENT_SCOPE
22 25
 )

+ 1
- 1
Modules/FDEM1D/src/DipoleSource.cpp Dosyayı Görüntüle

@@ -19,7 +19,7 @@
19 19
 //#include "MagneticDipole.h"
20 20
 
21 21
 #include "FieldPoints.h"
22
-#include "hankeltransform.h"
22
+#include "HankelTransform.h"
23 23
 
24 24
 namespace Lemma {
25 25
 

Modules/FDEM1D/src/hankeltransformhankel2.cpp → Modules/FDEM1D/src/FHTAnderson801.cpp Dosyayı Görüntüle

@@ -11,19 +11,18 @@
11 11
   @version  $Id: hankeltransformhankel2.cpp 202 2015-01-06 20:53:21Z tirons $
12 12
  **/
13 13
 
14
-#include "hankeltransformhankel2.h"
14
+#include "FHTAnderson801.h"
15 15
 
16 16
 namespace Lemma {
17 17
 
18
-	std::ostream &operator<<(std::ostream &stream,
19
-			const Hankel2 &ob) {
20
-
21
-		stream << *(HankelTransform*)(&ob);
22
-		return stream;
23
-	}
18
+    std::ostream &operator << (std::ostream &stream, const FHTAnderson801 &ob) {
19
+        stream << ob.Serialize()  << "\n---\n"; // End of doc ---
20
+        return stream;
21
+    }
24 22
 
25
-    // Initialise static const members
26
-    const Eigen::Matrix<Real, 2, 801>  Hankel2::FilterWeights =
23
+    // Initialise static const members, this could be done by preprocessor in
24
+    // slightly higher precision?
25
+    const Eigen::Matrix<Real, 2, 801>  FHTAnderson801::FilterWeights =
27 26
         ( Eigen::Matrix<Real, 2, 801>()   <<
28 27
 					2.103562053838982e-29, -1.264469361608894e-14,
29 28
 					4.615731256788567e-14, -2.798703374257668e-14,
@@ -837,62 +836,64 @@ namespace Lemma {
837 836
 					// 800
838 837
 					7.214920505613761e-28).finished();
839 838
 
840
-    const Real Hankel2::ABSCISSA = 0.7059431685223780;     //
841
-	const Real Hankel2::ABSE = 1.10517091807564762;        // exp(.1)
842
-	const Real Hankel2::ABSER = 0.904837418035959573;      // 1/exp(.1)
843
-    //std::unordered_map<Real, int> Hankel2::RHO0 = {};
839
+    const Real FHTAnderson801::ABSCISSA = 0.7059431685223780;     //
840
+	const Real FHTAnderson801::ABSE = 1.10517091807564762;        // exp(.1)
841
+	const Real FHTAnderson801::ABSER = 0.904837418035959573;      // 1/exp(.1)
844 842
 
845 843
 	// ====================  LIFECYCLE     ==============================
846
-	Hankel2::Hankel2(const std::string&name) : HankelTransform(name),
844
+	FHTAnderson801::FHTAnderson801(const ctor_key& ) : HankelTransform( ),
847 845
 			             Lambda(0), NumFun(0),
848 846
 						 NumConv(0), NumRel(0),
849
-						 BesselOrder(-1),  Manager(NULL) {
847
+						 BesselOrder(-1),  Manager(nullptr) {
850 848
 	}
851 849
 
852
-	Hankel2::~Hankel2() {
853
-		//if (!this->kernelVec.empty()) {
854
-		//	this->Ckernel->DetachFrom(this);
855
-		//}
856
-
857
-        DeleteSplines();
858
-
859
-        if (Manager != NULL) {
860
-            Manager->DetachFrom(this);
861
-        }
862
-
863
-        if (this->NumberOfReferences != 0)
864
-            throw DeleteObjectWithReferences( this );
850
+    FHTAnderson801::FHTAnderson801( const YAML::Node& node, const ctor_key& ) : HankelTransform( ) {
851
+        Lambda = node["Lambda"].as<Real>();
852
+        NumFun = node["NumFun"].as<int>();
853
+		NumConv = node["NumConv"].as<int>();
854
+        NumRel = node["NumRel"].as<int>( );
855
+		BesselOrder = node["BesselOrder"].as<int>( );
856
+        //Manager = KernelEM1DManager::DeSerialize(node["Manager"]);
865 857
 	}
866 858
 
867
-	Hankel2* Hankel2::New() {
868
-		Hankel2* Obj = new Hankel2("Hankel2");
869
-        Obj->AttachTo(Obj);
870
-        return Obj;
859
+	FHTAnderson801::~FHTAnderson801() {
871 860
 	}
872 861
 
873
-	void Hankel2::Delete() {
874
-        this->DetachFrom(this);
875
-	}
862
+	std::shared_ptr<FHTAnderson801> FHTAnderson801::NewSP() {
863
+	    return std::make_shared<FHTAnderson801>( ctor_key() );
864
+    }
876 865
 
877
-    void Hankel2::Release() {
878
-        delete this;
866
+    std::unique_ptr<FHTAnderson801> FHTAnderson801::NewUP() {
867
+	    return std::make_unique<FHTAnderson801>( ctor_key() );
879 868
     }
880 869
 
881
-    void Hankel2::DeleteSplines() {
882
-        for (unsigned int ii=0; ii<splineVecReal.size(); ++ii){
883
-            splineVecReal[ii]->Delete();
870
+    std::shared_ptr<FHTAnderson801> FHTAnderson801::DeSerialize( const YAML::Node& node ) {
871
+        if (node.Tag() != "FHTAnderson801") {
872
+            throw  DeSerializeTypeMismatch( "FHTAnderson801", node.Tag());
884 873
         }
885
-        splineVecReal.clear();
874
+        return std::make_shared<FHTAnderson801> ( node, ctor_key() );
875
+    }
886 876
 
887
-        for (unsigned int ii=0; ii<splineVecImag.size(); ++ii){
888
-            splineVecImag[ii]->Delete();
889
-        }
877
+    YAML::Node FHTAnderson801::Serialize() const {
878
+        YAML::Node node = HankelTransform::Serialize();
879
+        node.SetTag( GetName() );
880
+        node["Lambda"] = Lambda;
881
+        node["NumFun"] = NumFun;
882
+        node["NumConv"] = NumConv;
883
+        node["NumRel"] = NumRel;
884
+        node["BesselOrder"] = BesselOrder;
885
+        node["Manager"] = Manager->Serialize();
886
+        return node;
887
+    }
888
+
889
+    void FHTAnderson801::DeleteSplines() {
890
+        splineVecReal.clear();
890 891
         splineVecImag.clear();
891 892
     }
892 893
 
893 894
 	// ====================  OPERATIONS    ==============================
894 895
 
895
-    void Hankel2::ComputeRelated(const Real& rho, KernelEm1DBase* Kernel) {
896
+    void FHTAnderson801::ComputeRelated(const Real& rho, std::shared_ptr<KernelEM1DBase> Kernel) {
896 897
         //this->AttachKernel(Kernel);
897 898
         this->SetNumConv(1);
898 899
         icount = 0;
@@ -903,7 +904,7 @@ namespace Lemma {
903 904
 #endif
904 905
     }
905 906
 
906
-    void Hankel2::ComputeRelated(const Real& rho,  std::vector< KernelEm1DBase*> KernelVecIn ) {
907
+    void FHTAnderson801::ComputeRelated(const Real& rho,  std::vector< std::shared_ptr<KernelEM1DBase> > KernelVecIn ) {
907 908
         icount = 0;
908 909
         this->kernelVec = KernelVecIn;
909 910
         this->SetNumConv(1);
@@ -914,12 +915,8 @@ namespace Lemma {
914 915
 #endif
915 916
     }
916 917
 
917
-    void Hankel2::ComputeRelated(const Real& rho,  KernelEM1DManager* KernelManager) {
918
+    void FHTAnderson801::ComputeRelated(const Real& rho,  std::shared_ptr<KernelEM1DManager> KernelManager) {
918 919
         icount = 0;
919
-        if (Manager != NULL) {
920
-            Manager->DetachFrom(this);
921
-        }
922
-        KernelManager->AttachTo(this);
923 920
         Manager = KernelManager;
924 921
         this->kernelVec = KernelManager->GetSTLVector();
925 922
         this->SetNumConv(1);
@@ -930,12 +927,8 @@ namespace Lemma {
930 927
 #endif
931 928
     }
932 929
 
933
-    void Hankel2::ComputeLaggedRelated(const Real& rho, const int& nlag, KernelEM1DManager* KernelManager) {
930
+    void FHTAnderson801::ComputeLaggedRelated(const Real& rho, const int& nlag, std::shared_ptr<KernelEM1DManager> KernelManager) {
934 931
         icount = 0;
935
-        if (Manager != NULL) {
936
-            Manager->DetachFrom(this);
937
-        }
938
-        KernelManager->AttachTo(this);
939 932
         Manager = KernelManager;
940 933
         this->kernelVec = KernelManager->GetSTLVector();
941 934
         this->SetNumConv(nlag);
@@ -951,25 +944,25 @@ namespace Lemma {
951 944
         //std::cout << "Arg\n" << Arg << std::endl;
952 945
         //std::cout << "Zans\n" << Zans.col(0) << std::endl;
953 946
         for (int ii=0; ii<Zans.cols(); ++ii) {
954
-            CubicSplineInterpolator *Spline = CubicSplineInterpolator::New();
947
+            auto Spline = CubicSplineInterpolator::NewSP();
955 948
             Spline->SetKnots( Arg, Zans.col(ii).real() );
956 949
             splineVecReal.push_back(Spline);
957 950
 
958
-            CubicSplineInterpolator *SplineI = CubicSplineInterpolator::New();
951
+            auto SplineI = CubicSplineInterpolator::NewSP();
959 952
             SplineI->SetKnots( Arg, Zans.col(ii).imag() );
960 953
             splineVecImag.push_back(SplineI);
961 954
         }
962 955
 
963 956
     }
964 957
 
965
-    void Hankel2::SetLaggedArg(const Real& rho) {
958
+    void FHTAnderson801::SetLaggedArg(const Real& rho) {
966 959
         for (int i=0; i<Zans.cols(); ++ i) {
967 960
             Zans(0, i) = Complex( splineVecReal[i]->Interpolate(rho),
968 961
                                   splineVecImag[i]->Interpolate(rho) );
969 962
         }
970 963
     }
971 964
 
972
-	Complex Hankel2::Zgauss(const int &ikk, const EMMODE &imode,
965
+	Complex FHTAnderson801::Zgauss(const int &ikk, const EMMODE &imode,
973 966
 						const int &itype, const Real &rho,
974 967
 						const Real &wavef, KernelEm1DBase *Kernel) {
975 968
 
@@ -979,17 +972,17 @@ namespace Lemma {
979 972
 
980 973
 	}
981 974
 
982
-	void Hankel2::SetNumConv(const int &i) {
975
+	void FHTAnderson801::SetNumConv(const int &i) {
983 976
 		this->NumConv = i;
984 977
 	}
985 978
 
986
-	Eigen::Matrix<Complex, Eigen::Dynamic, Eigen::Dynamic> Hankel2::GetAnswer() {
979
+	Eigen::Matrix<Complex, Eigen::Dynamic, Eigen::Dynamic> FHTAnderson801::GetAnswer() {
987 980
 		return this->Zans;
988 981
 	}
989 982
 
990 983
 	///////////////////////////////////////////
991 984
 	// Computes the transform
992
-	void Hankel2::Compute(const Real &rho, const int& ntol, const Real &tol) {
985
+	void FHTAnderson801::Compute(const Real &rho, const int& ntol, const Real &tol) {
993 986
 
994 987
 		Real y1 = this->ABSCISSA/rho;
995 988
 		//this->Key.setZero(801);
@@ -1003,11 +996,11 @@ namespace Lemma {
1003 996
 		}
1004 997
 
1005 998
 		if (this->NumConv<1) {
1006
-			throw std::runtime_error("In Hankel2 NumConv is less than 1.");
999
+			throw std::runtime_error("In FHTAnderson801 NumConv is less than 1.");
1007 1000
 		}
1008 1001
 
1009 1002
         if (this->kernelVec.empty()) {
1010
-			throw std::runtime_error("In Hankel2 Unset Kernel Calculator");
1003
+			throw std::runtime_error("In FHTAnderson801 Unset Kernel Calculator");
1011 1004
 		}
1012 1005
         #endif
1013 1006
 		//if (rho<=1e-5) {

+ 37
- 0
Modules/FDEM1D/src/HankelTransform.cpp Dosyayı Görüntüle

@@ -0,0 +1,37 @@
1
+/* This file is part of Lemma, a geophysical modelling and inversion API */
2
+
3
+/* This Source Code Form is subject to the terms of the Mozilla Public
4
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
5
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6
+
7
+/**
8
+  @file
9
+  @author   Trevor Irons
10
+  @date     01/02/2010
11
+  @version  $Id: hankeltransform.cpp 193 2014-11-10 23:51:41Z tirons $
12
+ **/
13
+
14
+#include "HankelTransform.h"
15
+
16
+namespace Lemma {
17
+
18
+    std::ostream &operator << (std::ostream &stream, const HankelTransform &ob) {
19
+        stream << ob.Serialize()  << "\n---\n"; // End of doc ---
20
+        return stream;
21
+    }
22
+
23
+	HankelTransform::HankelTransform( ) : LemmaObject( )	{
24
+	}
25
+
26
+	HankelTransform::~HankelTransform( ) {
27
+	}
28
+
29
+    void HankelTransform::ComputeRelated(const Real& rho, std::shared_ptr<KernelEM1DBase> Kernel) {
30
+    }
31
+
32
+    void HankelTransform::ComputeRelated(const Real& rho, std::vector< std::shared_ptr<KernelEM1DBase> > KernelVec) {
33
+    }
34
+
35
+    void HankelTransform::ComputeRelated(const Real& rho, std::shared_ptr<KernelEM1DManager> KernelManager) {
36
+    }
37
+}

+ 0
- 39
Modules/FDEM1D/src/hankeltransform.cpp Dosyayı Görüntüle

@@ -1,39 +0,0 @@
1
-/* This file is part of Lemma, a geophysical modelling and inversion API */
2
-
3
-/* This Source Code Form is subject to the terms of the Mozilla Public
4
- * License, v. 2.0. If a copy of the MPL was not distributed with this
5
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6
-
7
-/**
8
-  @file
9
-  @author   Trevor Irons
10
-  @date     01/02/2010
11
-  @version  $Id: hankeltransform.cpp 193 2014-11-10 23:51:41Z tirons $
12
- **/
13
-
14
-#include "hankeltransform.h"
15
-
16
-namespace Lemma {
17
-
18
-	std::ostream &operator<<(std::ostream &stream,
19
-			const HankelTransform &ob) {
20
-		stream << *(LemmaObject*)(&ob);
21
-		return stream;
22
-	}
23
-
24
-	HankelTransform::HankelTransform(const std::string &name) :
25
-	   LemmaObject(name)	{
26
-	}
27
-
28
-	HankelTransform::~HankelTransform() {
29
-	}
30
-
31
-    void HankelTransform::ComputeRelated(const Real& rho, KernelEm1DBase *Kernel) {
32
-    }
33
-
34
-    void HankelTransform::ComputeRelated(const Real& rho, std::vector< KernelEm1DBase* > KernelVec) {
35
-    }
36
-
37
-    void HankelTransform::ComputeRelated(const Real& rho, KernelEM1DManager*  KernelManager) {
38
-    }
39
-}

+ 30
- 0
Modules/FDEM1D/testing/GetNameCheck.h Dosyayı Görüntüle

@@ -39,5 +39,35 @@ class MyTestSuite : public CxxTest::TestSuite
39 39
         TS_ASSERT_EQUALS( Obj->GetName(), std::string("FieldPoints") );
40 40
     }
41 41
 
42
+    void testDipoleSource( void )
43
+    {
44
+        auto Obj = DipoleSource::NewSP();
45
+        TS_ASSERT_EQUALS( Obj->GetName(), std::string("DipoleSource") );
46
+    }
47
+
48
+    void testWireAntenna( void )
49
+    {
50
+        auto Obj = WireAntenna::NewSP();
51
+        TS_ASSERT_EQUALS( Obj->GetName(), std::string("WireAntenna") );
52
+    }
53
+
54
+//     void testKernelEM1DManager( void )
55
+//     {
56
+//         auto Obj = KernelEM1DManager::NewSP();
57
+//         TS_ASSERT_EQUALS( Obj->GetName(), std::string("KernelEM1DManager") );
58
+//     }
59
+//
60
+//     void testKernelEM1DSpec( void )
61
+//     {
62
+//         auto Obj = KernelEM1DSpec::NewSP();
63
+//         TS_ASSERT_EQUALS( Obj->GetName(), std::string("KernelEM1DSpec") );
64
+//     }
65
+//
66
+//     void testKernelEM1DReflSpec( void )
67
+//     {
68
+//         auto Obj = KernelEM1DReflSpec::NewSP();
69
+//         TS_ASSERT_EQUALS( Obj->GetName(), std::string("KernelEM1DReflSpec") );
70
+//     }
71
+
42 72
 };
43 73
 

+ 1
- 1
vim/c.vim Dosyayı Görüntüle

@@ -17,7 +17,7 @@ syn keyword nspace Lemma YAML Eigen
17 17
 
18 18
 " Lemma types
19 19
 highlight leType ctermfg=Yellow guifg=Yellow
20
-syn keyword leType HankelTransform KernelEm1D KernelEM1DManager DipoleSource EarthModel LayeredEarth LayeredEarthEM TEMSurvey TEMSurveyLine TEMSurveyLineRecord TEMInductiveReceiver PolygonalWireAntenna TEMTransmitter TEMReceiver Instrument InstrumentTem LemmaObject FieldPoints DCIPElectrode TEMSurveyData TEMSurveyLineData TEMSurveyLineRecordData  ASCIIParser CubicSplineInterpolator RectilinearGrid GridReader RectilinearGridReader RectilinearGridVTKExporter Filter WindowFilter DEMParticle DEMGrain Data DataReader 
20
+syn keyword leType HankelTransform FHTAnderson801 KernelEM1D KernelEM1DSpec KernelEM1DBase KernelEM1DManager DipoleSource EarthModel LayeredEarth LayeredEarthEM TEMSurvey TEMSurveyLine TEMSurveyLineRecord TEMInductiveReceiver WireAntenna PolygonalWireAntenna TEMTransmitter TEMReceiver Instrument InstrumentTem LemmaObject FieldPoints DCIPElectrode TEMSurveyData TEMSurveyLineData TEMSurveyLineRecordData  ASCIIParser CubicSplineInterpolator RectilinearGrid GridReader RectilinearGridReader RectilinearGridVTKExporter Filter WindowFilter DEMParticle DEMGrain Data DataReader 
21 21
 
22 22
 " Deprecated Lemma Types
23 23
 highlight dleType ctermfg=Blue guifg=Blue 

Loading…
İptal
Kaydet