Selaa lähdekoodia

Added more Hankel transforms and modified things a bit.

enhancement_3
Trevor Irons 8 vuotta sitten
vanhempi
commit
4770cbbd4f

Modules/FDEM1D/src/dipolefreqsweep.cpp → Modules/FDEM1D/examples/dipolefreqsweep.cpp Näytä tiedosto


Modules/FDEM1D/src/femforward.cpp → Modules/FDEM1D/examples/femforward.cpp Näytä tiedosto


+ 1
- 1
Modules/FDEM1D/include/FHTAnderson801.h Näytä tiedosto

@@ -145,7 +145,7 @@ class FHTAnderson801 : public HankelTransform {
145 145
         /// = omega * sqrt( EP*AMU )  amu = 4 pi e-7  ep = 8.85e-12
146 146
         Complex Zgauss(const int &ikk, const EMMODE &imode,
147 147
                         const int &itype, const Real &rho,
148
-                        const Real &wavef, std::shared_ptr<KernelEM1DBase> Kernel);
148
+                        const Real &wavef, KernelEM1DBase* Kernel);
149 149
 
150 150
         /** Returns the name of the underlying class, similiar to Python's type */
151 151
         virtual inline std::string GetName() const {

+ 31
- 28
Modules/FDEM1D/include/FHTKey101.h Näytä tiedosto

@@ -10,10 +10,8 @@
10 10
 /**
11 11
  * @file
12 12
  * @date      02/11/2014 03:33:08 PM
13
- * @version   $Id$
14 13
  * @author    Trevor Irons (ti)
15
- * @email     Trevor.Irons@xri-geo.com
16
- * @copyright Copyright (c) 2014, XRI Geophysics, LLC
14
+ * @email     Trevor.Irons@lemmasoftware.org
17 15
  * @copyright Copyright (c) 2014, Trevor Irons
18 16
  */
19 17
 
@@ -21,7 +19,7 @@
21 19
 #ifndef  FHTKEY101_INC
22 20
 #define  FHTKEY101_INC
23 21
 
24
-#include "hankeltransform.h"
22
+#include "HankelTransform.h"
25 23
 
26 24
 namespace Lemma {
27 25
 
@@ -39,24 +37,37 @@ namespace Lemma {
39 37
      */
40 38
     class FHTKey101 : public HankelTransform {
41 39
 
42
-        friend std::ostream &operator<<(std::ostream &stream,
43
-                const FHTKey101 &ob);
40
+        friend std::ostream &operator<<(std::ostream &stream, const FHTKey101 &ob);
41
+
42
+        struct ctor_key {};
44 43
 
45 44
         public:
46 45
 
47 46
         // ====================  LIFECYCLE     =======================
48 47
 
48
+        /** Default protected constructor, use New */
49
+        FHTKey101 ( const ctor_key& );
50
+
51
+        /** DeSerializing locked constructor, use NewSP */
52
+        FHTKey101 ( const YAML::Node& node, const ctor_key& );
53
+
54
+        /** Default protected destructor, use Delete */
55
+        ~FHTKey101 ();
56
+
49 57
         /**
50 58
          * @copybrief LemmaObject::New()
51 59
          * @copydetails LemmaObject::New()
52 60
          */
53
-        static FHTKey101* New();
61
+        static std::shared_ptr<FHTKey101> NewSP();
62
+
63
+        /** YAML Serializing method
64
+         */
65
+        YAML::Node Serialize() const;
54 66
 
55 67
         /**
56
-         *  @copybrief   LemmaObject::Delete()
57
-         *  @copydetails LemmaObject::Delete()
68
+         *   Constructs an object from a YAML::Node.
58 69
          */
59
-        void Delete();
70
+        static std::shared_ptr< FHTKey101 > DeSerialize(const YAML::Node& node);
60 71
 
61 72
         // ====================  OPERATORS     =======================
62 73
 
@@ -64,36 +75,25 @@ namespace Lemma {
64 75
 
65 76
         Complex Zgauss(const int &ikk, const EMMODE &imode,
66 77
                             const int &itype, const Real &rho,
67
-                            const Real &wavef, KernelEm1DBase *Kernel);
78
+                            const Real &wavef, KernelEM1DBase* Kernel);
68 79
 
69 80
         /// Computes related kernels, if applicable, otherwise this is
70 81
         /// just a dummy function.
71
-        void ComputeRelated(const Real& rho, KernelEm1DBase* Kernel);
82
+        void ComputeRelated(const Real& rho, std::shared_ptr<KernelEM1DBase> Kernel);
72 83
 
73
-        void ComputeRelated(const Real& rho, std::vector< KernelEm1DBase* > KernelVec);
84
+        void ComputeRelated(const Real& rho, std::vector< std::shared_ptr<KernelEM1DBase> > KernelVec);
74 85
 
75
-        void ComputeRelated(const Real& rho, KernelEM1DManager* KernelManager);
86
+        void ComputeRelated(const Real& rho, std::shared_ptr<KernelEM1DManager> KernelManager);
76 87
 
77 88
         // ====================  ACCESS        =======================
78 89
 
79 90
         // ====================  INQUIRY       =======================
91
+        virtual inline std::string GetName() const {
92
+            return CName;
93
+        }
80 94
 
81 95
         protected:
82 96
 
83
-        // ====================  LIFECYCLE     =======================
84
-
85
-        /** Default protected constructor, use New */
86
-        FHTKey101 (const std::string& name);
87
-
88
-        /** Default protected destructor, use Delete */
89
-        ~FHTKey101 ();
90
-
91
-        /**
92
-         *  @copybrief   LemmaObject::Release()
93
-         *  @copydetails LemmaObject::Release()
94
-         */
95
-        void Release();
96
-
97 97
         private:
98 98
 
99 99
         // ====================  DATA MEMBERS  =========================
@@ -104,6 +104,9 @@ namespace Lemma {
104 104
         /// Holds answer, dimensions are NumConv, and NumberRelated.
105 105
         Eigen::Matrix<Complex, Eigen::Dynamic, Eigen::Dynamic> Zans;
106 106
 
107
+        /** ASCII string representation of the class name */
108
+        static constexpr auto CName = "FHTKey101";
109
+
107 110
     }; // -----  end of class  FHTKey101  -----
108 111
 
109 112
 }		// -----  end of Lemma  name  -----

+ 5
- 5
Modules/FDEM1D/include/FHTKey201.h Näytä tiedosto

@@ -48,15 +48,15 @@ namespace Lemma {
48 48
         /** Default locked constructor, use NewSP */
49 49
         FHTKey201 ( const ctor_key& );
50 50
 
51
-        /** DeSerializing locked constructor, use NewSP */
51
+        /** DeSerializing locked constructor, use DeSerialize */
52 52
         FHTKey201 ( const YAML::Node& node, const ctor_key& );
53 53
 
54
-        /** Default protected destructor, use Delete */
54
+        /** Default destructor */
55 55
         ~FHTKey201 ();
56 56
 
57 57
         /**
58
-         * @copybrief LemmaObject::New()
59
-         * @copydetails LemmaObject::New()
58
+         *  Factory method for generating objects.
59
+         *   @return std::shared_ptr< FHTKey201 >
60 60
          */
61 61
         static std::shared_ptr<FHTKey201> NewSP();
62 62
 
@@ -75,7 +75,7 @@ namespace Lemma {
75 75
 
76 76
         Complex Zgauss(const int &ikk, const EMMODE &imode,
77 77
                             const int &itype, const Real &rho,
78
-                            const Real &wavef, std::shared_ptr<KernelEM1DBase> Kernel);
78
+                            const Real &wavef, KernelEM1DBase* Kernel);
79 79
 
80 80
         /// Computes related kernels, if applicable, otherwise this is
81 81
         /// just a dummy function.

+ 35
- 30
Modules/FDEM1D/include/FHTKey51.h Näytä tiedosto

@@ -10,10 +10,8 @@
10 10
 /**
11 11
  * @file
12 12
  * @date      02/11/2014 03:33:08 PM
13
- * @version   $Id$
14 13
  * @author    Trevor Irons (ti)
15
- * @email     Trevor.Irons@xri-geo.com
16
- * @copyright Copyright (c) 2014, XRI Geophysics, LLC
14
+ * @email     Trevor.Irons@lemmasoftware.org
17 15
  * @copyright Copyright (c) 2014, Trevor Irons
18 16
  */
19 17
 
@@ -21,7 +19,7 @@
21 19
 #ifndef  FHTKEY51_INC
22 20
 #define  FHTKEY51_INC
23 21
 
24
-#include "hankeltransform.h"
22
+#include "HankelTransform.h"
25 23
 
26 24
 namespace Lemma {
27 25
 
@@ -39,24 +37,37 @@ namespace Lemma {
39 37
      */
40 38
     class FHTKey51 : public HankelTransform {
41 39
 
42
-        friend std::ostream &operator<<(std::ostream &stream,
43
-                const FHTKey51 &ob);
40
+        friend std::ostream &operator<<(std::ostream &stream, const FHTKey51 &ob);
41
+
42
+        struct ctor_key {};
44 43
 
45 44
         public:
46 45
 
47 46
         // ====================  LIFECYCLE     =======================
48 47
 
48
+        /** Default locked constructor, use NewSP */
49
+        FHTKey51 ( const ctor_key& );
50
+
51
+        /** DeSerializing locked constructor, use DeSerialize */
52
+        FHTKey51 ( const YAML::Node& node, const ctor_key& );
53
+
54
+        /** Default destructor */
55
+        ~FHTKey51 ();
56
+
49 57
         /**
50
-         * @copybrief LemmaObject::New()
51
-         * @copydetails LemmaObject::New()
58
+         *  Factory method for generating objects.
59
+         *  @return std::shared_ptr<FHTKey51>
52 60
          */
53
-        static FHTKey51* New();
61
+        static std::shared_ptr<FHTKey51> NewSP();
62
+
63
+        /** YAML Serializing method
64
+         */
65
+        YAML::Node Serialize() const;
54 66
 
55 67
         /**
56
-         *  @copybrief   LemmaObject::Delete()
57
-         *  @copydetails LemmaObject::Delete()
68
+         *   Constructs an object from a YAML::Node.
58 69
          */
59
-        void Delete();
70
+        static std::shared_ptr< FHTKey51 > DeSerialize(const YAML::Node& node);
60 71
 
61 72
         // ====================  OPERATORS     =======================
62 73
 
@@ -64,35 +75,26 @@ namespace Lemma {
64 75
 
65 76
         Complex Zgauss(const int &ikk, const EMMODE &imode,
66 77
                             const int &itype, const Real &rho,
67
-                            const Real &wavef, KernelEm1DBase *Kernel);
78
+                            const Real &wavef, KernelEM1DBase* Kernel);
68 79
 
69 80
         /// Computes related kernels, if applicable, otherwise this is
70 81
         /// just a dummy function.
71
-        void ComputeRelated(const Real& rho, KernelEm1DBase* Kernel);
82
+        void ComputeRelated(const Real& rho, std::shared_ptr<KernelEM1DBase> Kernel);
72 83
 
73
-        void ComputeRelated(const Real& rho, std::vector< KernelEm1DBase* > KernelVec);
84
+        void ComputeRelated(const Real& rho, std::vector< std::shared_ptr<KernelEM1DBase> > KernelVec);
74 85
 
75
-        void ComputeRelated(const Real& rho, KernelEM1DManager* KernelManager);
86
+        void ComputeRelated(const Real& rho, std::shared_ptr<KernelEM1DManager> KernelManager);
76 87
 
77 88
         // ====================  ACCESS        =======================
78 89
 
79 90
         // ====================  INQUIRY       =======================
80 91
 
81
-        protected:
92
+        /** Returns the name of the underlying class, similiar to Python's type */
93
+        virtual inline std::string GetName() const {
94
+            return CName;
95
+        }
82 96
 
83
-        // ====================  LIFECYCLE     =======================
84
-
85
-        /** Default protected constructor, use New */
86
-        FHTKey51 (const std::string& name);
87
-
88
-        /** Default protected destructor, use Delete */
89
-        ~FHTKey51 ();
90
-
91
-        /**
92
-         *  @copybrief   LemmaObject::Release()
93
-         *  @copydetails LemmaObject::Release()
94
-         */
95
-        void Release();
97
+        protected:
96 98
 
97 99
         private:
98 100
 
@@ -104,6 +106,9 @@ namespace Lemma {
104 106
         /// Holds answer, dimensions are NumConv, and NumberRelated.
105 107
         Eigen::Matrix<Complex, Eigen::Dynamic, Eigen::Dynamic> Zans;
106 108
 
109
+        /** ASCII string representation of the class name */
110
+        static constexpr auto CName = "FHTKey51";
111
+
107 112
     }; // -----  end of class  FHTKey51  -----
108 113
 
109 114
 }		// -----  end of Lemma  name  -----

Modules/FDEM1D/include/hankeltransformgaussianquadrature.h → Modules/FDEM1D/include/GQChave.h Näytä tiedosto

@@ -12,45 +12,57 @@
12 12
 #ifndef  _HANKELTRANSFORMGAUSSIANQUADRATURE_h_INC
13 13
 #define  _HANKELTRANSFORMGAUSSIANQUADRATURE_h_INC
14 14
 
15
-#include "hankeltransform.h"
15
+#include "HankelTransform.h"
16 16
 #include "KernelEM1DBase.h"
17
-
18
-#ifdef HAVEBOOSTCYLBESSEL
17
+//#include <cmath>
19 18
 #include "boost/math/special_functions.hpp"
20
-#endif
19
+
21 20
 
22 21
 namespace Lemma {
23 22
 
24 23
 
25 24
 	// =======================================================================
26
-	//        Class:  HankelTransformGaussianQuadrature
25
+	//        Class:  GQChave
27 26
 	/// \brief  Calculates hankel transform using gaussian quadrature.
28 27
 	/// \details  Accurate but slow, this is a port of Alan Chave's public domain
29 28
     /// fortran code
30 29
 	// =======================================================================
31
-	class HankelTransformGaussianQuadrature : public HankelTransform {
30
+	class GQChave : public HankelTransform {
32 31
 
33
-		friend std::ostream &operator<<(std::ostream &stream,
34
-				const HankelTransformGaussianQuadrature &ob);
32
+		friend std::ostream &operator<<(std::ostream &stream, const GQChave &ob);
33
+
34
+        struct ctor_key{};
35 35
 
36 36
 		public:
37 37
 
38 38
 			// ====================  LIFECYCLE     ===========================
39 39
 
40
+			/// Default locked constructor.
41
+			GQChave ( const ctor_key& );
42
+
43
+            /** DeSerializing locked constructor, use DeSerialize */
44
+            GQChave ( const YAML::Node& node, const ctor_key& );
45
+
46
+            /// Default destructor
47
+			~GQChave ();
48
+
40 49
             /**
41
-             *  Returns pointer to new HankelTransformGaussianQuadrature.
50
+             *  Returns shared_ptr to new GQChave.
42 51
              *  Location is
43 52
              *  initialized to (0,0,0) type and polarization are
44 53
              *  initialized  to nonworking values that will throw
45 54
              *  exceptions if used.
46 55
              */
47
-			static HankelTransformGaussianQuadrature* New();
56
+			static std::shared_ptr<GQChave> NewSP();
57
+
58
+            /** YAML Serializing method
59
+             */
60
+            YAML::Node Serialize() const;
48 61
 
49 62
             /**
50
-             * @copybrief LemmaObject::Delete()
51
-             * @copydetails LemmaObject::Delete()
63
+             *   Constructs an object from a YAML::Node.
52 64
              */
53
-            void Delete();
65
+            static std::shared_ptr< GQChave > DeSerialize(const YAML::Node& node);
54 66
 
55 67
 			// ====================  OPERATORS     ===========================
56 68
 
@@ -66,30 +78,21 @@ namespace Lemma {
66 78
             //template <EMMODE T>
67 79
 			Complex Zgauss(const int &ikk, const EMMODE &imode,
68 80
 							const int &itype, const Real &rho,
69
-							const Real &wavef, KernelEm1DBase *Kernel);
81
+							const Real &wavef, KernelEM1DBase* Kernel);
70 82
 
71 83
 			// ====================  ACCESS        ============================
72 84
 
73 85
 			// ====================  INQUIRY       ============================
74 86
 
87
+            /** Returns the name of the underlying class, similiar to Python's type */
88
+            virtual inline std::string GetName() const {
89
+                return CName;
90
+            }
91
+
75 92
 			// ====================  DATA MEMBERS  ============================
76 93
 
77 94
 		protected:
78 95
 
79
-			// ====================  LIFECYCLE     ============================
80
-
81
-			/// Default protected constructor.
82
-			HankelTransformGaussianQuadrature (const std::string &name);
83
-
84
-            /// Default protected constructor.
85
-			~HankelTransformGaussianQuadrature ();
86
-
87
-            /**
88
-             * @copybrief LemmaObject::Release()
89
-             * @copydetails LemmaObject::Release()
90
-             */
91
-            void Release();
92
-
93 96
 			// ====================  OPERATIONS    ============================
94 97
 
95 98
 			/// Modified by Yoonho Song to branch cut, June, 1996
@@ -99,7 +102,7 @@ namespace Lemma {
99 102
 			///         for large arguments, it uses continued fraction also
100 103
 			/// It is recommended to use nl = 1 to 6, nu =7
101 104
 			/// PERFORMS AUTOMATIC CALCULATION OF BESSEL TRANSFORM TO SPECIFIED
102
-			/// RELATIVportisheadE AND ABSOLUTE ERROR
105
+			/// RELATIVE AND ABSOLUTE ERROR
103 106
 			///
104 107
 			/// ARGUMENT LIST:
105 108
 			///
@@ -133,7 +136,7 @@ namespace Lemma {
133 136
 							const int &nl, const int &nu, const Real &rho,
134 137
 							const Real &rerr, const Real &aerr,
135 138
 							const int &npcs, int &inew, const Real &aorb,
136
-							KernelEm1DBase *Kernel);
139
+							KernelEM1DBase* Kernel);
137 140
 
138 141
 			/// COMPUTES BESSEL TRANSFORM OF SPECIFIED ORDER DEFINED AS
139 142
 			/// INTEGRAL(FUNCT(X)*J-SUB-ORDER(X*R)*DX) FROM X=0 TO INFINITY
@@ -189,7 +192,7 @@ namespace Lemma {
189 192
  					const Real &RERR, const Real &AERR, const int &npcs,
190 193
  					VectorXi &XSUM, int &NSUM, int &NEW,
191 194
  					int &IERR, int &NCNTRL, const Real &AORB,
192
-					KernelEm1DBase *Kernel);
195
+					KernelEM1DBase* Kernel);
193 196
 
194 197
 			/// CALCULATES THE INTEGRAL OF F(X)*J-SUB-N(X*R) OVER THE
195 198
 			/// INTERVAL A TO B AT A SPECIFIED GAUSS ORDER THE RESULT IS
@@ -221,7 +224,7 @@ namespace Lemma {
221 224
             //template <EMMODE T>
222 225
 			void Besqud(const Real &A, const Real &B, Real &BESR, Real &BESI,
223 226
 							const int &NG, const int &NEW, const int &iorder,
224
-							const Real &R, KernelEm1DBase *Kernel);
227
+							const Real &R, KernelEM1DBase* Kernel);
225 228
 
226 229
 			/// COMPUTES SUM(S(I)),I=1,...N BY COMPUTATION OF PADE APPROXIMANT
227 230
 			/// USING CONTINUED FRACTION EXPANSION.  FUNCTION IS DESIGNED TO BE
@@ -329,7 +332,10 @@ namespace Lemma {
329 332
 
330 333
 		private:
331 334
 
332
-	}; // -----  end of class  HankelTransformGaussianQuadrature  -----
335
+            /** ASCII string representation of the class name */
336
+            static constexpr auto CName = "FHTKey51";
337
+
338
+	}; // -----  end of class  GQChave  -----
333 339
 
334 340
     //////////////////////////////////////////////////////////////
335 341
     // Exception Classes

+ 1
- 1
Modules/FDEM1D/include/HankelTransform.h Näytä tiedosto

@@ -52,7 +52,7 @@ namespace Lemma {
52 52
                 ///       passing by reference and using Kernel.get() instead.
53 53
                 virtual Complex Zgauss(const int &ikk, const EMMODE &imode,
54 54
                             const int &itype, const Real &rho,
55
-                            const Real &wavef, std::shared_ptr<KernelEM1DBase> Kernel)=0;
55
+                            const Real &wavef, KernelEM1DBase* Kernel)=0;
56 56
 
57 57
                 /// Computes related kernels, if applicable, otherwise this is
58 58
                 /// just a dummy function.

+ 1
- 1
Modules/FDEM1D/include/KernelEM1DBase.h Näytä tiedosto

@@ -66,7 +66,7 @@ namespace Lemma {
66 66
 
67 67
             virtual void SetMode(const EMMODE& mode)=0;
68 68
 
69
-            int GetManagerIndex() {
69
+            int GetManagerIndex() const {
70 70
                 return this->managerIdx;
71 71
             }
72 72
 

+ 5
- 0
Modules/FDEM1D/include/KernelEM1DManager.h Näytä tiedosto

@@ -117,6 +117,11 @@ namespace Lemma {
117 117
              */
118 118
             std::shared_ptr<KernelEM1DBase>    GetKernel(const unsigned int& ik);
119 119
 
120
+            /** Returns RAW pointer to specified kernel indice. Indices are assigned in the same
121
+                order as they are created by AddKernel.
122
+             */
123
+            KernelEM1DBase*                    GetRAWKernel(const unsigned int& ik);
124
+
120 125
             /** Returns pointer to connected dipole.
121 126
              */
122 127
             std::shared_ptr<DipoleSource>    GetDipole( );

+ 5
- 2
Modules/FDEM1D/src/CMakeLists.txt Näytä tiedosto

@@ -16,8 +16,11 @@ set (FDEM1DSOURCE
16 16
 	${CMAKE_CURRENT_SOURCE_DIR}/HankelTransform.cpp
17 17
 	${CMAKE_CURRENT_SOURCE_DIR}/FHTAnderson801.cpp
18 18
 	${CMAKE_CURRENT_SOURCE_DIR}/FHTKey201.cpp
19
-	#${CMAKE_CURRENT_SOURCE_DIR}/FHTKey101.cpp
20
-	#${CMAKE_CURRENT_SOURCE_DIR}/FHTKey51.cpp
19
+	${CMAKE_CURRENT_SOURCE_DIR}/FHTKey101.cpp
20
+	${CMAKE_CURRENT_SOURCE_DIR}/FHTKey51.cpp
21
+	${CMAKE_CURRENT_SOURCE_DIR}/GQChave.cpp
22
+	#${CMAKE_CURRENT_SOURCE_DIR}/QWEKey.cpp
23
+	
21 24
 
22 25
 	#${CMAKE_CURRENT_SOURCE_DIR}/AEMSurvey.cpp
23 26
 	#${CMAKE_CURRENT_SOURCE_DIR}/AEMSurveyReader.cpp

+ 70
- 70
Modules/FDEM1D/src/DipoleSource.cpp Näytä tiedosto

@@ -752,8 +752,8 @@ namespace Lemma {
752 752
                 if (std::abs(Pol[2]) > 0) { // z dipole
753 753
                     switch(FieldsToCalculate) {
754 754
                         case E:
755
-                            f(10) = Hankel->Zgauss(10, TM, 1, rho, wavef, KernelManager->GetKernel(ik[10])) / KernelManager->GetKernel(ik[10])->GetYm();
756
-                            f(11) = Hankel->Zgauss(11, TM, 0, rho, wavef, KernelManager->GetKernel(ik[11])) / KernelManager->GetKernel(ik[11])->GetYm();
755
+                            f(10) = Hankel->Zgauss(10, TM, 1, rho, wavef, KernelManager->GetRAWKernel(ik[10])) / KernelManager->GetRAWKernel(ik[10])->GetYm();
756
+                            f(11) = Hankel->Zgauss(11, TM, 0, rho, wavef, KernelManager->GetRAWKernel(ik[11])) / KernelManager->GetRAWKernel(ik[11])->GetYm();
757 757
                             std::cout.precision(12);
758 758
                             this->Receivers->AppendEfield(ifreq, irec,
759 759
                                 -Pol[2]*QPI*cp*f(10)*Moment,
@@ -762,7 +762,7 @@ namespace Lemma {
762 762
                             break;
763 763
 
764 764
                         case H:
765
-                            f(12) = Hankel->Zgauss(12, TM, 1, rho, wavef, KernelManager->GetKernel(ik[12]));
765
+                            f(12) = Hankel->Zgauss(12, TM, 1, rho, wavef, KernelManager->GetRAWKernel(ik[12]));
766 766
                             this->Receivers->AppendHfield(ifreq, irec,
767 767
                                 -Pol[2]*QPI*sp*f(12)*Moment,
768 768
                                  Pol[2]*QPI*cp*f(12)*Moment,
@@ -770,14 +770,14 @@ namespace Lemma {
770 770
                             break;
771 771
 
772 772
                         case BOTH:
773
-                            f(10) = Hankel->Zgauss(10, TM, 1, rho, wavef, KernelManager->GetKernel(ik[10])) / KernelManager->GetKernel(ik[10])->GetYm();
774
-                            f(11) = Hankel->Zgauss(11, TM, 0, rho, wavef, KernelManager->GetKernel(ik[11])) / KernelManager->GetKernel(ik[11])->GetYm();
773
+                            f(10) = Hankel->Zgauss(10, TM, 1, rho, wavef, KernelManager->GetRAWKernel(ik[10])) / KernelManager->GetRAWKernel(ik[10])->GetYm();
774
+                            f(11) = Hankel->Zgauss(11, TM, 0, rho, wavef, KernelManager->GetRAWKernel(ik[11])) / KernelManager->GetRAWKernel(ik[11])->GetYm();
775 775
                             this->Receivers->AppendEfield(ifreq, irec,
776 776
                                     -Pol[2]*QPI*cp*f(10)*Moment,
777 777
                                     -Pol[2]*QPI*sp*f(10)*Moment,
778 778
                                      Pol[2]*QPI*f(11)*Moment   );
779 779
 
780
-                            f(12) = Hankel->Zgauss(12, TM, 1, rho, wavef, KernelManager->GetKernel(ik[12]));
780
+                            f(12) = Hankel->Zgauss(12, TM, 1, rho, wavef, KernelManager->GetRAWKernel(ik[12]));
781 781
                             this->Receivers->AppendHfield(ifreq, irec,
782 782
                                     -Pol[2]*QPI*sp*f(12)*Moment,
783 783
                                      Pol[2]*QPI*cp*f(12)*Moment,
@@ -787,11 +787,11 @@ namespace Lemma {
787 787
                 if (std::abs(Pol[1]) > 0 || std::abs(Pol[0]) > 0) { // y dipole
788 788
                     switch(FieldsToCalculate) {
789 789
                         case E:
790
-                            f(2) = Hankel->Zgauss(2, TE, 0, rho, wavef, KernelManager->GetKernel(ik[2])) * KernelManager->GetKernel(ik[2])->GetZs();
791
-                            f(3) = Hankel->Zgauss(3, TE, 1, rho, wavef, KernelManager->GetKernel(ik[3])) * KernelManager->GetKernel(ik[3])->GetZs();
792
-                            f(0) = Hankel->Zgauss(0, TM, 0, rho, wavef, KernelManager->GetKernel(ik[0])) / KernelManager->GetKernel(ik[0])->GetYm();
793
-                            f(1) = Hankel->Zgauss(1, TM, 1, rho, wavef, KernelManager->GetKernel(ik[1])) / KernelManager->GetKernel(ik[1])->GetYm();
794
-                            f(4) = Hankel->Zgauss(4, TM, 1, rho, wavef, KernelManager->GetKernel(ik[4])) / KernelManager->GetKernel(ik[4])->GetYm();
790
+                            f(2) = Hankel->Zgauss(2, TE, 0, rho, wavef, KernelManager->GetRAWKernel(ik[2])) * KernelManager->GetRAWKernel(ik[2])->GetZs();
791
+                            f(3) = Hankel->Zgauss(3, TE, 1, rho, wavef, KernelManager->GetRAWKernel(ik[3])) * KernelManager->GetRAWKernel(ik[3])->GetZs();
792
+                            f(0) = Hankel->Zgauss(0, TM, 0, rho, wavef, KernelManager->GetRAWKernel(ik[0])) / KernelManager->GetRAWKernel(ik[0])->GetYm();
793
+                            f(1) = Hankel->Zgauss(1, TM, 1, rho, wavef, KernelManager->GetRAWKernel(ik[1])) / KernelManager->GetRAWKernel(ik[1])->GetYm();
794
+                            f(4) = Hankel->Zgauss(4, TM, 1, rho, wavef, KernelManager->GetRAWKernel(ik[4])) / KernelManager->GetRAWKernel(ik[4])->GetYm();
795 795
                             if (std::abs(Pol[1]) > 0) {
796 796
                                 this->Receivers->AppendEfield(ifreq, irec,
797 797
                                     Pol[1]*QPI*scp*((f(0)-(Real)(2.)*f(1)/rho)+(f(2)-(Real)(2.)*f(3)/rho))*Moment,
@@ -806,11 +806,11 @@ namespace Lemma {
806 806
                             }
807 807
                             break;
808 808
                         case H:
809
-                            f(5) = Hankel->Zgauss(5, TM, 0, rho, wavef, KernelManager->GetKernel(ik[5]));
810
-                            f(6) = Hankel->Zgauss(6, TM, 1, rho, wavef, KernelManager->GetKernel(ik[6]));
811
-                            f(7) = Hankel->Zgauss(7, TE, 0, rho, wavef, KernelManager->GetKernel(ik[7]))*KernelManager->GetKernel(ik[7])->GetZs()/KernelManager->GetKernel(ik[7])->GetZm();
812
-                            f(8) = Hankel->Zgauss(8, TE, 1, rho, wavef, KernelManager->GetKernel(ik[8]))*KernelManager->GetKernel(ik[8])->GetZs()/KernelManager->GetKernel(ik[8])->GetZm();
813
-                            f(9) = Hankel->Zgauss(9, TE, 1, rho, wavef, KernelManager->GetKernel(ik[9]))*KernelManager->GetKernel(ik[9])->GetZs()/KernelManager->GetKernel(ik[9])->GetZm();
809
+                            f(5) = Hankel->Zgauss(5, TM, 0, rho, wavef, KernelManager->GetRAWKernel(ik[5]));
810
+                            f(6) = Hankel->Zgauss(6, TM, 1, rho, wavef, KernelManager->GetRAWKernel(ik[6]));
811
+                            f(7) = Hankel->Zgauss(7, TE, 0, rho, wavef, KernelManager->GetRAWKernel(ik[7]))*KernelManager->GetRAWKernel(ik[7])->GetZs()/KernelManager->GetRAWKernel(ik[7])->GetZm();
812
+                            f(8) = Hankel->Zgauss(8, TE, 1, rho, wavef, KernelManager->GetRAWKernel(ik[8]))*KernelManager->GetRAWKernel(ik[8])->GetZs()/KernelManager->GetRAWKernel(ik[8])->GetZm();
813
+                            f(9) = Hankel->Zgauss(9, TE, 1, rho, wavef, KernelManager->GetRAWKernel(ik[9]))*KernelManager->GetRAWKernel(ik[9])->GetZs()/KernelManager->GetRAWKernel(ik[9])->GetZm();
814 814
                             if (std::abs(Pol[1]) > 0) {
815 815
                                 this->Receivers->AppendHfield(ifreq, irec,
816 816
                                         Pol[1]*QPI*(sps*f(5)+c2p*f(6)/rho-cps*f(7)+c2p*f(8)/rho)*Moment,
@@ -825,16 +825,16 @@ namespace Lemma {
825 825
                             }
826 826
                             break;
827 827
                         case BOTH:
828
-                            f(0) = Hankel->Zgauss(0, TM, 0, rho, wavef, KernelManager->GetKernel(ik[0])) / KernelManager->GetKernel(ik[0])->GetYm();
829
-                            f(1) = Hankel->Zgauss(1, TM, 1, rho, wavef, KernelManager->GetKernel(ik[1])) / KernelManager->GetKernel(ik[1])->GetYm();
830
-                            f(4) = Hankel->Zgauss(4, TM, 1, rho, wavef, KernelManager->GetKernel(ik[4])) / KernelManager->GetKernel(ik[4])->GetYm();
831
-                            f(2) = Hankel->Zgauss(2, TE, 0, rho, wavef, KernelManager->GetKernel(ik[2])) * KernelManager->GetKernel(ik[2])->GetZs();
832
-                            f(3) = Hankel->Zgauss(3, TE, 1, rho, wavef, KernelManager->GetKernel(ik[3])) * KernelManager->GetKernel(ik[3])->GetZs();
833
-                            f(5) = Hankel->Zgauss(5, TM, 0, rho, wavef, KernelManager->GetKernel(ik[5]));
834
-                            f(6) = Hankel->Zgauss(6, TM, 1, rho, wavef, KernelManager->GetKernel(ik[6]));
835
-                            f(7) = Hankel->Zgauss(7, TE, 0, rho, wavef, KernelManager->GetKernel(ik[7]))*KernelManager->GetKernel(ik[7])->GetZs()/KernelManager->GetKernel(ik[7])->GetZm();
836
-                            f(8) = Hankel->Zgauss(8, TE, 1, rho, wavef, KernelManager->GetKernel(ik[8]))*KernelManager->GetKernel(ik[8])->GetZs()/KernelManager->GetKernel(ik[8])->GetZm();
837
-                            f(9) = Hankel->Zgauss(9, TE, 1, rho, wavef, KernelManager->GetKernel(ik[9]))*KernelManager->GetKernel(ik[9])->GetZs()/KernelManager->GetKernel(ik[9])->GetZm();
828
+                            f(0) = Hankel->Zgauss(0, TM, 0, rho, wavef, KernelManager->GetRAWKernel(ik[0])) / KernelManager->GetRAWKernel(ik[0])->GetYm();
829
+                            f(1) = Hankel->Zgauss(1, TM, 1, rho, wavef, KernelManager->GetRAWKernel(ik[1])) / KernelManager->GetRAWKernel(ik[1])->GetYm();
830
+                            f(4) = Hankel->Zgauss(4, TM, 1, rho, wavef, KernelManager->GetRAWKernel(ik[4])) / KernelManager->GetRAWKernel(ik[4])->GetYm();
831
+                            f(2) = Hankel->Zgauss(2, TE, 0, rho, wavef, KernelManager->GetRAWKernel(ik[2])) * KernelManager->GetRAWKernel(ik[2])->GetZs();
832
+                            f(3) = Hankel->Zgauss(3, TE, 1, rho, wavef, KernelManager->GetRAWKernel(ik[3])) * KernelManager->GetRAWKernel(ik[3])->GetZs();
833
+                            f(5) = Hankel->Zgauss(5, TM, 0, rho, wavef, KernelManager->GetRAWKernel(ik[5]));
834
+                            f(6) = Hankel->Zgauss(6, TM, 1, rho, wavef, KernelManager->GetRAWKernel(ik[6]));
835
+                            f(7) = Hankel->Zgauss(7, TE, 0, rho, wavef, KernelManager->GetRAWKernel(ik[7]))*KernelManager->GetRAWKernel(ik[7])->GetZs()/KernelManager->GetRAWKernel(ik[7])->GetZm();
836
+                            f(8) = Hankel->Zgauss(8, TE, 1, rho, wavef, KernelManager->GetRAWKernel(ik[8]))*KernelManager->GetRAWKernel(ik[8])->GetZs()/KernelManager->GetRAWKernel(ik[8])->GetZm();
837
+                            f(9) = Hankel->Zgauss(9, TE, 1, rho, wavef, KernelManager->GetRAWKernel(ik[9]))*KernelManager->GetRAWKernel(ik[9])->GetZs()/KernelManager->GetRAWKernel(ik[9])->GetZm();
838 838
 
839 839
                             if (std::abs(Pol[1]) > 0) {
840 840
                                 this->Receivers->AppendEfield(ifreq, irec,
@@ -872,7 +872,7 @@ namespace Lemma {
872 872
                     switch(FieldsToCalculate) {
873 873
                         case E:
874 874
                             f(10) = 0;
875
-                            f(11) = Hankel->Zgauss(11, TM, 0, rho, wavef, KernelManager->GetKernel(ik[11])) / KernelManager->GetKernel(ik[11])->GetYm();
875
+                            f(11) = Hankel->Zgauss(11, TM, 0, rho, wavef, KernelManager->GetRAWKernel(ik[11])) / KernelManager->GetRAWKernel(ik[11])->GetYm();
876 876
 
877 877
                             this->Receivers->AppendEfield(ifreq, irec,
878 878
                                 -Pol[2]*QPI*cp*f(10)*Moment,
@@ -881,7 +881,7 @@ namespace Lemma {
881 881
                             break;
882 882
 
883 883
                         case H:
884
-                            f(12) = Hankel->Zgauss(12, TM, 1, rho, wavef, KernelManager->GetKernel(ik[12]));
884
+                            f(12) = Hankel->Zgauss(12, TM, 1, rho, wavef, KernelManager->GetRAWKernel(ik[12]));
885 885
                             this->Receivers->AppendHfield(ifreq, irec,
886 886
                                 -Pol[2]*QPI*sp*f(12)*Moment,
887 887
                                  Pol[2]*QPI*cp*f(12)*Moment,
@@ -890,13 +890,13 @@ namespace Lemma {
890 890
 
891 891
                         case BOTH:
892 892
                             f(10) = 0;
893
-                            f(11) = Hankel->Zgauss(11, TM, 0, rho, wavef, KernelManager->GetKernel(ik[11])) / KernelManager->GetKernel(ik[11])->GetYm();
893
+                            f(11) = Hankel->Zgauss(11, TM, 0, rho, wavef, KernelManager->GetRAWKernel(ik[11])) / KernelManager->GetRAWKernel(ik[11])->GetYm();
894 894
                             this->Receivers->AppendEfield(ifreq, irec,
895 895
                                     -Pol[2]*QPI*cp*f(10)*Moment,
896 896
                                     -Pol[2]*QPI*sp*f(10)*Moment,
897 897
                                      Pol[2]*QPI*f(11)*Moment   );
898 898
 
899
-                            f(12) = Hankel->Zgauss(12, TM, 1, rho, wavef, KernelManager->GetKernel(ik[12]));
899
+                            f(12) = Hankel->Zgauss(12, TM, 1, rho, wavef, KernelManager->GetRAWKernel(ik[12]));
900 900
                             this->Receivers->AppendHfield(ifreq, irec,
901 901
                                     -Pol[2]*QPI*sp*f(12)*Moment,
902 902
                                      Pol[2]*QPI*cp*f(12)*Moment,
@@ -908,8 +908,8 @@ namespace Lemma {
908 908
                         case E:
909 909
                             f(0) = 0;
910 910
                             f(1) = 0;
911
-                            f(2) = Hankel->Zgauss(2, TE, 0, rho, wavef, KernelManager->GetKernel(ik[2])) * KernelManager->GetKernel(ik[2])->GetZs();
912
-                            f(3) = Hankel->Zgauss(3, TE, 1, rho, wavef, KernelManager->GetKernel(ik[3])) * KernelManager->GetKernel(ik[3])->GetZs();
911
+                            f(2) = Hankel->Zgauss(2, TE, 0, rho, wavef, KernelManager->GetRAWKernel(ik[2])) * KernelManager->GetRAWKernel(ik[2])->GetZs();
912
+                            f(3) = Hankel->Zgauss(3, TE, 1, rho, wavef, KernelManager->GetRAWKernel(ik[3])) * KernelManager->GetRAWKernel(ik[3])->GetZs();
913 913
                             f(4) = 0;
914 914
                             if (std::abs(Pol[1]) > 0) {
915 915
                                 this->Receivers->AppendEfield(ifreq, irec,
@@ -925,11 +925,11 @@ namespace Lemma {
925 925
                             }
926 926
                             break;
927 927
                         case H:
928
-                            f(5) = Hankel->Zgauss(5, TM, 0, rho, wavef, KernelManager->GetKernel(ik[5]));
929
-                            f(6) = Hankel->Zgauss(6, TM, 1, rho, wavef, KernelManager->GetKernel(ik[6]));
930
-                            f(7) = Hankel->Zgauss(7, TE, 0, rho, wavef, KernelManager->GetKernel(ik[7]))*KernelManager->GetKernel(ik[7])->GetZs()/KernelManager->GetKernel(ik[7])->GetZm();
931
-                            f(8) = Hankel->Zgauss(8, TE, 1, rho, wavef, KernelManager->GetKernel(ik[8]))*KernelManager->GetKernel(ik[8])->GetZs()/KernelManager->GetKernel(ik[8])->GetZm();
932
-                            f(9) = Hankel->Zgauss(9, TE, 1, rho, wavef, KernelManager->GetKernel(ik[9]))*KernelManager->GetKernel(ik[9])->GetZs()/KernelManager->GetKernel(ik[9])->GetZm();
928
+                            f(5) = Hankel->Zgauss(5, TM, 0, rho, wavef, KernelManager->GetRAWKernel(ik[5]));
929
+                            f(6) = Hankel->Zgauss(6, TM, 1, rho, wavef, KernelManager->GetRAWKernel(ik[6]));
930
+                            f(7) = Hankel->Zgauss(7, TE, 0, rho, wavef, KernelManager->GetRAWKernel(ik[7]))*KernelManager->GetRAWKernel(ik[7])->GetZs()/KernelManager->GetRAWKernel(ik[7])->GetZm();
931
+                            f(8) = Hankel->Zgauss(8, TE, 1, rho, wavef, KernelManager->GetRAWKernel(ik[8]))*KernelManager->GetRAWKernel(ik[8])->GetZs()/KernelManager->GetRAWKernel(ik[8])->GetZm();
932
+                            f(9) = Hankel->Zgauss(9, TE, 1, rho, wavef, KernelManager->GetRAWKernel(ik[9]))*KernelManager->GetRAWKernel(ik[9])->GetZs()/KernelManager->GetRAWKernel(ik[9])->GetZm();
933 933
                             if (std::abs(Pol[1]) > 0) {
934 934
                                 this->Receivers->AppendHfield(ifreq, irec,
935 935
                                         Pol[1]*QPI*(sps*f(5)+c2p*f(6)/rho-cps*f(7)+c2p*f(8)/rho)*Moment,
@@ -950,13 +950,13 @@ namespace Lemma {
950 950
                             f(0) = 0;
951 951
                             f(1) = 0;
952 952
                             f(4) = 0;
953
-                            f(2) = Hankel->Zgauss(2, TE, 0, rho, wavef, KernelManager->GetKernel(ik[2])) * KernelManager->GetKernel(0)->GetZs();
954
-                            f(3) = Hankel->Zgauss(3, TE, 1, rho, wavef, KernelManager->GetKernel(ik[3])) * KernelManager->GetKernel(1)->GetZs();
955
-                            f(5) = Hankel->Zgauss(5, TM, 0, rho, wavef, KernelManager->GetKernel(ik[5]));
956
-                            f(6) = Hankel->Zgauss(6, TM, 1, rho, wavef, KernelManager->GetKernel(ik[6]));
957
-                            f(7) = Hankel->Zgauss(7, TE, 0, rho, wavef, KernelManager->GetKernel(ik[7]))*KernelManager->GetKernel(ik[7])->GetZs()/KernelManager->GetKernel(ik[7])->GetZm();
958
-                            f(8) = Hankel->Zgauss(8, TE, 1, rho, wavef, KernelManager->GetKernel(ik[8]))*KernelManager->GetKernel(ik[8])->GetZs()/KernelManager->GetKernel(ik[8])->GetZm();
959
-                            f(9) = Hankel->Zgauss(9, TE, 1, rho, wavef, KernelManager->GetKernel(ik[9]))*KernelManager->GetKernel(ik[9])->GetZs()/KernelManager->GetKernel(ik[9])->GetZm();
953
+                            f(2) = Hankel->Zgauss(2, TE, 0, rho, wavef, KernelManager->GetRAWKernel(ik[2])) * KernelManager->GetRAWKernel(0)->GetZs();
954
+                            f(3) = Hankel->Zgauss(3, TE, 1, rho, wavef, KernelManager->GetRAWKernel(ik[3])) * KernelManager->GetRAWKernel(1)->GetZs();
955
+                            f(5) = Hankel->Zgauss(5, TM, 0, rho, wavef, KernelManager->GetRAWKernel(ik[5]));
956
+                            f(6) = Hankel->Zgauss(6, TM, 1, rho, wavef, KernelManager->GetRAWKernel(ik[6]));
957
+                            f(7) = Hankel->Zgauss(7, TE, 0, rho, wavef, KernelManager->GetRAWKernel(ik[7]))*KernelManager->GetRAWKernel(ik[7])->GetZs()/KernelManager->GetRAWKernel(ik[7])->GetZm();
958
+                            f(8) = Hankel->Zgauss(8, TE, 1, rho, wavef, KernelManager->GetRAWKernel(ik[8]))*KernelManager->GetRAWKernel(ik[8])->GetZs()/KernelManager->GetRAWKernel(ik[8])->GetZm();
959
+                            f(9) = Hankel->Zgauss(9, TE, 1, rho, wavef, KernelManager->GetRAWKernel(ik[9]))*KernelManager->GetRAWKernel(ik[9])->GetZs()/KernelManager->GetRAWKernel(ik[9])->GetZm();
960 960
 
961 961
                             if (std::abs(Pol[1]) > 0) {
962 962
                                 this->Receivers->AppendEfield(ifreq, irec,
@@ -995,15 +995,15 @@ namespace Lemma {
995 995
                 if (std::abs(Pol[2]) > 0) { // z dipole
996 996
                     switch(FieldsToCalculate) {
997 997
                         case E:
998
-                            f(12)=Hankel->Zgauss(12, TE, 1, rho, wavef, KernelManager->GetKernel(ik[12]))*KernelManager->GetKernel(ik[12])->GetZs();
998
+                            f(12)=Hankel->Zgauss(12, TE, 1, rho, wavef, KernelManager->GetRAWKernel(ik[12]))*KernelManager->GetRAWKernel(ik[12])->GetZs();
999 999
                             this->Receivers->AppendEfield(ifreq, irec,
1000 1000
                                  Pol[2]*Moment*QPI*sp*f(12),
1001 1001
                                 -Pol[2]*Moment*QPI*cp*f(12),
1002 1002
                                  0);
1003 1003
                             break;
1004 1004
                         case H:
1005
-                            f(10)=Hankel->Zgauss(10, TE, 1, rho, wavef, KernelManager->GetKernel(ik[10]))*KernelManager->GetKernel(ik[10])->GetZs()/KernelManager->GetKernel(ik[10])->GetZm();
1006
-                            f(11)=Hankel->Zgauss(11, TE, 0, rho, wavef, KernelManager->GetKernel(ik[11]))*KernelManager->GetKernel(ik[11])->GetZs()/KernelManager->GetKernel(ik[11])->GetZm();
1005
+                            f(10)=Hankel->Zgauss(10, TE, 1, rho, wavef, KernelManager->GetRAWKernel(ik[10]))*KernelManager->GetRAWKernel(ik[10])->GetZs()/KernelManager->GetRAWKernel(ik[10])->GetZm();
1006
+                            f(11)=Hankel->Zgauss(11, TE, 0, rho, wavef, KernelManager->GetRAWKernel(ik[11]))*KernelManager->GetRAWKernel(ik[11])->GetZs()/KernelManager->GetRAWKernel(ik[11])->GetZm();
1007 1007
                             this->Receivers->AppendHfield(ifreq, irec,
1008 1008
                                 -Pol[2]*Moment*QPI*cp*f(10),
1009 1009
                                 -Pol[2]*Moment*QPI*sp*f(10),
@@ -1011,9 +1011,9 @@ namespace Lemma {
1011 1011
                             break;
1012 1012
 
1013 1013
                         case BOTH:
1014
-                            f(12)=Hankel->Zgauss(12, TE, 1, rho, wavef, KernelManager->GetKernel(ik[12]))*KernelManager->GetKernel(ik[12])->GetZs();
1015
-                            f(10)=Hankel->Zgauss(10, TE, 1, rho, wavef, KernelManager->GetKernel(ik[10]))*KernelManager->GetKernel(ik[10])->GetZs()/KernelManager->GetKernel(ik[10])->GetZm();
1016
-                            f(11)=Hankel->Zgauss(11, TE, 0, rho, wavef, KernelManager->GetKernel(ik[11]))*KernelManager->GetKernel(ik[11])->GetZs()/KernelManager->GetKernel(ik[11])->GetZm();
1014
+                            f(12)=Hankel->Zgauss(12, TE, 1, rho, wavef, KernelManager->GetRAWKernel(ik[12]))*KernelManager->GetRAWKernel(ik[12])->GetZs();
1015
+                            f(10)=Hankel->Zgauss(10, TE, 1, rho, wavef, KernelManager->GetRAWKernel(ik[10]))*KernelManager->GetRAWKernel(ik[10])->GetZs()/KernelManager->GetRAWKernel(ik[10])->GetZm();
1016
+                            f(11)=Hankel->Zgauss(11, TE, 0, rho, wavef, KernelManager->GetRAWKernel(ik[11]))*KernelManager->GetRAWKernel(ik[11])->GetZs()/KernelManager->GetRAWKernel(ik[11])->GetZm();
1017 1017
 
1018 1018
                             this->Receivers->AppendEfield(ifreq, irec,
1019 1019
                                  Pol[2]*Moment*QPI*sp*f(12),
@@ -1033,11 +1033,11 @@ namespace Lemma {
1033 1033
 
1034 1034
                         case E:
1035 1035
 
1036
-                            f(5) = Hankel->Zgauss(5, TE, 0, rho, wavef, KernelManager->GetKernel(ik[5]))*KernelManager->GetKernel(ik[5])->GetZs();
1037
-                            f(6) = Hankel->Zgauss(6, TE, 1, rho, wavef, KernelManager->GetKernel(ik[6]))*KernelManager->GetKernel(ik[6])->GetZs();
1038
-                            f(7) = Hankel->Zgauss(7, TM, 0, rho, wavef, KernelManager->GetKernel(ik[7]))*KernelManager->GetKernel(ik[7])->GetKs()/KernelManager->GetKernel(ik[7])->GetYm();
1039
-                            f(8) = Hankel->Zgauss(8, TM, 1, rho, wavef, KernelManager->GetKernel(ik[8]))*KernelManager->GetKernel(ik[8])->GetKs()/KernelManager->GetKernel(ik[8])->GetYm();
1040
-                            f(9) = Hankel->Zgauss(9, TM, 1, rho, wavef, KernelManager->GetKernel(ik[9]))*KernelManager->GetKernel(ik[9])->GetKs()/KernelManager->GetKernel(ik[9])->GetYm();
1036
+                            f(5) = Hankel->Zgauss(5, TE, 0, rho, wavef, KernelManager->GetRAWKernel(ik[5]))*KernelManager->GetRAWKernel(ik[5])->GetZs();
1037
+                            f(6) = Hankel->Zgauss(6, TE, 1, rho, wavef, KernelManager->GetRAWKernel(ik[6]))*KernelManager->GetRAWKernel(ik[6])->GetZs();
1038
+                            f(7) = Hankel->Zgauss(7, TM, 0, rho, wavef, KernelManager->GetRAWKernel(ik[7]))*KernelManager->GetRAWKernel(ik[7])->GetKs()/KernelManager->GetRAWKernel(ik[7])->GetYm();
1039
+                            f(8) = Hankel->Zgauss(8, TM, 1, rho, wavef, KernelManager->GetRAWKernel(ik[8]))*KernelManager->GetRAWKernel(ik[8])->GetKs()/KernelManager->GetRAWKernel(ik[8])->GetYm();
1040
+                            f(9) = Hankel->Zgauss(9, TM, 1, rho, wavef, KernelManager->GetRAWKernel(ik[9]))*KernelManager->GetRAWKernel(ik[9])->GetKs()/KernelManager->GetRAWKernel(ik[9])->GetYm();
1041 1041
 
1042 1042
                             if (std::abs(Pol[0]) > 0) {
1043 1043
                                 this->Receivers->AppendEfield(ifreq, irec,
@@ -1054,11 +1054,11 @@ namespace Lemma {
1054 1054
                             break;
1055 1055
 
1056 1056
                         case H:
1057
-                            f(0) = Hankel->Zgauss(0, TE, 0, rho, wavef, KernelManager->GetKernel(ik[0]))*KernelManager->GetKernel(ik[0])->GetZs()/KernelManager->GetKernel(ik[0])->GetZm();
1058
-                            f(1) = Hankel->Zgauss(1, TE, 1, rho, wavef, KernelManager->GetKernel(ik[1]))*KernelManager->GetKernel(ik[1])->GetZs()/KernelManager->GetKernel(ik[1])->GetZm();
1059
-                            f(4) = Hankel->Zgauss(4, TE, 1, rho, wavef, KernelManager->GetKernel(ik[4]))*KernelManager->GetKernel(ik[4])->GetZs()/KernelManager->GetKernel(ik[4])->GetZm();
1060
-                            f(2) = Hankel->Zgauss(2, TM, 0, rho, wavef, KernelManager->GetKernel(ik[2]))*KernelManager->GetKernel(ik[2])->GetKs();
1061
-                            f(3) = Hankel->Zgauss(3, TM, 1, rho, wavef, KernelManager->GetKernel(ik[3]))*KernelManager->GetKernel(ik[3])->GetKs();
1057
+                            f(0) = Hankel->Zgauss(0, TE, 0, rho, wavef, KernelManager->GetRAWKernel(ik[0]))*KernelManager->GetRAWKernel(ik[0])->GetZs()/KernelManager->GetRAWKernel(ik[0])->GetZm();
1058
+                            f(1) = Hankel->Zgauss(1, TE, 1, rho, wavef, KernelManager->GetRAWKernel(ik[1]))*KernelManager->GetRAWKernel(ik[1])->GetZs()/KernelManager->GetRAWKernel(ik[1])->GetZm();
1059
+                            f(4) = Hankel->Zgauss(4, TE, 1, rho, wavef, KernelManager->GetRAWKernel(ik[4]))*KernelManager->GetRAWKernel(ik[4])->GetZs()/KernelManager->GetRAWKernel(ik[4])->GetZm();
1060
+                            f(2) = Hankel->Zgauss(2, TM, 0, rho, wavef, KernelManager->GetRAWKernel(ik[2]))*KernelManager->GetRAWKernel(ik[2])->GetKs();
1061
+                            f(3) = Hankel->Zgauss(3, TM, 1, rho, wavef, KernelManager->GetRAWKernel(ik[3]))*KernelManager->GetRAWKernel(ik[3])->GetKs();
1062 1062
 
1063 1063
                             if (std::abs(Pol[0]) > 0) {
1064 1064
                                 this->Receivers->AppendHfield(ifreq, irec,
@@ -1075,16 +1075,16 @@ namespace Lemma {
1075 1075
                             break;
1076 1076
 
1077 1077
                         case BOTH:
1078
-                            f(5) = Hankel->Zgauss(5, TE, 0, rho, wavef, KernelManager->GetKernel(ik[5]))*KernelManager->GetKernel(ik[5])->GetZs();
1079
-                            f(6) = Hankel->Zgauss(6, TE, 1, rho, wavef, KernelManager->GetKernel(ik[6]))*KernelManager->GetKernel(ik[6])->GetZs();
1080
-                            f(7) = Hankel->Zgauss(7, TM, 0, rho, wavef, KernelManager->GetKernel(ik[7]))*KernelManager->GetKernel(ik[7])->GetKs()/KernelManager->GetKernel(ik[7])->GetYm();
1081
-                            f(8) = Hankel->Zgauss(8, TM, 1, rho, wavef, KernelManager->GetKernel(ik[8]))*KernelManager->GetKernel(ik[8])->GetKs()/KernelManager->GetKernel(ik[8])->GetYm();
1082
-                            f(9) = Hankel->Zgauss(9, TM, 1, rho, wavef, KernelManager->GetKernel(ik[9]))*KernelManager->GetKernel(ik[9])->GetKs()/KernelManager->GetKernel(ik[9])->GetYm();
1083
-                            f(0) = Hankel->Zgauss(0, TE, 0, rho, wavef, KernelManager->GetKernel(ik[0]))*KernelManager->GetKernel(ik[0])->GetZs()/KernelManager->GetKernel(ik[0])->GetZm();
1084
-                            f(1) = Hankel->Zgauss(1, TE, 1, rho, wavef, KernelManager->GetKernel(ik[1]))*KernelManager->GetKernel(ik[1])->GetZs()/KernelManager->GetKernel(ik[1])->GetZm();
1085
-                            f(4) = Hankel->Zgauss(4, TE, 1, rho, wavef, KernelManager->GetKernel(ik[4]))*KernelManager->GetKernel(ik[4])->GetZs()/KernelManager->GetKernel(ik[4])->GetZm();
1086
-                            f(2) = Hankel->Zgauss(2, TM, 0, rho, wavef, KernelManager->GetKernel(ik[2]))*KernelManager->GetKernel(ik[2])->GetKs();
1087
-                            f(3) = Hankel->Zgauss(3, TM, 1, rho, wavef, KernelManager->GetKernel(ik[3]))*KernelManager->GetKernel(ik[3])->GetKs();
1078
+                            f(5) = Hankel->Zgauss(5, TE, 0, rho, wavef, KernelManager->GetRAWKernel(ik[5]))*KernelManager->GetRAWKernel(ik[5])->GetZs();
1079
+                            f(6) = Hankel->Zgauss(6, TE, 1, rho, wavef, KernelManager->GetRAWKernel(ik[6]))*KernelManager->GetRAWKernel(ik[6])->GetZs();
1080
+                            f(7) = Hankel->Zgauss(7, TM, 0, rho, wavef, KernelManager->GetRAWKernel(ik[7]))*KernelManager->GetRAWKernel(ik[7])->GetKs()/KernelManager->GetRAWKernel(ik[7])->GetYm();
1081
+                            f(8) = Hankel->Zgauss(8, TM, 1, rho, wavef, KernelManager->GetRAWKernel(ik[8]))*KernelManager->GetRAWKernel(ik[8])->GetKs()/KernelManager->GetRAWKernel(ik[8])->GetYm();
1082
+                            f(9) = Hankel->Zgauss(9, TM, 1, rho, wavef, KernelManager->GetRAWKernel(ik[9]))*KernelManager->GetRAWKernel(ik[9])->GetKs()/KernelManager->GetRAWKernel(ik[9])->GetYm();
1083
+                            f(0) = Hankel->Zgauss(0, TE, 0, rho, wavef, KernelManager->GetRAWKernel(ik[0]))*KernelManager->GetRAWKernel(ik[0])->GetZs()/KernelManager->GetRAWKernel(ik[0])->GetZm();
1084
+                            f(1) = Hankel->Zgauss(1, TE, 1, rho, wavef, KernelManager->GetRAWKernel(ik[1]))*KernelManager->GetRAWKernel(ik[1])->GetZs()/KernelManager->GetRAWKernel(ik[1])->GetZm();
1085
+                            f(4) = Hankel->Zgauss(4, TE, 1, rho, wavef, KernelManager->GetRAWKernel(ik[4]))*KernelManager->GetRAWKernel(ik[4])->GetZs()/KernelManager->GetRAWKernel(ik[4])->GetZm();
1086
+                            f(2) = Hankel->Zgauss(2, TM, 0, rho, wavef, KernelManager->GetRAWKernel(ik[2]))*KernelManager->GetRAWKernel(ik[2])->GetKs();
1087
+                            f(3) = Hankel->Zgauss(3, TM, 1, rho, wavef, KernelManager->GetRAWKernel(ik[3]))*KernelManager->GetRAWKernel(ik[3])->GetKs();
1088 1088
 
1089 1089
                             if (std::abs(Pol[0]) > 0) {
1090 1090
                                 this->Receivers->AppendEfield(ifreq, irec,

+ 1
- 2
Modules/FDEM1D/src/FHTAnderson801.cpp Näytä tiedosto

@@ -964,12 +964,11 @@ namespace Lemma {
964 964
 
965 965
 	Complex FHTAnderson801::Zgauss(const int &ikk, const EMMODE &imode,
966 966
 						const int &itype, const Real &rho,
967
-						const Real &wavef, std::shared_ptr<KernelEM1DBase> Kernel) {
967
+						const Real &wavef, KernelEM1DBase* Kernel) {
968 968
 
969 969
         // TODO, right here we want to return the splined solution instead in the
970 970
         //       case of lagged convolution!
971 971
  		return Zans(0, Kernel->GetManagerIndex()); //Complex(0,0);
972
-
973 972
 	}
974 973
 
975 974
 	void FHTAnderson801::SetNumConv(const int &i) {

+ 32
- 26
Modules/FDEM1D/src/FHTKey101.cpp Näytä tiedosto

@@ -12,8 +12,7 @@
12 12
  * @date      02/11/2014 03:42:53 PM
13 13
  * @version   $Id$
14 14
  * @author    Trevor Irons (ti)
15
- * @email     Trevor.Irons@xri-geo.com
16
- * @copyright Copyright (c) 2014, XRI Geophysics, LLC
15
+ * @email     Trevor.Irons@lemmasoftware.org
17 16
  * @copyright Copyright (c) 2014, Trevor Irons
18 17
  */
19 18
 
@@ -24,13 +23,10 @@ namespace Lemma {
24 23
     // ====================  FRIEND METHODS  =====================
25 24
 
26 25
     std::ostream &operator<<(std::ostream &stream, const FHTKey101 &ob) {
27
-
28
-        stream << *(HankelTransform*)(&ob);
29
-
26
+        stream << ob.Serialize()  << "\n---\n"; // End of doc ---
30 27
         return stream;
31 28
     }
32 29
 
33
-
34 30
     // ====================  STATIC CONST MEMBERS     ============
35 31
 
36 32
     const Eigen::Matrix<Real, 101, 3>  FHTKey101::WT101 =
@@ -143,22 +139,28 @@ namespace Lemma {
143 139
     //--------------------------------------------------------------------------------------
144 140
     //       Class:  FHTKey101
145 141
     //      Method:  FHTKey101
146
-    // Description:  constructor (protected)
142
+    // Description:  constructor (locked)
147 143
     //--------------------------------------------------------------------------------------
148
-    FHTKey101::FHTKey101 (const std::string& name) : HankelTransform(name) {
144
+    FHTKey101::FHTKey101 ( const ctor_key& ) : HankelTransform( ) {
149 145
 
150 146
     }  // -----  end of method FHTKey101::FHTKey101  (constructor)  -----
151 147
 
148
+    //--------------------------------------------------------------------------------------
149
+    //       Class:  FHTKey101
150
+    //      Method:  FHTKey101
151
+    // Description:  constructor (protected)
152
+    //--------------------------------------------------------------------------------------
153
+    FHTKey101::FHTKey101( const YAML::Node& node, const ctor_key& ) : HankelTransform(node) {
154
+
155
+    }
152 156
 
153 157
     //--------------------------------------------------------------------------------------
154 158
     //       Class:  FHTKey101
155 159
     //      Method:  New()
156 160
     // Description:  public constructor
157 161
     //--------------------------------------------------------------------------------------
158
-    FHTKey101* FHTKey101::New() {
159
-        FHTKey101*  Obj = new FHTKey101("FHTKey101");
160
-        Obj->AttachTo(Obj);
161
-        return Obj;
162
+    std::shared_ptr<FHTKey101> FHTKey101::NewSP() {
163
+        return std::make_shared< FHTKey101 >( ctor_key() );
162 164
     }
163 165
 
164 166
     //--------------------------------------------------------------------------------------
@@ -172,30 +174,35 @@ namespace Lemma {
172 174
 
173 175
     //--------------------------------------------------------------------------------------
174 176
     //       Class:  FHTKey101
175
-    //      Method:  Delete
176
-    // Description:  public destructor
177
+    //      Method:  DeSerialize
178
+    // Description:  Factory method, converts YAML node into object
177 179
     //--------------------------------------------------------------------------------------
178
-    void FHTKey101::Delete() {
179
-        this->DetachFrom(this);
180
+    std::shared_ptr<FHTKey101> FHTKey101::DeSerialize( const YAML::Node& node ) {
181
+        if (node.Tag() != "FHTKey101") {
182
+            throw  DeSerializeTypeMismatch( "FHTKey101", node.Tag());
183
+        }
184
+        return std::make_shared<FHTKey101> ( node, ctor_key() );
180 185
     }
181 186
 
182 187
     //--------------------------------------------------------------------------------------
183 188
     //       Class:  FHTKey101
184
-    //      Method:  Release
185
-    // Description:  destructor (protected)
189
+    //      Method:  Serialize
190
+    // Description:  Converts object into Serialized version
186 191
     //--------------------------------------------------------------------------------------
187
-    void FHTKey101::Release() {
188
-        delete this;
192
+    YAML::Node FHTKey101::Serialize() const {
193
+        YAML::Node node = HankelTransform::Serialize();
194
+        node.SetTag( GetName() );
195
+        //node["LayerConductivity"] = LayerConductivity;
196
+        return node;
189 197
     }
190 198
 
191
-
192 199
     //--------------------------------------------------------------------------------------
193 200
     //       Class:  FHTKey101
194 201
     //      Method:  Zgauss
195 202
     //--------------------------------------------------------------------------------------
196 203
     Complex FHTKey101::Zgauss ( const int &ikk, const EMMODE &imode,
197 204
                             const int &itype, const Real &rho,
198
-                            const Real &wavef, KernelEm1DBase *Kernel ) {
205
+                            const Real &wavef, KernelEM1DBase* Kernel ) {
199 206
  		return Zans(0, Kernel->GetManagerIndex());
200 207
     }		// -----  end of method FHTKey101::ComputeRelated  -----
201 208
 
@@ -204,7 +211,7 @@ namespace Lemma {
204 211
     //       Class:  FHTKey101
205 212
     //      Method:  ComputeRelated
206 213
     //--------------------------------------------------------------------------------------
207
-    void FHTKey101::ComputeRelated ( const Real& rho, KernelEm1DBase* Kernel ) {
214
+    void FHTKey101::ComputeRelated ( const Real& rho, std::shared_ptr<KernelEM1DBase> Kernel ) {
208 215
         return ;
209 216
     }		// -----  end of method FHTKey101::ComputeRelated  -----
210 217
 
@@ -212,7 +219,7 @@ namespace Lemma {
212 219
     //       Class:  FHTKey101
213 220
     //      Method:  ComputeRelated
214 221
     //--------------------------------------------------------------------------------------
215
-    void FHTKey101::ComputeRelated ( const Real& rho, std::vector< KernelEm1DBase* > KernelVec ) {
222
+    void FHTKey101::ComputeRelated ( const Real& rho, std::vector< std::shared_ptr<KernelEM1DBase> > KernelVec ) {
216 223
         return ;
217 224
     }		// -----  end of method FHTKey101::ComputeRelated  -----
218 225
 
@@ -220,7 +227,7 @@ namespace Lemma {
220 227
     //       Class:  FHTKey101
221 228
     //      Method:  ComputeRelated
222 229
     //--------------------------------------------------------------------------------------
223
-    void FHTKey101::ComputeRelated ( const Real& rho, KernelEM1DManager* KernelManager ) {
230
+    void FHTKey101::ComputeRelated ( const Real& rho, std::shared_ptr<KernelEM1DManager> KernelManager ) {
224 231
 
225 232
         //kernelVec = KernelManager->GetSTLVector();
226 233
         int nrel = (int)(KernelManager->GetSTLVector().size());
@@ -241,7 +248,6 @@ namespace Lemma {
241 248
                 // Zwork* needed due to sign convention of filter weights
242 249
  			    Zwork(ir, ir2) = std::conj(KernelManager->GetSTLVector()[ir2]->RelBesselArg(lambda(ir)));
243 250
             }
244
-
245 251
         }
246 252
 
247 253
         // We diverge slightly from Key here, each kernel is evaluated seperately, whereby instead

+ 6
- 2
Modules/FDEM1D/src/FHTKey201.cpp Näytä tiedosto

@@ -26,7 +26,6 @@ namespace Lemma {
26 26
         return stream;
27 27
     }
28 28
 
29
-
30 29
     // ====================  STATIC CONST MEMBERS     ============
31 30
 
32 31
     const Eigen::Matrix<Real, 201, 3>  FHTKey201::WT201 =
@@ -245,6 +244,11 @@ namespace Lemma {
245 244
 
246 245
     }  // -----  end of method FHTKey201::FHTKey201  (constructor)  -----
247 246
 
247
+    //--------------------------------------------------------------------------------------
248
+    //       Class:  FHTKey201
249
+    //      Method:  FHTKey201
250
+    // Description:  constructor (locked)
251
+    //--------------------------------------------------------------------------------------
248 252
     FHTKey201::FHTKey201( const YAML::Node& node, const ctor_key& ) : HankelTransform(node) {
249 253
 
250 254
     }
@@ -297,7 +301,7 @@ namespace Lemma {
297 301
     //--------------------------------------------------------------------------------------
298 302
     Complex FHTKey201::Zgauss ( const int &ikk, const EMMODE &imode,
299 303
                             const int &itype, const Real &rho,
300
-                            const Real &wavef, std::shared_ptr<KernelEM1DBase> Kernel ) {
304
+                            const Real &wavef, KernelEM1DBase* Kernel ) {
301 305
  		return Zans(0, Kernel->GetManagerIndex());
302 306
     }		// -----  end of method FHTKey201::ComputeRelated  -----
303 307
 

+ 33
- 25
Modules/FDEM1D/src/FHTKey51.cpp Näytä tiedosto

@@ -24,13 +24,10 @@ namespace Lemma {
24 24
     // ====================  FRIEND METHODS  =====================
25 25
 
26 26
     std::ostream &operator<<(std::ostream &stream, const FHTKey51 &ob) {
27
-
28
-        stream << *(HankelTransform*)(&ob);
29
-
27
+        stream << ob.Serialize()  << "\n---\n"; // End of doc ---
30 28
         return stream;
31 29
     }
32 30
 
33
-
34 31
     // ====================  STATIC CONST MEMBERS     ============
35 32
 
36 33
     const Eigen::Matrix<Real, 51, 3>  FHTKey51::WT51 =
@@ -93,28 +90,34 @@ namespace Lemma {
93 90
     //--------------------------------------------------------------------------------------
94 91
     //       Class:  FHTKey51
95 92
     //      Method:  FHTKey51
96
-    // Description:  constructor (protected)
93
+    // Description:  constructor (locked)
97 94
     //--------------------------------------------------------------------------------------
98
-    FHTKey51::FHTKey51 (const std::string& name) : HankelTransform(name) {
95
+    FHTKey51::FHTKey51 (const ctor_key& ) : HankelTransform( ) {
99 96
 
100 97
     }  // -----  end of method FHTKey51::FHTKey51  (constructor)  -----
101 98
 
99
+    //--------------------------------------------------------------------------------------
100
+    //       Class:  FHTKey51
101
+    //      Method:  FHTKey51
102
+    // Description:  constructor (protected)
103
+    //--------------------------------------------------------------------------------------
104
+    FHTKey51::FHTKey51( const YAML::Node& node, const ctor_key& ) : HankelTransform(node) {
105
+
106
+    }
102 107
 
103 108
     //--------------------------------------------------------------------------------------
104 109
     //       Class:  FHTKey51
105 110
     //      Method:  New()
106 111
     // Description:  public constructor
107 112
     //--------------------------------------------------------------------------------------
108
-    FHTKey51* FHTKey51::New() {
109
-        FHTKey51*  Obj = new FHTKey51("FHTKey51");
110
-        Obj->AttachTo(Obj);
111
-        return Obj;
113
+    std::shared_ptr<FHTKey51> FHTKey51::NewSP() {
114
+        return std::make_shared< FHTKey51 >( ctor_key() );
112 115
     }
113 116
 
114 117
     //--------------------------------------------------------------------------------------
115 118
     //       Class:  FHTKey51
116 119
     //      Method:  ~FHTKey51
117
-    // Description:  destructor (protected)
120
+    // Description:  destructor
118 121
     //--------------------------------------------------------------------------------------
119 122
     FHTKey51::~FHTKey51 () {
120 123
 
@@ -122,30 +125,35 @@ namespace Lemma {
122 125
 
123 126
     //--------------------------------------------------------------------------------------
124 127
     //       Class:  FHTKey51
125
-    //      Method:  Delete
126
-    // Description:  public destructor
128
+    //      Method:  DeSerialize
129
+    // Description:  Factory method, converts YAML node into object
127 130
     //--------------------------------------------------------------------------------------
128
-    void FHTKey51::Delete() {
129
-        this->DetachFrom(this);
131
+    std::shared_ptr<FHTKey51> FHTKey51::DeSerialize( const YAML::Node& node ) {
132
+        if (node.Tag() != "FHTKey51") {
133
+            throw  DeSerializeTypeMismatch( "FHTKey51", node.Tag());
134
+        }
135
+        return std::make_shared<FHTKey51> ( node, ctor_key() );
130 136
     }
131 137
 
132 138
     //--------------------------------------------------------------------------------------
133 139
     //       Class:  FHTKey51
134
-    //      Method:  Release
135
-    // Description:  destructor (protected)
136
-    //--------------------------------------------------------------------------------------
137
-    void FHTKey51::Release() {
138
-        delete this;
140
+    //      Method:  Serialize
141
+    // Description:  Converts object into Serialized version
142
+    //--------------------------------------------------------------------------------------
143
+    YAML::Node FHTKey51::Serialize() const {
144
+        YAML::Node node = HankelTransform::Serialize();
145
+        node.SetTag( GetName() );
146
+        //node["LayerConductivity"] = LayerConductivity;
147
+        return node;
139 148
     }
140 149
 
141
-
142 150
     //--------------------------------------------------------------------------------------
143 151
     //       Class:  FHTKey51
144 152
     //      Method:  Zgauss
145 153
     //--------------------------------------------------------------------------------------
146 154
     Complex FHTKey51::Zgauss ( const int &ikk, const EMMODE &imode,
147 155
                             const int &itype, const Real &rho,
148
-                            const Real &wavef, KernelEm1DBase *Kernel ) {
156
+                            const Real &wavef, KernelEM1DBase* Kernel ) {
149 157
  		return Zans(0, Kernel->GetManagerIndex());
150 158
     }		// -----  end of method FHTKey51::ComputeRelated  -----
151 159
 
@@ -154,7 +162,7 @@ namespace Lemma {
154 162
     //       Class:  FHTKey51
155 163
     //      Method:  ComputeRelated
156 164
     //--------------------------------------------------------------------------------------
157
-    void FHTKey51::ComputeRelated ( const Real& rho, KernelEm1DBase* Kernel ) {
165
+    void FHTKey51::ComputeRelated ( const Real& rho, std::shared_ptr<KernelEM1DBase> Kernel ) {
158 166
         return ;
159 167
     }		// -----  end of method FHTKey51::ComputeRelated  -----
160 168
 
@@ -162,7 +170,7 @@ namespace Lemma {
162 170
     //       Class:  FHTKey51
163 171
     //      Method:  ComputeRelated
164 172
     //--------------------------------------------------------------------------------------
165
-    void FHTKey51::ComputeRelated ( const Real& rho, std::vector< KernelEm1DBase* > KernelVec ) {
173
+    void FHTKey51::ComputeRelated ( const Real& rho, std::vector< std::shared_ptr<KernelEM1DBase> > KernelVec ) {
166 174
         return ;
167 175
     }		// -----  end of method FHTKey51::ComputeRelated  -----
168 176
 
@@ -170,7 +178,7 @@ namespace Lemma {
170 178
     //       Class:  FHTKey51
171 179
     //      Method:  ComputeRelated
172 180
     //--------------------------------------------------------------------------------------
173
-    void FHTKey51::ComputeRelated ( const Real& rho, KernelEM1DManager* KernelManager ) {
181
+    void FHTKey51::ComputeRelated ( const Real& rho, std::shared_ptr<KernelEM1DManager> KernelManager ) {
174 182
 
175 183
         //kernelVec = KernelManager->GetSTLVector();
176 184
         int nrel = (int)(KernelManager->GetSTLVector().size());

Modules/FDEM1D/src/hankeltransformgaussianquadrature.cpp → Modules/FDEM1D/src/GQChave.cpp Näytä tiedosto

@@ -17,19 +17,17 @@
17 17
 //          quadrature and continued fraction expansion: Geophysics, 48
18 18
 //          1671--1686  doi: 10.1190/1.1441448
19 19
 
20
-#include "hankeltransformgaussianquadrature.h"
20
+#include "GQChave.h"
21 21
 
22 22
 namespace Lemma{
23 23
 
24
-    std::ostream &operator<<(std::ostream &stream,
25
-            const HankelTransformGaussianQuadrature &ob) {
26
-
27
-        stream << *(HankelTransform*)(&ob);
24
+    std::ostream &operator<<(std::ostream &stream, const GQChave &ob) {
25
+        stream << ob.Serialize()  << "\n---\n"; // End of doc ---
28 26
         return stream;
29 27
     }
30 28
 
31 29
     // Initialise static members
32
-    const VectorXr HankelTransformGaussianQuadrature::WT =
30
+    const VectorXr GQChave::WT =
33 31
         (VectorXr(254) << //  (WT(I),I=1,20)
34 32
         0.55555555555555555556e+00,0.88888888888888888889e+00,
35 33
         0.26848808986833344073e+00,0.10465622602646726519e+00,
@@ -171,7 +169,7 @@ namespace Lemma{
171 169
         0.14055382072649964277e-01,0.14080351962553661325e-01,
172 170
         0.14092845069160408355e-01,0.14094407090096179347e-01).finished();
173 171
 
174
-        const VectorXr HankelTransformGaussianQuadrature::WA =
172
+        const VectorXr GQChave::WA =
175 173
         (VectorXr(127) << //  (WT(I),I=1,20)
176 174
         //  (WA(I),I=1,20)
177 175
         0.77459666924148337704e+00,0.96049126870802028342e+00,
@@ -266,44 +264,55 @@ namespace Lemma{
266 264
     const Real J1_X12 = -0.5382308663841630e-15;
267 265
 */
268 266
 
269
-    // TODO don't hard code precision like this
270
-    HankelTransformGaussianQuadrature::HankelTransformGaussianQuadrature(
271
-                    const std::string &name) : HankelTransform(name) {
267
+    GQChave::GQChave( const ctor_key& ) : HankelTransform( ) {
272 268
         karg.resize(255, 100);
273 269
         kern.resize(510, 100);
274 270
     }
275 271
 
276
-    /////////////////////////////////////////////////////////////
277
-    HankelTransformGaussianQuadrature::~HankelTransformGaussianQuadrature() {
278
-        if (this->NumberOfReferences != 0)
279
-            throw DeleteObjectWithReferences( this );
280
-    }
272
+    GQChave::GQChave( const YAML::Node& node, const ctor_key& ) : HankelTransform(node) {
281 273
 
274
+    }
282 275
 
283 276
     /////////////////////////////////////////////////////////////
284
-    HankelTransformGaussianQuadrature*
285
-            HankelTransformGaussianQuadrature::New() {
286
-        HankelTransformGaussianQuadrature* Obj = new
287
-        HankelTransformGaussianQuadrature("HankelTransformGaussianQuadrature");
288
-        Obj->AttachTo(Obj);
289
-        return Obj;
277
+    GQChave::~GQChave() {
290 278
     }
291 279
 
292 280
     /////////////////////////////////////////////////////////////
293
-    void HankelTransformGaussianQuadrature::Delete() {
294
-        this->DetachFrom(this);
281
+    std::shared_ptr<GQChave> GQChave::NewSP() {
282
+        return std::make_shared<GQChave>( ctor_key() );
295 283
     }
296 284
 
297
-    void HankelTransformGaussianQuadrature::Release() {
298
-        delete this;
285
+
286
+    //--------------------------------------------------------------------------------------
287
+    //       Class:  GQChave
288
+    //      Method:  DeSerialize
289
+    // Description:  Factory method, converts YAML node into object
290
+    //--------------------------------------------------------------------------------------
291
+    std::shared_ptr<GQChave> GQChave::DeSerialize( const YAML::Node& node ) {
292
+        if (node.Tag() != "GQChave") {
293
+            throw  DeSerializeTypeMismatch( "GQChave", node.Tag());
294
+        }
295
+        return std::make_shared<GQChave> ( node, ctor_key() );
296
+    }
297
+
298
+    //--------------------------------------------------------------------------------------
299
+    //       Class:  GQChave
300
+    //      Method:  Serialize
301
+    // Description:  Converts object into Serialized version
302
+    //--------------------------------------------------------------------------------------
303
+    YAML::Node GQChave::Serialize() const {
304
+        YAML::Node node = HankelTransform::Serialize();
305
+        node.SetTag( GetName() );
306
+        //node["LayerConductivity"] = LayerConductivity;
307
+        return node;
299 308
     }
300 309
 
301 310
     /////////////////////////////////////////////////////////////
302 311
 
303
-    Complex HankelTransformGaussianQuadrature::
312
+    Complex GQChave::
304 313
             Zgauss(const int &ikk, const EMMODE &mode,
305 314
                     const int &itype, const Real &rho, const Real &wavef,
306
-                    KernelEm1DBase *Kernel){
315
+                    KernelEM1DBase* Kernel){
307 316
 
308 317
         // TI, TODO, change calls to Zgauss to reflect this, go and fix so we
309 318
         // dont subract 1 from this everywhere
@@ -336,14 +345,13 @@ namespace Lemma{
336 345
         //this->karg.setZero();
337 346
         //this->kern.setZero();
338 347
 
339
-        Besautn(Besr, Besi, itype, nl, nu, rho, rerr, aerr, npcs, inew,
340
-                        wavef, Kernel);
348
+        Besautn(Besr, Besi, itype, nl, nu, rho, rerr, aerr, npcs, inew, wavef, Kernel);
341 349
 
342 350
         return Complex(Besr, Besi);
343 351
     }
344 352
 
345 353
     //////////////////////////////////////////////////////////////////
346
-    void HankelTransformGaussianQuadrature::
354
+    void GQChave::
347 355
         Besautn(Real &besr, Real &besi,
348 356
                     const int &besselOrder,
349 357
                     const int &lowerGaussLimit,
@@ -354,7 +362,7 @@ namespace Lemma{
354 362
                     const int& numPieces,
355 363
                     int &inew,
356 364
                     const Real &aorb,
357
-                    KernelEm1DBase *Kernel) {
365
+                    KernelEM1DBase* Kernel) {
358 366
 
359 367
         HighestGaussOrder      = 0;
360 368
         NumberPartialIntegrals = 0;
@@ -478,12 +486,12 @@ namespace Lemma{
478 486
     }
479 487
 
480 488
     /////////////////////////////////////////////////////////////
481
-    void HankelTransformGaussianQuadrature::
489
+    void GQChave::
482 490
         Bestrn(Real &BESR, Real &BESI, const int &IORDER,
483 491
             const int &NG, const Real &rho,
484 492
             const Real &RERR, const Real &AERR, const int &NPCS,
485 493
             VectorXi &XSUM, int &NSUM, int &NEW,
486
-            int &IERR, int &NCNTRL, const Real &AORB, KernelEm1DBase *Kernel) {
494
+            int &IERR, int &NCNTRL, const Real &AORB, KernelEM1DBase* Kernel) {
487 495
 
488 496
 
489 497
         Xr.setZero();
@@ -726,12 +734,12 @@ namespace Lemma{
726 734
 
727 735
 
728 736
     /////////////////////////////////////////////////////////////
729
-    void HankelTransformGaussianQuadrature::
737
+    void GQChave::
730 738
             Besqud(const Real &LowerLimit, const Real &UpperLimit,
731 739
                     Real &Besr, Real &Besi, const int &npoints,
732 740
                     const int &NEW,
733 741
                     const int &besselOrder, const Real &rho,
734
-                    KernelEm1DBase* Kernel) {
742
+                    KernelEM1DBase* Kernel) {
735 743
 
736 744
         const int NTERM = 100;
737 745
 
@@ -920,7 +928,7 @@ namespace Lemma{
920 928
 
921 929
 
922 930
     /////////////////////////////////////////////////////////////
923
-    void HankelTransformGaussianQuadrature::
931
+    void GQChave::
924 932
             Padecf(Real &SUMR, Real &SUMI, const int &N) {
925 933
 
926 934
         if (N < 2) {
@@ -1012,7 +1020,7 @@ namespace Lemma{
1012 1020
     }
1013 1021
 
1014 1022
     /////////////////////////////////////////////////////////////
1015
-    void HankelTransformGaussianQuadrature::CF(Real& RESR, Real &RESI,
1023
+    void GQChave::CF(Real& RESR, Real &RESI,
1016 1024
                     Eigen::Matrix<Real, 100, 1> &CFCOR,
1017 1025
                     Eigen::Matrix<Real, 100, 1> &CFCOI,
1018 1026
                     const int &N) {
@@ -1037,7 +1045,7 @@ namespace Lemma{
1037 1045
     }
1038 1046
 
1039 1047
     /////////////////////////////////////////////////////////////
1040
-    Real HankelTransformGaussianQuadrature::
1048
+    Real GQChave::
1041 1049
         ZeroJ(const int &nzero, const int &besselOrder) {
1042 1050
 
1043 1051
         Real ZT1 = -1.e0/8.e0;
@@ -1069,7 +1077,7 @@ namespace Lemma{
1069 1077
 
1070 1078
     /////////////////////////////////////////////////////////////
1071 1079
     // Dot product allowing non 1 based incrementing
1072
-    Real HankelTransformGaussianQuadrature::_dot(const int&n,
1080
+    Real GQChave::_dot(const int&n,
1073 1081
         const Eigen::Matrix<Real, Eigen::Dynamic, Eigen::Dynamic> &X1,
1074 1082
                 const int &inc1,
1075 1083
         const Eigen::Matrix<Real, Eigen::Dynamic, Eigen::Dynamic> &X2,
@@ -1100,10 +1108,7 @@ namespace Lemma{
1100 1108
 
1101 1109
     /////////////////////////////////////////////////////////////
1102 1110
     //
1103
-    Real HankelTransformGaussianQuadrature::Jbess(const Real &x, const int &IORDER) {
1104
-
1105
-        #ifdef HAVEBOOSTCYLBESSEL
1106
-
1111
+    Real GQChave::Jbess(const Real &x, const int &IORDER) {
1107 1112
         switch (IORDER) {
1108 1113
             case 0:
1109 1114
                 //return boost::math::detail::bessel_j0(X);
@@ -1114,13 +1119,8 @@ namespace Lemma{
1114 1119
                 return boost::math::cyl_bessel_j(1, x);
1115 1120
                 break;
1116 1121
             default:
1117
-                throw 77;
1122
+                throw std::runtime_error("Non 0 or 1 Bessel argument specified in GQChave");
1118 1123
         }
1119
-        #else
1120
-        std::cerr << "Chave Hankel transform requires boost, which Lemma was bot built with\n";
1121
-        return 0.;
1122
-        #endif
1123
-
1124 1124
     }
1125 1125
 
1126 1126
     //////////////////////////////////////////////////////

+ 4
- 0
Modules/FDEM1D/src/KernelEM1DManager.cpp Näytä tiedosto

@@ -55,6 +55,10 @@ namespace Lemma {
55 55
         return KernelVec[ik];
56 56
     }
57 57
 
58
+    KernelEM1DBase* KernelEM1DManager::GetRAWKernel(const unsigned int& ik) {
59
+        return KernelVec[ik].get();
60
+    }
61
+
58 62
     std::shared_ptr<DipoleSource> KernelEM1DManager::GetDipole( ) {
59 63
         return Dipole;
60 64
     }

Loading…
Peruuta
Tallenna