Browse Source

Added more Hankel transforms and modified things a bit.

enhancement_3
Trevor Irons 8 years ago
parent
commit
4770cbbd4f

Modules/FDEM1D/src/dipolefreqsweep.cpp → Modules/FDEM1D/examples/dipolefreqsweep.cpp View File


Modules/FDEM1D/src/femforward.cpp → Modules/FDEM1D/examples/femforward.cpp View File


+ 1
- 1
Modules/FDEM1D/include/FHTAnderson801.h View File

145
         /// = omega * sqrt( EP*AMU )  amu = 4 pi e-7  ep = 8.85e-12
145
         /// = omega * sqrt( EP*AMU )  amu = 4 pi e-7  ep = 8.85e-12
146
         Complex Zgauss(const int &ikk, const EMMODE &imode,
146
         Complex Zgauss(const int &ikk, const EMMODE &imode,
147
                         const int &itype, const Real &rho,
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
         /** Returns the name of the underlying class, similiar to Python's type */
150
         /** Returns the name of the underlying class, similiar to Python's type */
151
         virtual inline std::string GetName() const {
151
         virtual inline std::string GetName() const {

+ 31
- 28
Modules/FDEM1D/include/FHTKey101.h View File

10
 /**
10
 /**
11
  * @file
11
  * @file
12
  * @date      02/11/2014 03:33:08 PM
12
  * @date      02/11/2014 03:33:08 PM
13
- * @version   $Id$
14
  * @author    Trevor Irons (ti)
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
  * @copyright Copyright (c) 2014, Trevor Irons
15
  * @copyright Copyright (c) 2014, Trevor Irons
18
  */
16
  */
19
 
17
 
21
 #ifndef  FHTKEY101_INC
19
 #ifndef  FHTKEY101_INC
22
 #define  FHTKEY101_INC
20
 #define  FHTKEY101_INC
23
 
21
 
24
-#include "hankeltransform.h"
22
+#include "HankelTransform.h"
25
 
23
 
26
 namespace Lemma {
24
 namespace Lemma {
27
 
25
 
39
      */
37
      */
40
     class FHTKey101 : public HankelTransform {
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
         public:
44
         public:
46
 
45
 
47
         // ====================  LIFECYCLE     =======================
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
          * @copybrief LemmaObject::New()
58
          * @copybrief LemmaObject::New()
51
          * @copydetails LemmaObject::New()
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
         // ====================  OPERATORS     =======================
72
         // ====================  OPERATORS     =======================
62
 
73
 
64
 
75
 
65
         Complex Zgauss(const int &ikk, const EMMODE &imode,
76
         Complex Zgauss(const int &ikk, const EMMODE &imode,
66
                             const int &itype, const Real &rho,
77
                             const int &itype, const Real &rho,
67
-                            const Real &wavef, KernelEm1DBase *Kernel);
78
+                            const Real &wavef, KernelEM1DBase* Kernel);
68
 
79
 
69
         /// Computes related kernels, if applicable, otherwise this is
80
         /// Computes related kernels, if applicable, otherwise this is
70
         /// just a dummy function.
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
         // ====================  ACCESS        =======================
88
         // ====================  ACCESS        =======================
78
 
89
 
79
         // ====================  INQUIRY       =======================
90
         // ====================  INQUIRY       =======================
91
+        virtual inline std::string GetName() const {
92
+            return CName;
93
+        }
80
 
94
 
81
         protected:
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
         private:
97
         private:
98
 
98
 
99
         // ====================  DATA MEMBERS  =========================
99
         // ====================  DATA MEMBERS  =========================
104
         /// Holds answer, dimensions are NumConv, and NumberRelated.
104
         /// Holds answer, dimensions are NumConv, and NumberRelated.
105
         Eigen::Matrix<Complex, Eigen::Dynamic, Eigen::Dynamic> Zans;
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
     }; // -----  end of class  FHTKey101  -----
110
     }; // -----  end of class  FHTKey101  -----
108
 
111
 
109
 }		// -----  end of Lemma  name  -----
112
 }		// -----  end of Lemma  name  -----

+ 5
- 5
Modules/FDEM1D/include/FHTKey201.h View File

48
         /** Default locked constructor, use NewSP */
48
         /** Default locked constructor, use NewSP */
49
         FHTKey201 ( const ctor_key& );
49
         FHTKey201 ( const ctor_key& );
50
 
50
 
51
-        /** DeSerializing locked constructor, use NewSP */
51
+        /** DeSerializing locked constructor, use DeSerialize */
52
         FHTKey201 ( const YAML::Node& node, const ctor_key& );
52
         FHTKey201 ( const YAML::Node& node, const ctor_key& );
53
 
53
 
54
-        /** Default protected destructor, use Delete */
54
+        /** Default destructor */
55
         ~FHTKey201 ();
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
         static std::shared_ptr<FHTKey201> NewSP();
61
         static std::shared_ptr<FHTKey201> NewSP();
62
 
62
 
75
 
75
 
76
         Complex Zgauss(const int &ikk, const EMMODE &imode,
76
         Complex Zgauss(const int &ikk, const EMMODE &imode,
77
                             const int &itype, const Real &rho,
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
         /// Computes related kernels, if applicable, otherwise this is
80
         /// Computes related kernels, if applicable, otherwise this is
81
         /// just a dummy function.
81
         /// just a dummy function.

+ 35
- 30
Modules/FDEM1D/include/FHTKey51.h View File

10
 /**
10
 /**
11
  * @file
11
  * @file
12
  * @date      02/11/2014 03:33:08 PM
12
  * @date      02/11/2014 03:33:08 PM
13
- * @version   $Id$
14
  * @author    Trevor Irons (ti)
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
  * @copyright Copyright (c) 2014, Trevor Irons
15
  * @copyright Copyright (c) 2014, Trevor Irons
18
  */
16
  */
19
 
17
 
21
 #ifndef  FHTKEY51_INC
19
 #ifndef  FHTKEY51_INC
22
 #define  FHTKEY51_INC
20
 #define  FHTKEY51_INC
23
 
21
 
24
-#include "hankeltransform.h"
22
+#include "HankelTransform.h"
25
 
23
 
26
 namespace Lemma {
24
 namespace Lemma {
27
 
25
 
39
      */
37
      */
40
     class FHTKey51 : public HankelTransform {
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
         public:
44
         public:
46
 
45
 
47
         // ====================  LIFECYCLE     =======================
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
         // ====================  OPERATORS     =======================
72
         // ====================  OPERATORS     =======================
62
 
73
 
64
 
75
 
65
         Complex Zgauss(const int &ikk, const EMMODE &imode,
76
         Complex Zgauss(const int &ikk, const EMMODE &imode,
66
                             const int &itype, const Real &rho,
77
                             const int &itype, const Real &rho,
67
-                            const Real &wavef, KernelEm1DBase *Kernel);
78
+                            const Real &wavef, KernelEM1DBase* Kernel);
68
 
79
 
69
         /// Computes related kernels, if applicable, otherwise this is
80
         /// Computes related kernels, if applicable, otherwise this is
70
         /// just a dummy function.
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
         // ====================  ACCESS        =======================
88
         // ====================  ACCESS        =======================
78
 
89
 
79
         // ====================  INQUIRY       =======================
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
         private:
99
         private:
98
 
100
 
104
         /// Holds answer, dimensions are NumConv, and NumberRelated.
106
         /// Holds answer, dimensions are NumConv, and NumberRelated.
105
         Eigen::Matrix<Complex, Eigen::Dynamic, Eigen::Dynamic> Zans;
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
     }; // -----  end of class  FHTKey51  -----
112
     }; // -----  end of class  FHTKey51  -----
108
 
113
 
109
 }		// -----  end of Lemma  name  -----
114
 }		// -----  end of Lemma  name  -----

Modules/FDEM1D/include/hankeltransformgaussianquadrature.h → Modules/FDEM1D/include/GQChave.h View File

12
 #ifndef  _HANKELTRANSFORMGAUSSIANQUADRATURE_h_INC
12
 #ifndef  _HANKELTRANSFORMGAUSSIANQUADRATURE_h_INC
13
 #define  _HANKELTRANSFORMGAUSSIANQUADRATURE_h_INC
13
 #define  _HANKELTRANSFORMGAUSSIANQUADRATURE_h_INC
14
 
14
 
15
-#include "hankeltransform.h"
15
+#include "HankelTransform.h"
16
 #include "KernelEM1DBase.h"
16
 #include "KernelEM1DBase.h"
17
-
18
-#ifdef HAVEBOOSTCYLBESSEL
17
+//#include <cmath>
19
 #include "boost/math/special_functions.hpp"
18
 #include "boost/math/special_functions.hpp"
20
-#endif
19
+
21
 
20
 
22
 namespace Lemma {
21
 namespace Lemma {
23
 
22
 
24
 
23
 
25
 	// =======================================================================
24
 	// =======================================================================
26
-	//        Class:  HankelTransformGaussianQuadrature
25
+	//        Class:  GQChave
27
 	/// \brief  Calculates hankel transform using gaussian quadrature.
26
 	/// \brief  Calculates hankel transform using gaussian quadrature.
28
 	/// \details  Accurate but slow, this is a port of Alan Chave's public domain
27
 	/// \details  Accurate but slow, this is a port of Alan Chave's public domain
29
     /// fortran code
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
 		public:
36
 		public:
37
 
37
 
38
 			// ====================  LIFECYCLE     ===========================
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
              *  Location is
51
              *  Location is
43
              *  initialized to (0,0,0) type and polarization are
52
              *  initialized to (0,0,0) type and polarization are
44
              *  initialized  to nonworking values that will throw
53
              *  initialized  to nonworking values that will throw
45
              *  exceptions if used.
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
 			// ====================  OPERATORS     ===========================
67
 			// ====================  OPERATORS     ===========================
56
 
68
 
66
             //template <EMMODE T>
78
             //template <EMMODE T>
67
 			Complex Zgauss(const int &ikk, const EMMODE &imode,
79
 			Complex Zgauss(const int &ikk, const EMMODE &imode,
68
 							const int &itype, const Real &rho,
80
 							const int &itype, const Real &rho,
69
-							const Real &wavef, KernelEm1DBase *Kernel);
81
+							const Real &wavef, KernelEM1DBase* Kernel);
70
 
82
 
71
 			// ====================  ACCESS        ============================
83
 			// ====================  ACCESS        ============================
72
 
84
 
73
 			// ====================  INQUIRY       ============================
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
 			// ====================  DATA MEMBERS  ============================
92
 			// ====================  DATA MEMBERS  ============================
76
 
93
 
77
 		protected:
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
 			// ====================  OPERATIONS    ============================
96
 			// ====================  OPERATIONS    ============================
94
 
97
 
95
 			/// Modified by Yoonho Song to branch cut, June, 1996
98
 			/// Modified by Yoonho Song to branch cut, June, 1996
99
 			///         for large arguments, it uses continued fraction also
102
 			///         for large arguments, it uses continued fraction also
100
 			/// It is recommended to use nl = 1 to 6, nu =7
103
 			/// It is recommended to use nl = 1 to 6, nu =7
101
 			/// PERFORMS AUTOMATIC CALCULATION OF BESSEL TRANSFORM TO SPECIFIED
104
 			/// PERFORMS AUTOMATIC CALCULATION OF BESSEL TRANSFORM TO SPECIFIED
102
-			/// RELATIVportisheadE AND ABSOLUTE ERROR
105
+			/// RELATIVE AND ABSOLUTE ERROR
103
 			///
106
 			///
104
 			/// ARGUMENT LIST:
107
 			/// ARGUMENT LIST:
105
 			///
108
 			///
133
 							const int &nl, const int &nu, const Real &rho,
136
 							const int &nl, const int &nu, const Real &rho,
134
 							const Real &rerr, const Real &aerr,
137
 							const Real &rerr, const Real &aerr,
135
 							const int &npcs, int &inew, const Real &aorb,
138
 							const int &npcs, int &inew, const Real &aorb,
136
-							KernelEm1DBase *Kernel);
139
+							KernelEM1DBase* Kernel);
137
 
140
 
138
 			/// COMPUTES BESSEL TRANSFORM OF SPECIFIED ORDER DEFINED AS
141
 			/// COMPUTES BESSEL TRANSFORM OF SPECIFIED ORDER DEFINED AS
139
 			/// INTEGRAL(FUNCT(X)*J-SUB-ORDER(X*R)*DX) FROM X=0 TO INFINITY
142
 			/// INTEGRAL(FUNCT(X)*J-SUB-ORDER(X*R)*DX) FROM X=0 TO INFINITY
189
  					const Real &RERR, const Real &AERR, const int &npcs,
192
  					const Real &RERR, const Real &AERR, const int &npcs,
190
  					VectorXi &XSUM, int &NSUM, int &NEW,
193
  					VectorXi &XSUM, int &NSUM, int &NEW,
191
  					int &IERR, int &NCNTRL, const Real &AORB,
194
  					int &IERR, int &NCNTRL, const Real &AORB,
192
-					KernelEm1DBase *Kernel);
195
+					KernelEM1DBase* Kernel);
193
 
196
 
194
 			/// CALCULATES THE INTEGRAL OF F(X)*J-SUB-N(X*R) OVER THE
197
 			/// CALCULATES THE INTEGRAL OF F(X)*J-SUB-N(X*R) OVER THE
195
 			/// INTERVAL A TO B AT A SPECIFIED GAUSS ORDER THE RESULT IS
198
 			/// INTERVAL A TO B AT A SPECIFIED GAUSS ORDER THE RESULT IS
221
             //template <EMMODE T>
224
             //template <EMMODE T>
222
 			void Besqud(const Real &A, const Real &B, Real &BESR, Real &BESI,
225
 			void Besqud(const Real &A, const Real &B, Real &BESR, Real &BESI,
223
 							const int &NG, const int &NEW, const int &iorder,
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
 			/// COMPUTES SUM(S(I)),I=1,...N BY COMPUTATION OF PADE APPROXIMANT
229
 			/// COMPUTES SUM(S(I)),I=1,...N BY COMPUTATION OF PADE APPROXIMANT
227
 			/// USING CONTINUED FRACTION EXPANSION.  FUNCTION IS DESIGNED TO BE
230
 			/// USING CONTINUED FRACTION EXPANSION.  FUNCTION IS DESIGNED TO BE
329
 
332
 
330
 		private:
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
     // Exception Classes
341
     // Exception Classes

+ 1
- 1
Modules/FDEM1D/include/HankelTransform.h View File

52
                 ///       passing by reference and using Kernel.get() instead.
52
                 ///       passing by reference and using Kernel.get() instead.
53
                 virtual Complex Zgauss(const int &ikk, const EMMODE &imode,
53
                 virtual Complex Zgauss(const int &ikk, const EMMODE &imode,
54
                             const int &itype, const Real &rho,
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
                 /// Computes related kernels, if applicable, otherwise this is
57
                 /// Computes related kernels, if applicable, otherwise this is
58
                 /// just a dummy function.
58
                 /// just a dummy function.

+ 1
- 1
Modules/FDEM1D/include/KernelEM1DBase.h View File

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

+ 5
- 0
Modules/FDEM1D/include/KernelEM1DManager.h View File

117
              */
117
              */
118
             std::shared_ptr<KernelEM1DBase>    GetKernel(const unsigned int& ik);
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
             /** Returns pointer to connected dipole.
125
             /** Returns pointer to connected dipole.
121
              */
126
              */
122
             std::shared_ptr<DipoleSource>    GetDipole( );
127
             std::shared_ptr<DipoleSource>    GetDipole( );

+ 5
- 2
Modules/FDEM1D/src/CMakeLists.txt View File

16
 	${CMAKE_CURRENT_SOURCE_DIR}/HankelTransform.cpp
16
 	${CMAKE_CURRENT_SOURCE_DIR}/HankelTransform.cpp
17
 	${CMAKE_CURRENT_SOURCE_DIR}/FHTAnderson801.cpp
17
 	${CMAKE_CURRENT_SOURCE_DIR}/FHTAnderson801.cpp
18
 	${CMAKE_CURRENT_SOURCE_DIR}/FHTKey201.cpp
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
 	#${CMAKE_CURRENT_SOURCE_DIR}/AEMSurvey.cpp
25
 	#${CMAKE_CURRENT_SOURCE_DIR}/AEMSurvey.cpp
23
 	#${CMAKE_CURRENT_SOURCE_DIR}/AEMSurveyReader.cpp
26
 	#${CMAKE_CURRENT_SOURCE_DIR}/AEMSurveyReader.cpp

+ 70
- 70
Modules/FDEM1D/src/DipoleSource.cpp View File

752
                 if (std::abs(Pol[2]) > 0) { // z dipole
752
                 if (std::abs(Pol[2]) > 0) { // z dipole
753
                     switch(FieldsToCalculate) {
753
                     switch(FieldsToCalculate) {
754
                         case E:
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
                             std::cout.precision(12);
757
                             std::cout.precision(12);
758
                             this->Receivers->AppendEfield(ifreq, irec,
758
                             this->Receivers->AppendEfield(ifreq, irec,
759
                                 -Pol[2]*QPI*cp*f(10)*Moment,
759
                                 -Pol[2]*QPI*cp*f(10)*Moment,
762
                             break;
762
                             break;
763
 
763
 
764
                         case H:
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
                             this->Receivers->AppendHfield(ifreq, irec,
766
                             this->Receivers->AppendHfield(ifreq, irec,
767
                                 -Pol[2]*QPI*sp*f(12)*Moment,
767
                                 -Pol[2]*QPI*sp*f(12)*Moment,
768
                                  Pol[2]*QPI*cp*f(12)*Moment,
768
                                  Pol[2]*QPI*cp*f(12)*Moment,
770
                             break;
770
                             break;
771
 
771
 
772
                         case BOTH:
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
                             this->Receivers->AppendEfield(ifreq, irec,
775
                             this->Receivers->AppendEfield(ifreq, irec,
776
                                     -Pol[2]*QPI*cp*f(10)*Moment,
776
                                     -Pol[2]*QPI*cp*f(10)*Moment,
777
                                     -Pol[2]*QPI*sp*f(10)*Moment,
777
                                     -Pol[2]*QPI*sp*f(10)*Moment,
778
                                      Pol[2]*QPI*f(11)*Moment   );
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
                             this->Receivers->AppendHfield(ifreq, irec,
781
                             this->Receivers->AppendHfield(ifreq, irec,
782
                                     -Pol[2]*QPI*sp*f(12)*Moment,
782
                                     -Pol[2]*QPI*sp*f(12)*Moment,
783
                                      Pol[2]*QPI*cp*f(12)*Moment,
783
                                      Pol[2]*QPI*cp*f(12)*Moment,
787
                 if (std::abs(Pol[1]) > 0 || std::abs(Pol[0]) > 0) { // y dipole
787
                 if (std::abs(Pol[1]) > 0 || std::abs(Pol[0]) > 0) { // y dipole
788
                     switch(FieldsToCalculate) {
788
                     switch(FieldsToCalculate) {
789
                         case E:
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
                             if (std::abs(Pol[1]) > 0) {
795
                             if (std::abs(Pol[1]) > 0) {
796
                                 this->Receivers->AppendEfield(ifreq, irec,
796
                                 this->Receivers->AppendEfield(ifreq, irec,
797
                                     Pol[1]*QPI*scp*((f(0)-(Real)(2.)*f(1)/rho)+(f(2)-(Real)(2.)*f(3)/rho))*Moment,
797
                                     Pol[1]*QPI*scp*((f(0)-(Real)(2.)*f(1)/rho)+(f(2)-(Real)(2.)*f(3)/rho))*Moment,
806
                             }
806
                             }
807
                             break;
807
                             break;
808
                         case H:
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
                             if (std::abs(Pol[1]) > 0) {
814
                             if (std::abs(Pol[1]) > 0) {
815
                                 this->Receivers->AppendHfield(ifreq, irec,
815
                                 this->Receivers->AppendHfield(ifreq, irec,
816
                                         Pol[1]*QPI*(sps*f(5)+c2p*f(6)/rho-cps*f(7)+c2p*f(8)/rho)*Moment,
816
                                         Pol[1]*QPI*(sps*f(5)+c2p*f(6)/rho-cps*f(7)+c2p*f(8)/rho)*Moment,
825
                             }
825
                             }
826
                             break;
826
                             break;
827
                         case BOTH:
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
                             if (std::abs(Pol[1]) > 0) {
839
                             if (std::abs(Pol[1]) > 0) {
840
                                 this->Receivers->AppendEfield(ifreq, irec,
840
                                 this->Receivers->AppendEfield(ifreq, irec,
872
                     switch(FieldsToCalculate) {
872
                     switch(FieldsToCalculate) {
873
                         case E:
873
                         case E:
874
                             f(10) = 0;
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
                             this->Receivers->AppendEfield(ifreq, irec,
877
                             this->Receivers->AppendEfield(ifreq, irec,
878
                                 -Pol[2]*QPI*cp*f(10)*Moment,
878
                                 -Pol[2]*QPI*cp*f(10)*Moment,
881
                             break;
881
                             break;
882
 
882
 
883
                         case H:
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
                             this->Receivers->AppendHfield(ifreq, irec,
885
                             this->Receivers->AppendHfield(ifreq, irec,
886
                                 -Pol[2]*QPI*sp*f(12)*Moment,
886
                                 -Pol[2]*QPI*sp*f(12)*Moment,
887
                                  Pol[2]*QPI*cp*f(12)*Moment,
887
                                  Pol[2]*QPI*cp*f(12)*Moment,
890
 
890
 
891
                         case BOTH:
891
                         case BOTH:
892
                             f(10) = 0;
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
                             this->Receivers->AppendEfield(ifreq, irec,
894
                             this->Receivers->AppendEfield(ifreq, irec,
895
                                     -Pol[2]*QPI*cp*f(10)*Moment,
895
                                     -Pol[2]*QPI*cp*f(10)*Moment,
896
                                     -Pol[2]*QPI*sp*f(10)*Moment,
896
                                     -Pol[2]*QPI*sp*f(10)*Moment,
897
                                      Pol[2]*QPI*f(11)*Moment   );
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
                             this->Receivers->AppendHfield(ifreq, irec,
900
                             this->Receivers->AppendHfield(ifreq, irec,
901
                                     -Pol[2]*QPI*sp*f(12)*Moment,
901
                                     -Pol[2]*QPI*sp*f(12)*Moment,
902
                                      Pol[2]*QPI*cp*f(12)*Moment,
902
                                      Pol[2]*QPI*cp*f(12)*Moment,
908
                         case E:
908
                         case E:
909
                             f(0) = 0;
909
                             f(0) = 0;
910
                             f(1) = 0;
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
                             f(4) = 0;
913
                             f(4) = 0;
914
                             if (std::abs(Pol[1]) > 0) {
914
                             if (std::abs(Pol[1]) > 0) {
915
                                 this->Receivers->AppendEfield(ifreq, irec,
915
                                 this->Receivers->AppendEfield(ifreq, irec,
925
                             }
925
                             }
926
                             break;
926
                             break;
927
                         case H:
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
                             if (std::abs(Pol[1]) > 0) {
933
                             if (std::abs(Pol[1]) > 0) {
934
                                 this->Receivers->AppendHfield(ifreq, irec,
934
                                 this->Receivers->AppendHfield(ifreq, irec,
935
                                         Pol[1]*QPI*(sps*f(5)+c2p*f(6)/rho-cps*f(7)+c2p*f(8)/rho)*Moment,
935
                                         Pol[1]*QPI*(sps*f(5)+c2p*f(6)/rho-cps*f(7)+c2p*f(8)/rho)*Moment,
950
                             f(0) = 0;
950
                             f(0) = 0;
951
                             f(1) = 0;
951
                             f(1) = 0;
952
                             f(4) = 0;
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
                             if (std::abs(Pol[1]) > 0) {
961
                             if (std::abs(Pol[1]) > 0) {
962
                                 this->Receivers->AppendEfield(ifreq, irec,
962
                                 this->Receivers->AppendEfield(ifreq, irec,
995
                 if (std::abs(Pol[2]) > 0) { // z dipole
995
                 if (std::abs(Pol[2]) > 0) { // z dipole
996
                     switch(FieldsToCalculate) {
996
                     switch(FieldsToCalculate) {
997
                         case E:
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
                             this->Receivers->AppendEfield(ifreq, irec,
999
                             this->Receivers->AppendEfield(ifreq, irec,
1000
                                  Pol[2]*Moment*QPI*sp*f(12),
1000
                                  Pol[2]*Moment*QPI*sp*f(12),
1001
                                 -Pol[2]*Moment*QPI*cp*f(12),
1001
                                 -Pol[2]*Moment*QPI*cp*f(12),
1002
                                  0);
1002
                                  0);
1003
                             break;
1003
                             break;
1004
                         case H:
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
                             this->Receivers->AppendHfield(ifreq, irec,
1007
                             this->Receivers->AppendHfield(ifreq, irec,
1008
                                 -Pol[2]*Moment*QPI*cp*f(10),
1008
                                 -Pol[2]*Moment*QPI*cp*f(10),
1009
                                 -Pol[2]*Moment*QPI*sp*f(10),
1009
                                 -Pol[2]*Moment*QPI*sp*f(10),
1011
                             break;
1011
                             break;
1012
 
1012
 
1013
                         case BOTH:
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
                             this->Receivers->AppendEfield(ifreq, irec,
1018
                             this->Receivers->AppendEfield(ifreq, irec,
1019
                                  Pol[2]*Moment*QPI*sp*f(12),
1019
                                  Pol[2]*Moment*QPI*sp*f(12),
1033
 
1033
 
1034
                         case E:
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
                             if (std::abs(Pol[0]) > 0) {
1042
                             if (std::abs(Pol[0]) > 0) {
1043
                                 this->Receivers->AppendEfield(ifreq, irec,
1043
                                 this->Receivers->AppendEfield(ifreq, irec,
1054
                             break;
1054
                             break;
1055
 
1055
 
1056
                         case H:
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
                             if (std::abs(Pol[0]) > 0) {
1063
                             if (std::abs(Pol[0]) > 0) {
1064
                                 this->Receivers->AppendHfield(ifreq, irec,
1064
                                 this->Receivers->AppendHfield(ifreq, irec,
1075
                             break;
1075
                             break;
1076
 
1076
 
1077
                         case BOTH:
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
                             if (std::abs(Pol[0]) > 0) {
1089
                             if (std::abs(Pol[0]) > 0) {
1090
                                 this->Receivers->AppendEfield(ifreq, irec,
1090
                                 this->Receivers->AppendEfield(ifreq, irec,

+ 1
- 2
Modules/FDEM1D/src/FHTAnderson801.cpp View File

964
 
964
 
965
 	Complex FHTAnderson801::Zgauss(const int &ikk, const EMMODE &imode,
965
 	Complex FHTAnderson801::Zgauss(const int &ikk, const EMMODE &imode,
966
 						const int &itype, const Real &rho,
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
         // TODO, right here we want to return the splined solution instead in the
969
         // TODO, right here we want to return the splined solution instead in the
970
         //       case of lagged convolution!
970
         //       case of lagged convolution!
971
  		return Zans(0, Kernel->GetManagerIndex()); //Complex(0,0);
971
  		return Zans(0, Kernel->GetManagerIndex()); //Complex(0,0);
972
-
973
 	}
972
 	}
974
 
973
 
975
 	void FHTAnderson801::SetNumConv(const int &i) {
974
 	void FHTAnderson801::SetNumConv(const int &i) {

+ 32
- 26
Modules/FDEM1D/src/FHTKey101.cpp View File

12
  * @date      02/11/2014 03:42:53 PM
12
  * @date      02/11/2014 03:42:53 PM
13
  * @version   $Id$
13
  * @version   $Id$
14
  * @author    Trevor Irons (ti)
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
  * @copyright Copyright (c) 2014, Trevor Irons
16
  * @copyright Copyright (c) 2014, Trevor Irons
18
  */
17
  */
19
 
18
 
24
     // ====================  FRIEND METHODS  =====================
23
     // ====================  FRIEND METHODS  =====================
25
 
24
 
26
     std::ostream &operator<<(std::ostream &stream, const FHTKey101 &ob) {
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
         return stream;
27
         return stream;
31
     }
28
     }
32
 
29
 
33
-
34
     // ====================  STATIC CONST MEMBERS     ============
30
     // ====================  STATIC CONST MEMBERS     ============
35
 
31
 
36
     const Eigen::Matrix<Real, 101, 3>  FHTKey101::WT101 =
32
     const Eigen::Matrix<Real, 101, 3>  FHTKey101::WT101 =
143
     //--------------------------------------------------------------------------------------
139
     //--------------------------------------------------------------------------------------
144
     //       Class:  FHTKey101
140
     //       Class:  FHTKey101
145
     //      Method:  FHTKey101
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
     }  // -----  end of method FHTKey101::FHTKey101  (constructor)  -----
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
     //       Class:  FHTKey101
158
     //       Class:  FHTKey101
155
     //      Method:  New()
159
     //      Method:  New()
156
     // Description:  public constructor
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
 
174
 
173
     //--------------------------------------------------------------------------------------
175
     //--------------------------------------------------------------------------------------
174
     //       Class:  FHTKey101
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
     //       Class:  FHTKey101
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
     //       Class:  FHTKey101
200
     //       Class:  FHTKey101
194
     //      Method:  Zgauss
201
     //      Method:  Zgauss
195
     //--------------------------------------------------------------------------------------
202
     //--------------------------------------------------------------------------------------
196
     Complex FHTKey101::Zgauss ( const int &ikk, const EMMODE &imode,
203
     Complex FHTKey101::Zgauss ( const int &ikk, const EMMODE &imode,
197
                             const int &itype, const Real &rho,
204
                             const int &itype, const Real &rho,
198
-                            const Real &wavef, KernelEm1DBase *Kernel ) {
205
+                            const Real &wavef, KernelEM1DBase* Kernel ) {
199
  		return Zans(0, Kernel->GetManagerIndex());
206
  		return Zans(0, Kernel->GetManagerIndex());
200
     }		// -----  end of method FHTKey101::ComputeRelated  -----
207
     }		// -----  end of method FHTKey101::ComputeRelated  -----
201
 
208
 
204
     //       Class:  FHTKey101
211
     //       Class:  FHTKey101
205
     //      Method:  ComputeRelated
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
         return ;
215
         return ;
209
     }		// -----  end of method FHTKey101::ComputeRelated  -----
216
     }		// -----  end of method FHTKey101::ComputeRelated  -----
210
 
217
 
212
     //       Class:  FHTKey101
219
     //       Class:  FHTKey101
213
     //      Method:  ComputeRelated
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
         return ;
223
         return ;
217
     }		// -----  end of method FHTKey101::ComputeRelated  -----
224
     }		// -----  end of method FHTKey101::ComputeRelated  -----
218
 
225
 
220
     //       Class:  FHTKey101
227
     //       Class:  FHTKey101
221
     //      Method:  ComputeRelated
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
         //kernelVec = KernelManager->GetSTLVector();
232
         //kernelVec = KernelManager->GetSTLVector();
226
         int nrel = (int)(KernelManager->GetSTLVector().size());
233
         int nrel = (int)(KernelManager->GetSTLVector().size());
241
                 // Zwork* needed due to sign convention of filter weights
248
                 // Zwork* needed due to sign convention of filter weights
242
  			    Zwork(ir, ir2) = std::conj(KernelManager->GetSTLVector()[ir2]->RelBesselArg(lambda(ir)));
249
  			    Zwork(ir, ir2) = std::conj(KernelManager->GetSTLVector()[ir2]->RelBesselArg(lambda(ir)));
243
             }
250
             }
244
-
245
         }
251
         }
246
 
252
 
247
         // We diverge slightly from Key here, each kernel is evaluated seperately, whereby instead
253
         // We diverge slightly from Key here, each kernel is evaluated seperately, whereby instead

+ 6
- 2
Modules/FDEM1D/src/FHTKey201.cpp View File

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

+ 33
- 25
Modules/FDEM1D/src/FHTKey51.cpp View File

24
     // ====================  FRIEND METHODS  =====================
24
     // ====================  FRIEND METHODS  =====================
25
 
25
 
26
     std::ostream &operator<<(std::ostream &stream, const FHTKey51 &ob) {
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
         return stream;
28
         return stream;
31
     }
29
     }
32
 
30
 
33
-
34
     // ====================  STATIC CONST MEMBERS     ============
31
     // ====================  STATIC CONST MEMBERS     ============
35
 
32
 
36
     const Eigen::Matrix<Real, 51, 3>  FHTKey51::WT51 =
33
     const Eigen::Matrix<Real, 51, 3>  FHTKey51::WT51 =
93
     //--------------------------------------------------------------------------------------
90
     //--------------------------------------------------------------------------------------
94
     //       Class:  FHTKey51
91
     //       Class:  FHTKey51
95
     //      Method:  FHTKey51
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
     }  // -----  end of method FHTKey51::FHTKey51  (constructor)  -----
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
     //       Class:  FHTKey51
109
     //       Class:  FHTKey51
105
     //      Method:  New()
110
     //      Method:  New()
106
     // Description:  public constructor
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
     //       Class:  FHTKey51
118
     //       Class:  FHTKey51
116
     //      Method:  ~FHTKey51
119
     //      Method:  ~FHTKey51
117
-    // Description:  destructor (protected)
120
+    // Description:  destructor
118
     //--------------------------------------------------------------------------------------
121
     //--------------------------------------------------------------------------------------
119
     FHTKey51::~FHTKey51 () {
122
     FHTKey51::~FHTKey51 () {
120
 
123
 
122
 
125
 
123
     //--------------------------------------------------------------------------------------
126
     //--------------------------------------------------------------------------------------
124
     //       Class:  FHTKey51
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
     //       Class:  FHTKey51
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
     //       Class:  FHTKey51
151
     //       Class:  FHTKey51
144
     //      Method:  Zgauss
152
     //      Method:  Zgauss
145
     //--------------------------------------------------------------------------------------
153
     //--------------------------------------------------------------------------------------
146
     Complex FHTKey51::Zgauss ( const int &ikk, const EMMODE &imode,
154
     Complex FHTKey51::Zgauss ( const int &ikk, const EMMODE &imode,
147
                             const int &itype, const Real &rho,
155
                             const int &itype, const Real &rho,
148
-                            const Real &wavef, KernelEm1DBase *Kernel ) {
156
+                            const Real &wavef, KernelEM1DBase* Kernel ) {
149
  		return Zans(0, Kernel->GetManagerIndex());
157
  		return Zans(0, Kernel->GetManagerIndex());
150
     }		// -----  end of method FHTKey51::ComputeRelated  -----
158
     }		// -----  end of method FHTKey51::ComputeRelated  -----
151
 
159
 
154
     //       Class:  FHTKey51
162
     //       Class:  FHTKey51
155
     //      Method:  ComputeRelated
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
         return ;
166
         return ;
159
     }		// -----  end of method FHTKey51::ComputeRelated  -----
167
     }		// -----  end of method FHTKey51::ComputeRelated  -----
160
 
168
 
162
     //       Class:  FHTKey51
170
     //       Class:  FHTKey51
163
     //      Method:  ComputeRelated
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
         return ;
174
         return ;
167
     }		// -----  end of method FHTKey51::ComputeRelated  -----
175
     }		// -----  end of method FHTKey51::ComputeRelated  -----
168
 
176
 
170
     //       Class:  FHTKey51
178
     //       Class:  FHTKey51
171
     //      Method:  ComputeRelated
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
         //kernelVec = KernelManager->GetSTLVector();
183
         //kernelVec = KernelManager->GetSTLVector();
176
         int nrel = (int)(KernelManager->GetSTLVector().size());
184
         int nrel = (int)(KernelManager->GetSTLVector().size());

Modules/FDEM1D/src/hankeltransformgaussianquadrature.cpp → Modules/FDEM1D/src/GQChave.cpp View File

17
 //          quadrature and continued fraction expansion: Geophysics, 48
17
 //          quadrature and continued fraction expansion: Geophysics, 48
18
 //          1671--1686  doi: 10.1190/1.1441448
18
 //          1671--1686  doi: 10.1190/1.1441448
19
 
19
 
20
-#include "hankeltransformgaussianquadrature.h"
20
+#include "GQChave.h"
21
 
21
 
22
 namespace Lemma{
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
         return stream;
26
         return stream;
29
     }
27
     }
30
 
28
 
31
     // Initialise static members
29
     // Initialise static members
32
-    const VectorXr HankelTransformGaussianQuadrature::WT =
30
+    const VectorXr GQChave::WT =
33
         (VectorXr(254) << //  (WT(I),I=1,20)
31
         (VectorXr(254) << //  (WT(I),I=1,20)
34
         0.55555555555555555556e+00,0.88888888888888888889e+00,
32
         0.55555555555555555556e+00,0.88888888888888888889e+00,
35
         0.26848808986833344073e+00,0.10465622602646726519e+00,
33
         0.26848808986833344073e+00,0.10465622602646726519e+00,
171
         0.14055382072649964277e-01,0.14080351962553661325e-01,
169
         0.14055382072649964277e-01,0.14080351962553661325e-01,
172
         0.14092845069160408355e-01,0.14094407090096179347e-01).finished();
170
         0.14092845069160408355e-01,0.14094407090096179347e-01).finished();
173
 
171
 
174
-        const VectorXr HankelTransformGaussianQuadrature::WA =
172
+        const VectorXr GQChave::WA =
175
         (VectorXr(127) << //  (WT(I),I=1,20)
173
         (VectorXr(127) << //  (WT(I),I=1,20)
176
         //  (WA(I),I=1,20)
174
         //  (WA(I),I=1,20)
177
         0.77459666924148337704e+00,0.96049126870802028342e+00,
175
         0.77459666924148337704e+00,0.96049126870802028342e+00,
266
     const Real J1_X12 = -0.5382308663841630e-15;
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
         karg.resize(255, 100);
268
         karg.resize(255, 100);
273
         kern.resize(510, 100);
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
             Zgauss(const int &ikk, const EMMODE &mode,
313
             Zgauss(const int &ikk, const EMMODE &mode,
305
                     const int &itype, const Real &rho, const Real &wavef,
314
                     const int &itype, const Real &rho, const Real &wavef,
306
-                    KernelEm1DBase *Kernel){
315
+                    KernelEM1DBase* Kernel){
307
 
316
 
308
         // TI, TODO, change calls to Zgauss to reflect this, go and fix so we
317
         // TI, TODO, change calls to Zgauss to reflect this, go and fix so we
309
         // dont subract 1 from this everywhere
318
         // dont subract 1 from this everywhere
336
         //this->karg.setZero();
345
         //this->karg.setZero();
337
         //this->kern.setZero();
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
         return Complex(Besr, Besi);
350
         return Complex(Besr, Besi);
343
     }
351
     }
344
 
352
 
345
     //////////////////////////////////////////////////////////////////
353
     //////////////////////////////////////////////////////////////////
346
-    void HankelTransformGaussianQuadrature::
354
+    void GQChave::
347
         Besautn(Real &besr, Real &besi,
355
         Besautn(Real &besr, Real &besi,
348
                     const int &besselOrder,
356
                     const int &besselOrder,
349
                     const int &lowerGaussLimit,
357
                     const int &lowerGaussLimit,
354
                     const int& numPieces,
362
                     const int& numPieces,
355
                     int &inew,
363
                     int &inew,
356
                     const Real &aorb,
364
                     const Real &aorb,
357
-                    KernelEm1DBase *Kernel) {
365
+                    KernelEM1DBase* Kernel) {
358
 
366
 
359
         HighestGaussOrder      = 0;
367
         HighestGaussOrder      = 0;
360
         NumberPartialIntegrals = 0;
368
         NumberPartialIntegrals = 0;
478
     }
486
     }
479
 
487
 
480
     /////////////////////////////////////////////////////////////
488
     /////////////////////////////////////////////////////////////
481
-    void HankelTransformGaussianQuadrature::
489
+    void GQChave::
482
         Bestrn(Real &BESR, Real &BESI, const int &IORDER,
490
         Bestrn(Real &BESR, Real &BESI, const int &IORDER,
483
             const int &NG, const Real &rho,
491
             const int &NG, const Real &rho,
484
             const Real &RERR, const Real &AERR, const int &NPCS,
492
             const Real &RERR, const Real &AERR, const int &NPCS,
485
             VectorXi &XSUM, int &NSUM, int &NEW,
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
         Xr.setZero();
497
         Xr.setZero();
726
 
734
 
727
 
735
 
728
     /////////////////////////////////////////////////////////////
736
     /////////////////////////////////////////////////////////////
729
-    void HankelTransformGaussianQuadrature::
737
+    void GQChave::
730
             Besqud(const Real &LowerLimit, const Real &UpperLimit,
738
             Besqud(const Real &LowerLimit, const Real &UpperLimit,
731
                     Real &Besr, Real &Besi, const int &npoints,
739
                     Real &Besr, Real &Besi, const int &npoints,
732
                     const int &NEW,
740
                     const int &NEW,
733
                     const int &besselOrder, const Real &rho,
741
                     const int &besselOrder, const Real &rho,
734
-                    KernelEm1DBase* Kernel) {
742
+                    KernelEM1DBase* Kernel) {
735
 
743
 
736
         const int NTERM = 100;
744
         const int NTERM = 100;
737
 
745
 
920
 
928
 
921
 
929
 
922
     /////////////////////////////////////////////////////////////
930
     /////////////////////////////////////////////////////////////
923
-    void HankelTransformGaussianQuadrature::
931
+    void GQChave::
924
             Padecf(Real &SUMR, Real &SUMI, const int &N) {
932
             Padecf(Real &SUMR, Real &SUMI, const int &N) {
925
 
933
 
926
         if (N < 2) {
934
         if (N < 2) {
1012
     }
1020
     }
1013
 
1021
 
1014
     /////////////////////////////////////////////////////////////
1022
     /////////////////////////////////////////////////////////////
1015
-    void HankelTransformGaussianQuadrature::CF(Real& RESR, Real &RESI,
1023
+    void GQChave::CF(Real& RESR, Real &RESI,
1016
                     Eigen::Matrix<Real, 100, 1> &CFCOR,
1024
                     Eigen::Matrix<Real, 100, 1> &CFCOR,
1017
                     Eigen::Matrix<Real, 100, 1> &CFCOI,
1025
                     Eigen::Matrix<Real, 100, 1> &CFCOI,
1018
                     const int &N) {
1026
                     const int &N) {
1037
     }
1045
     }
1038
 
1046
 
1039
     /////////////////////////////////////////////////////////////
1047
     /////////////////////////////////////////////////////////////
1040
-    Real HankelTransformGaussianQuadrature::
1048
+    Real GQChave::
1041
         ZeroJ(const int &nzero, const int &besselOrder) {
1049
         ZeroJ(const int &nzero, const int &besselOrder) {
1042
 
1050
 
1043
         Real ZT1 = -1.e0/8.e0;
1051
         Real ZT1 = -1.e0/8.e0;
1069
 
1077
 
1070
     /////////////////////////////////////////////////////////////
1078
     /////////////////////////////////////////////////////////////
1071
     // Dot product allowing non 1 based incrementing
1079
     // Dot product allowing non 1 based incrementing
1072
-    Real HankelTransformGaussianQuadrature::_dot(const int&n,
1080
+    Real GQChave::_dot(const int&n,
1073
         const Eigen::Matrix<Real, Eigen::Dynamic, Eigen::Dynamic> &X1,
1081
         const Eigen::Matrix<Real, Eigen::Dynamic, Eigen::Dynamic> &X1,
1074
                 const int &inc1,
1082
                 const int &inc1,
1075
         const Eigen::Matrix<Real, Eigen::Dynamic, Eigen::Dynamic> &X2,
1083
         const Eigen::Matrix<Real, Eigen::Dynamic, Eigen::Dynamic> &X2,
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
         switch (IORDER) {
1112
         switch (IORDER) {
1108
             case 0:
1113
             case 0:
1109
                 //return boost::math::detail::bessel_j0(X);
1114
                 //return boost::math::detail::bessel_j0(X);
1114
                 return boost::math::cyl_bessel_j(1, x);
1119
                 return boost::math::cyl_bessel_j(1, x);
1115
                 break;
1120
                 break;
1116
             default:
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 View File

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

Loading…
Cancel
Save