Browse Source

Work towards porting FD1D over to the new build. Also cleaning up the air layer stuff, so that things are more explicit and clear.

enhancement_3
Trevor Irons 7 years ago
parent
commit
137f9f6b8d

+ 2
- 0
LemmaCore/include/LayeredEarth.h View File

26
 	// =======================================================================
26
 	// =======================================================================
27
 	class LayeredEarth : public EarthModel {
27
 	class LayeredEarth : public EarthModel {
28
 
28
 
29
+        friend class LayeredEarthEM;
30
+
29
 		public:
31
 		public:
30
 
32
 
31
 			// ====================    FRIENDS     ===========================
33
 			// ====================    FRIENDS     ===========================

+ 2
- 1
LemmaCore/include/LemmaObject.h View File

94
         LemmaObject (const YAML::Node& node);
94
         LemmaObject (const YAML::Node& node);
95
 
95
 
96
         /** Protected default destructor. This is an abstract class and
96
         /** Protected default destructor. This is an abstract class and
97
-         *  cannot be instantiated.
97
+         *  cannot be instantiated. Virtual is necessary so that if base class destructor is
98
+         *  called, we get the right behaviour.
98
          */
99
          */
99
         virtual ~LemmaObject();
100
         virtual ~LemmaObject();
100
 
101
 

+ 19
- 0
Modules/FDEM1D/CMakeLists.txt View File

1
+include_directories(${CMAKE_INSTALL_PREFIX}/include)
2
+
3
+include_directories( "${CMAKE_CURRENT_SOURCE_DIR}/include" )
4
+add_subdirectory("src")
5
+
6
+add_library( fdem1d ${FEM1DSOURCE} )  
7
+target_link_libraries(fdem1d "lemmacore")
8
+
9
+install ( TARGETS fdem1d DESTINATION ${CMAKE_INSTALL_PREFIX}/lib )
10
+
11
+if (LEMMA_BUILD_EXAMPLES)
12
+	add_subdirectory(examples)
13
+endif()
14
+	
15
+if (LEMMA_ENABLE_TESTING)
16
+	add_subdirectory(testing)
17
+endif()
18
+
19
+install ( TARGETS fdem1d DESTINATION ${CMAKE_INSTALL_PREFIX}/lib )

+ 6
- 0
Modules/FDEM1D/examples/CMakeLists.txt View File

1
+add_executable( LayeredEarthEM LayeredEarthEM.cpp  )
2
+target_link_libraries(  LayeredEarthEM  "lemmacore" "fdem1d")
3
+
4
+INSTALL_TARGETS( "/share/FEM1D/"
5
+	LayeredEarthEM 
6
+)

+ 32
- 0
Modules/FDEM1D/examples/LayeredEarthEM.cpp View File

1
+/* This file is part of Lemma, a geophysical modelling and inversion API.
2
+ * More information is available at http://lemmasoftware.org
3
+ */
4
+
5
+/* This Source Code Form is subject to the terms of the Mozilla Public
6
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
7
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8
+ */
9
+
10
+/**
11
+ * @file
12
+ * @date      07/14/2016 03:14:50 PM
13
+ * @version   $Id$
14
+ * @author    Trevor Irons (ti)
15
+ * @email     tirons@egi.utah.edu
16
+ * @copyright Copyright (c) 2016, University of Utah
17
+ * @copyright Copyright (c) 2016, Lemma Software, LLC
18
+ */
19
+
20
+#include "FEM1D"
21
+
22
+using namespace Lemma;
23
+
24
+int main() {
25
+
26
+    auto model = LayeredEarthEM::NewSP();
27
+        model->SetNumberOfLayers(6);
28
+        model->SetLayerThickness( (VectorXr(4) << 10,10,10,10).finished() );
29
+        model->SetLayerConductivity( (VectorXcr(6) << .1, .10,.10,.10,.10,.10).finished() );
30
+    std::cout << *model << std::endl;
31
+}
32
+

Modules/FDEM1D/AEMSurvey.h → Modules/FDEM1D/include/AEMSurvey.h View File


Modules/FDEM1D/AEMSurveyReader.h → Modules/FDEM1D/include/AEMSurveyReader.h View File


+ 4
- 0
Modules/FDEM1D/include/FEM1D View File

1
+#include "LayeredEarthEM.h"
2
+
3
+/* vim: set tabstop=4 expandtab: */
4
+/* vim: set filetype=cpp: */

Modules/FDEM1D/include/layeredearthem.h → Modules/FDEM1D/include/LayeredEarthEM.h View File

14
 #ifndef __LAYEREDEARTHEM_H
14
 #ifndef __LAYEREDEARTHEM_H
15
 #define __LAYEREDEARTHEM_H
15
 #define __LAYEREDEARTHEM_H
16
 
16
 
17
-#include "layeredearth.h"
17
+#include "LayeredEarth.h"
18
 #include <iomanip>
18
 #include <iomanip>
19
 
19
 
20
 namespace Lemma {
20
 namespace Lemma {
38
             // ====================  LIFECYCLE     ===========================
38
             // ====================  LIFECYCLE     ===========================
39
 
39
 
40
             /**
40
             /**
41
-             *  Public constructor. Creates a new instance of the class and
42
-             *  assigns a reference to the thrown pointer.
41
+             *  Factory method for generating concrete class.
42
+             *  @return a std::shared_ptr of type LayeredEarthEM
43
              */
43
              */
44
-            static LayeredEarthEM* New();
44
+            static std::shared_ptr<LayeredEarthEM> NewSP();
45
 
45
 
46
-            /**
47
-             * @copybrief LemmaObject::Delete()
48
-             * @copydetails LemmaObject::Delete()
49
-             */
50
-            void Delete();
51
-
52
-            #ifdef HAVE_YAMLCPP
53
             /** YAML Serializing method
46
             /** YAML Serializing method
54
              */
47
              */
55
             YAML::Node Serialize() const;
48
             YAML::Node Serialize() const;
56
 
49
 
57
-
58
-            //static LayeredEarthEM* DeSerialize(const YAML::Node& node);
59
-            #endif
50
+            /**
51
+             *   Constructs an object from a YAML::Node.
52
+             */
53
+            static std::shared_ptr< LayeredEarthEM > DeSerialize(const YAML::Node& node);
60
 
54
 
61
             /** @return a deep copy
55
             /** @return a deep copy
62
              */
56
              */
63
-			LayeredEarthEM* Clone();
57
+			std::shared_ptr<LayeredEarthEM> Clone();
64
 
58
 
65
             // ====================  OPERATORS     ===========================
59
             // ====================  OPERATORS     ===========================
66
 
60
 
243
             // ====================  LIFECYCLE     ===========================
237
             // ====================  LIFECYCLE     ===========================
244
 
238
 
245
             /** Default protected constructor. */
239
             /** Default protected constructor. */
246
-            LayeredEarthEM (const std::string &name);
240
+            LayeredEarthEM ( );
247
 
241
 
248
-            #ifdef HAVE_YAMLCPP
249
             /** Default protected constructor. */
242
             /** Default protected constructor. */
250
 			LayeredEarthEM (const YAML::Node& node);
243
 			LayeredEarthEM (const YAML::Node& node);
251
-            #endif
252
 
244
 
253
             /** Default protected constructor. */
245
             /** Default protected constructor. */
254
             ~LayeredEarthEM ();
246
             ~LayeredEarthEM ();
306
             /** Relaxation breath for each layer */
298
             /** Relaxation breath for each layer */
307
             VectorXr          LayerBreathPermitivity;
299
             VectorXr          LayerBreathPermitivity;
308
 
300
 
301
+            private:
302
+
303
+            /** ASCII string representation of the class name */
304
+            static constexpr auto CName = "LayeredEarthEM";
305
+
309
     }; // -----  end of class  LayeredEarthEM  -----
306
     }; // -----  end of class  LayeredEarthEM  -----
310
 
307
 
311
 
308
 
312
 } // namespace Lemma
309
 } // namespace Lemma
313
 
310
 
314
 #endif // __LAYEREDEARTHEM_H
311
 #endif // __LAYEREDEARTHEM_H
312
+
313
+/* vim: set tabstop=4 expandtab: */
314
+/* vim: set filetype=cpp: */

+ 6
- 0
Modules/FDEM1D/src/CMakeLists.txt View File

1
+set (FEM1DSOURCE
2
+	${FEM1DSOURCE}
3
+	${CMAKE_CURRENT_SOURCE_DIR}/LayeredEarthEM.cpp
4
+	#${CMAKE_CURRENT_SOURCE_DIR}/UngroundedElectricDipole.cpp
5
+	PARENT_SCOPE
6
+)

Modules/FDEM1D/src/layeredearthem.cpp → Modules/FDEM1D/src/LayeredEarthEM.cpp View File

11
   @version  $Id: layeredearthem.cpp 216 2015-03-09 02:26:49Z tirons $
11
   @version  $Id: layeredearthem.cpp 216 2015-03-09 02:26:49Z tirons $
12
  **/
12
  **/
13
 
13
 
14
-#include "layeredearthem.h"
14
+#include "LayeredEarthEM.h"
15
 
15
 
16
 namespace Lemma {
16
 namespace Lemma {
17
 
17
 
18
-#ifdef HAVE_YAMLCPP
19
     std::ostream &operator << (std::ostream &stream, const LayeredEarthEM &ob) {
18
     std::ostream &operator << (std::ostream &stream, const LayeredEarthEM &ob) {
20
         stream << ob.Serialize()  << "\n---\n"; // End of doc --- as a direct stream should encapulste thingy
19
         stream << ob.Serialize()  << "\n---\n"; // End of doc --- as a direct stream should encapulste thingy
21
         return stream;
20
         return stream;
22
     }
21
     }
23
-#else
24
-    std::ostream &operator<<(std::ostream &stream,
25
-                const LayeredEarthEM &ob) {
26
-        stream << *(LayeredEarth*)(&ob);
27
-        //stream << "Class Name : "<< ob.Name  << "\n";
28
-        stream << std::setw(15) << "LayerNumber"         << "\t"
29
-               << std::setw(15) << "Thickness"           << "\t"
30
-               << std::setw(15) << "BottomInterface"     << "\t"
31
-               << std::setw(15) << "Conductivity"        << "\t"
32
-               << std::setw(15) << "Susceptibility"      << "\t"
33
-               << std::setw(15) << "Permitivity"         << "\n";
34
-        stream << std::setw(15) << " "                   << "\t"
35
-               << std::setw(15) << "[m]"                 << "\t"
36
-               << std::setw(15) << "[m]"                 << "\t"
37
-               << std::setw(15) << "[Sm^-1]"             << "\t"
38
-               << std::setw(15) << "[]"                  << "\t"
39
-               << std::setw(15) << "[F/m]"               << "\n";
40
-        for (int i=0; i< ob.NumberOfLayers; ++i) {
41
-            stream << std::setw(15) <<  i << "\t"
42
-                   << std::setw(15) << ((LayeredEarth*)(&ob))->GetLayerThickness(i) << "\t"
43
-                   << std::setw(15) << ((LayeredEarth*)(&ob))->GetLayerDepth(i) << "\t"
44
-                   << std::setw(15) << ob.LayerConductivity(i)     << "\t"
45
-                   << std::setw(15) << ob.LayerSusceptibility(i)   << "\t"
46
-                   << std::setw(15) << ob.LayerPermitivity(i)      << "\n";
47
-        }
48
-
49
-        return stream;
50
-    }
51
-#endif
52
 
22
 
53
     // ====================  LIFECYCLE     ===================================
23
     // ====================  LIFECYCLE     ===================================
54
 
24
 
55
-    LayeredEarthEM::LayeredEarthEM(const std::string &name) :
56
-        LayeredEarth(name) {
25
+    LayeredEarthEM::LayeredEarthEM( ) : LayeredEarth() {
57
     }
26
     }
58
 
27
 
59
     LayeredEarthEM::~LayeredEarthEM() {
28
     LayeredEarthEM::~LayeredEarthEM() {
60
-        if (NumberOfReferences != 0) {
61
-            throw DeleteObjectWithReferences(this);
62
-        }
63
-    }
64
-
65
-    LayeredEarthEM* LayeredEarthEM::New() {
66
-        LayeredEarthEM* Obj = new LayeredEarthEM("LayeredEarthEM");
67
-        Obj->AttachTo(Obj);
68
-        return Obj;
69
     }
29
     }
70
 
30
 
71
-    void LayeredEarthEM::Delete() {
72
-        this->DetachFrom(this);
31
+    std::shared_ptr<LayeredEarthEM> LayeredEarthEM::NewSP() {
32
+        std::shared_ptr<LayeredEarthEM> sp(new  LayeredEarthEM( ), LemmaObjectDeleter() );
33
+        return sp;
73
     }
34
     }
74
 
35
 
75
-    void LayeredEarthEM::Release() {
76
-        delete this;
77
-    }
78
-
79
-    #ifdef HAVE_YAMLCPP
80
     YAML::Node LayeredEarthEM::Serialize() const {
36
     YAML::Node LayeredEarthEM::Serialize() const {
81
         YAML::Node node = LayeredEarth::Serialize();
37
         YAML::Node node = LayeredEarth::Serialize();
82
-        node.SetTag( this->Name );
38
+        node.SetTag( GetName() );
83
         node["LayerConductivity"] = LayerConductivity;
39
         node["LayerConductivity"] = LayerConductivity;
84
         node["LayerSusceptibility"] = LayerSusceptibility;
40
         node["LayerSusceptibility"] = LayerSusceptibility;
85
         node["LayerLowFreqSusceptibility"] = LayerLowFreqSusceptibility;
41
         node["LayerLowFreqSusceptibility"] = LayerLowFreqSusceptibility;
93
         node["LayerBreathPermitivity"] = LayerBreathPermitivity;
49
         node["LayerBreathPermitivity"] = LayerBreathPermitivity;
94
         return node;
50
         return node;
95
     }
51
     }
96
-    #endif
97
 
52
 
98
     // ====================  OPERATIONS    ===================================
53
     // ====================  OPERATIONS    ===================================
99
     void LayeredEarthEM::EvaluateColeColeModel(const Real& omega) {
54
     void LayeredEarthEM::EvaluateColeColeModel(const Real& omega) {
100
 
55
 
101
-        for (int ilay=0; ilay<NumberOfLayers; ++ilay) {
56
+        for (int ilay=0; ilay<GetNumberOfLayers(); ++ilay) {
102
             if ( LayerTauSusceptibility(ilay) > 1e-10) {
57
             if ( LayerTauSusceptibility(ilay) > 1e-10) {
103
                 LayerSusceptibility(ilay) = LayerHighFreqSusceptibility(ilay) + (LayerLowFreqSusceptibility(ilay) -
58
                 LayerSusceptibility(ilay) = LayerHighFreqSusceptibility(ilay) + (LayerLowFreqSusceptibility(ilay) -
104
                      LayerHighFreqSusceptibility(ilay)) /
59
                      LayerHighFreqSusceptibility(ilay)) /
122
         }
77
         }
123
     }
78
     }
124
 
79
 
125
-	LayeredEarthEM* LayeredEarthEM::Clone() {
126
-		LayeredEarthEM* copy = LayeredEarthEM::New();
127
-
80
+	std::shared_ptr<LayeredEarthEM> LayeredEarthEM::Clone() {
81
+		auto copy = LayeredEarthEM::NewSP();
128
 		copy->LayerConductivity = this->LayerConductivity;
82
 		copy->LayerConductivity = this->LayerConductivity;
129
 		copy->LayerSusceptibility = this->LayerSusceptibility;
83
 		copy->LayerSusceptibility = this->LayerSusceptibility;
130
 		copy->LayerLowFreqSusceptibility = this->LayerLowFreqSusceptibility;
84
 		copy->LayerLowFreqSusceptibility = this->LayerLowFreqSusceptibility;
136
 		copy->LayerHighFreqPermitivity = this->LayerHighFreqPermitivity;
90
 		copy->LayerHighFreqPermitivity = this->LayerHighFreqPermitivity;
137
 		copy->LayerTauPermitivity = this->LayerTauPermitivity;
91
 		copy->LayerTauPermitivity = this->LayerTauPermitivity;
138
 		copy->LayerBreathPermitivity = this->LayerBreathPermitivity;
92
 		copy->LayerBreathPermitivity = this->LayerBreathPermitivity;
139
-		copy->NumberOfLayers = this->NumberOfLayers;
93
+		copy->SetNumberOfLayers( this->GetNumberOfLayers() );
140
 		copy->NumberOfInterfaces = this->NumberOfInterfaces;
94
 		copy->NumberOfInterfaces = this->NumberOfInterfaces;
141
 		copy->LayerThickness = this->LayerThickness;
95
 		copy->LayerThickness = this->LayerThickness;
142
-
143
 		return copy;
96
 		return copy;
144
-
145
 	}
97
 	}
146
 
98
 
147
     // ====================  ACCESS        ==================================
99
     // ====================  ACCESS        ==================================
148
 
100
 
149
     void LayeredEarthEM::SetLayerConductivity(const VectorXcr &sig) {
101
     void LayeredEarthEM::SetLayerConductivity(const VectorXcr &sig) {
150
-        if (sig.size() != this->NumberOfLayers )
102
+        if (sig.size() != this->GetNumberOfLayers() )
151
             throw EarthModelParametersDoNotMatchNumberOfLayers( );
103
             throw EarthModelParametersDoNotMatchNumberOfLayers( );
152
         LayerConductivity = sig;
104
         LayerConductivity = sig;
153
     }
105
     }
154
 
106
 
155
     void LayeredEarthEM::SetLayerConductivity(const int& ilay, const Complex &sig) {
107
     void LayeredEarthEM::SetLayerConductivity(const int& ilay, const Complex &sig) {
156
-        if (ilay > this->NumberOfLayers || ilay < 1 )
108
+        if (ilay > this->GetNumberOfLayers() || ilay < 1 )
157
             throw EarthModelParametersDoNotMatchNumberOfLayers( );
109
             throw EarthModelParametersDoNotMatchNumberOfLayers( );
158
         LayerConductivity[ilay] = sig;
110
         LayerConductivity[ilay] = sig;
159
     }
111
     }
167
 */
119
 */
168
 
120
 
169
     void LayeredEarthEM::SetLayerHighFreqSusceptibility(const VectorXr &sus) {
121
     void LayeredEarthEM::SetLayerHighFreqSusceptibility(const VectorXr &sus) {
170
-        if (sus.size() != this->NumberOfLayers )
122
+        if (sus.size() != this->GetNumberOfLayers() )
171
             throw EarthModelParametersDoNotMatchNumberOfLayers( );
123
             throw EarthModelParametersDoNotMatchNumberOfLayers( );
172
         LayerHighFreqSusceptibility = sus;
124
         LayerHighFreqSusceptibility = sus;
173
     }
125
     }
174
 
126
 
175
     void LayeredEarthEM::SetLayerLowFreqSusceptibility(const VectorXr &sus) {
127
     void LayeredEarthEM::SetLayerLowFreqSusceptibility(const VectorXr &sus) {
176
-        if (sus.size() != this->NumberOfLayers )
128
+        if (sus.size() != this->GetNumberOfLayers() )
177
             throw EarthModelParametersDoNotMatchNumberOfLayers( );
129
             throw EarthModelParametersDoNotMatchNumberOfLayers( );
178
         LayerLowFreqSusceptibility = sus;
130
         LayerLowFreqSusceptibility = sus;
179
     }
131
     }
180
 
132
 
181
     void LayeredEarthEM::SetLayerBreathSusceptibility(const VectorXr &sus) {
133
     void LayeredEarthEM::SetLayerBreathSusceptibility(const VectorXr &sus) {
182
-        if (sus.size() != this->NumberOfLayers )
134
+        if (sus.size() != this->GetNumberOfLayers() )
183
             throw EarthModelParametersDoNotMatchNumberOfLayers( );
135
             throw EarthModelParametersDoNotMatchNumberOfLayers( );
184
         LayerBreathSusceptibility = sus;
136
         LayerBreathSusceptibility = sus;
185
     }
137
     }
186
 
138
 
187
     void LayeredEarthEM::SetLayerTauSusceptibility(const VectorXr &sus) {
139
     void LayeredEarthEM::SetLayerTauSusceptibility(const VectorXr &sus) {
188
-        if (sus.size() != this->NumberOfLayers )
140
+        if (sus.size() != this->GetNumberOfLayers() )
189
             throw EarthModelParametersDoNotMatchNumberOfLayers( );
141
             throw EarthModelParametersDoNotMatchNumberOfLayers( );
190
         LayerTauSusceptibility = sus;
142
         LayerTauSusceptibility = sus;
191
     }
143
     }
192
 
144
 
193
     void LayeredEarthEM::SetLayerHighFreqPermitivity(const VectorXr &per) {
145
     void LayeredEarthEM::SetLayerHighFreqPermitivity(const VectorXr &per) {
194
-        if (per.size() != this->NumberOfLayers )
146
+        if (per.size() != this->GetNumberOfLayers() )
195
             throw EarthModelParametersDoNotMatchNumberOfLayers( );
147
             throw EarthModelParametersDoNotMatchNumberOfLayers( );
196
         LayerHighFreqPermitivity = per;
148
         LayerHighFreqPermitivity = per;
197
     }
149
     }
198
 
150
 
199
     void LayeredEarthEM::SetLayerLowFreqPermitivity(const VectorXr &per) {
151
     void LayeredEarthEM::SetLayerLowFreqPermitivity(const VectorXr &per) {
200
-        if (per.size() != this->NumberOfLayers )
152
+        if (per.size() != this->GetNumberOfLayers() )
201
             throw EarthModelParametersDoNotMatchNumberOfLayers( );
153
             throw EarthModelParametersDoNotMatchNumberOfLayers( );
202
         LayerLowFreqPermitivity = per;
154
         LayerLowFreqPermitivity = per;
203
     }
155
     }
204
 
156
 
205
     void LayeredEarthEM::SetLayerBreathPermitivity(const VectorXr &per) {
157
     void LayeredEarthEM::SetLayerBreathPermitivity(const VectorXr &per) {
206
-        if (per.size() != this->NumberOfLayers )
158
+        if (per.size() != this->GetNumberOfLayers() )
207
             throw EarthModelParametersDoNotMatchNumberOfLayers( );
159
             throw EarthModelParametersDoNotMatchNumberOfLayers( );
208
         LayerBreathPermitivity = per;
160
         LayerBreathPermitivity = per;
209
     }
161
     }
210
 
162
 
211
     void LayeredEarthEM::SetLayerTauPermitivity(const VectorXr &per) {
163
     void LayeredEarthEM::SetLayerTauPermitivity(const VectorXr &per) {
212
-        if (per.size() != this->NumberOfLayers )
164
+        if (per.size() != this->GetNumberOfLayers() )
213
             throw EarthModelParametersDoNotMatchNumberOfLayers( );
165
             throw EarthModelParametersDoNotMatchNumberOfLayers( );
214
         LayerTauPermitivity = per;
166
         LayerTauPermitivity = per;
215
     }
167
     }
216
 
168
 
217
     void LayeredEarthEM::SetLayerThickness(const VectorXr &thick) {
169
     void LayeredEarthEM::SetLayerThickness(const VectorXr &thick) {
218
-        if (thick.size() != this->NumberOfLayers - 2)
170
+        if (thick.size() != this->GetNumberOfLayers() - 2)
219
             throw EarthModelParametersDoNotMatchNumberOfLayers( );
171
             throw EarthModelParametersDoNotMatchNumberOfLayers( );
220
         LayerThickness = thick;
172
         LayerThickness = thick;
221
     }
173
     }
231
 
183
 
232
         // Otherwise
184
         // Otherwise
233
         this->NumberOfLayers = nlay;
185
         this->NumberOfLayers = nlay;
234
-
186
+        this->NumberOfInterfaces = nlay-1;
235
 
187
 
236
         // Resize all layers
188
         // Resize all layers
237
 
189
 
244
         // Conducitivy set to zero
196
         // Conducitivy set to zero
245
         LayerConductivity = VectorXcr::Zero(NumberOfLayers);
197
         LayerConductivity = VectorXcr::Zero(NumberOfLayers);
246
 
198
 
247
-
248
         ////////////////////////////////////
199
         ////////////////////////////////////
249
         // Susceptibility set to One (free space)
200
         // Susceptibility set to One (free space)
250
         LayerSusceptibility = VectorXcr::Ones(NumberOfLayers);
201
         LayerSusceptibility = VectorXcr::Ones(NumberOfLayers);
359
         return this->LayerBreathPermitivity;
310
         return this->LayerBreathPermitivity;
360
     }
311
     }
361
 }
312
 }
313
+
314
+/* vim: set tabstop=4 expandtab: */
315
+/* vim: set filetype=cpp: */

+ 3
- 0
Modules/FDEM1D/testing/CMakeLists.txt View File

1
+
2
+CXXTEST_ADD_TEST(unittestFEM1D_GetNameCheck GetNameCheck.cc ${CMAKE_CURRENT_SOURCE_DIR}/GetNameCheck.h)
3
+target_link_libraries(unittestFEM1D_GetNameCheck "lemmacore" "fdem1d")

+ 37
- 0
Modules/FDEM1D/testing/GetNameCheck.h View File

1
+/* This file is part of Lemma, a geophysical modelling and inversion API.
2
+ * More information is available at http://lemmasoftware.org
3
+ */
4
+
5
+/* This Source Code Form is subject to the terms of the Mozilla Public
6
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
7
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8
+ */
9
+
10
+/**
11
+ * @file
12
+ * @date      06/23/2016 01:26:46 PM
13
+ * @version   $Id$
14
+ * @author    Trevor Irons (ti)
15
+ * @email     tirons@egi.utah.edu
16
+ * @copyright Copyright (c) 2016, University of Utah
17
+ * @copyright Copyright (c) 2016, Lemma Software, LLC
18
+ */
19
+
20
+#include <cxxtest/TestSuite.h>
21
+#include <LemmaCore>
22
+#include <FEM1D>
23
+
24
+using namespace Lemma;
25
+
26
+class MyTestSuite : public CxxTest::TestSuite
27
+{
28
+    public:
29
+
30
+    void testLayeredEarthEM( void )
31
+    {
32
+        auto Obj = LayeredEarthEM::NewSP();
33
+        TS_ASSERT_EQUALS( Obj->GetName(), std::string("LayeredEarthEM") );
34
+    }
35
+
36
+};
37
+

Loading…
Cancel
Save