Quellcode durchsuchen

work towards AEM support again

submodule
Trevor Irons vor 7 Jahren
Ursprung
Commit
f18a9aa3b3

+ 1
- 1
Modules/FDEM1D/include/AEMSurvey.h Datei anzeigen

21
 #define  AEMSURVEY_INC
21
 #define  AEMSURVEY_INC
22
 
22
 
23
 #include "LemmaObject.h"
23
 #include "LemmaObject.h"
24
-#include "dipolesource.h"
24
+#include "DipoleSource.h"
25
 
25
 
26
 namespace Lemma {
26
 namespace Lemma {
27
 
27
 

+ 1
- 0
Modules/FDEM1D/include/FDEM1D Datei anzeigen

1
 #include "LayeredEarthEM.h"
1
 #include "LayeredEarthEM.h"
2
+#include "LayeredEarthEMReader.h"
2
 
3
 
3
 #include "FieldPoints.h"
4
 #include "FieldPoints.h"
4
 
5
 

+ 6
- 8
Modules/FDEM1D/include/LayeredEarthEMReader.h Datei anzeigen

34
 		friend std::ostream &operator<<(std::ostream &stream,
34
 		friend std::ostream &operator<<(std::ostream &stream,
35
 			const LayeredEarthEMReader &ob);
35
 			const LayeredEarthEMReader &ob);
36
 
36
 
37
-        struct ctor_key{};
38
-
39
         public:
37
         public:
40
 
38
 
41
         // ====================  LIFECYCLE     =======================
39
         // ====================  LIFECYCLE     =======================
55
         /** Default destructor */
53
         /** Default destructor */
56
         virtual ~LayeredEarthEMReader ();
54
         virtual ~LayeredEarthEMReader ();
57
 
55
 
58
-        /** YAML Serializing method
56
+        /* YAML Serializing method
59
          */
57
          */
60
-        YAML::Node Serialize() const;
58
+        //YAML::Node Serialize() const;
61
 
59
 
62
-        /**
60
+        /*
63
          *   Constructs an object from a YAML::Node.
61
          *   Constructs an object from a YAML::Node.
64
          */
62
          */
65
-        static std::shared_ptr< LayeredEarthEMReader > DeSerialize(const YAML::Node& node);
63
+        //static std::shared_ptr< LayeredEarthEMReader > DeSerialize(const YAML::Node& node);
66
 
64
 
67
         // ====================  OPERATORS     =======================
65
         // ====================  OPERATORS     =======================
68
 
66
 
84
 
82
 
85
         /** @return the pointer address of the LayeredEarthEM
83
         /** @return the pointer address of the LayeredEarthEM
86
          */
84
          */
87
-        LayeredEarthEM* GetLayeredEarth();
85
+        std::shared_ptr<LayeredEarthEM> GetLayeredEarth();
88
 
86
 
89
         // ====================  INQUIRY       =======================
87
         // ====================  INQUIRY       =======================
90
 
88
 
101
 
99
 
102
         // ====================  DATA MEMBERS  =========================
100
         // ====================  DATA MEMBERS  =========================
103
 
101
 
104
-        LayeredEarthEM*         LayEarth;
102
+        std::shared_ptr<LayeredEarthEM>         LayEarth;
105
 
103
 
106
         /** ASCII string representation of the class name */
104
         /** ASCII string representation of the class name */
107
         static constexpr auto CName = "LayeredEarthEMReader";
105
         static constexpr auto CName = "LayeredEarthEMReader";

+ 4
- 3
Modules/FDEM1D/src/CMakeLists.txt Datei anzeigen

2
 	${FDEM1DSOURCE}
2
 	${FDEM1DSOURCE}
3
 
3
 
4
 	${CMAKE_CURRENT_SOURCE_DIR}/LayeredEarthEM.cpp
4
 	${CMAKE_CURRENT_SOURCE_DIR}/LayeredEarthEM.cpp
5
-#	${CMAKE_CURRENT_SOURCE_DIR}/LayeredEarthEMReader.cpp
5
+	${CMAKE_CURRENT_SOURCE_DIR}/LayeredEarthEMReader.cpp
6
 	
6
 	
7
 	${CMAKE_CURRENT_SOURCE_DIR}/FieldPoints.cpp
7
 	${CMAKE_CURRENT_SOURCE_DIR}/FieldPoints.cpp
8
 	
8
 	
25
 	
25
 	
26
 	${CMAKE_CURRENT_SOURCE_DIR}/EMEarth1D.cpp
26
 	${CMAKE_CURRENT_SOURCE_DIR}/EMEarth1D.cpp
27
 
27
 
28
-	#${CMAKE_CURRENT_SOURCE_DIR}/AEMSurvey.cpp
29
-	#${CMAKE_CURRENT_SOURCE_DIR}/AEMSurveyReader.cpp
28
+	${CMAKE_CURRENT_SOURCE_DIR}/AEMSurvey.cpp
29
+	${CMAKE_CURRENT_SOURCE_DIR}/AEMSurveyReader.cpp
30
+	
30
 	#${CMAKE_CURRENT_SOURCE_DIR}/UngroundedElectricDipole.cpp
31
 	#${CMAKE_CURRENT_SOURCE_DIR}/UngroundedElectricDipole.cpp
31
 	PARENT_SCOPE
32
 	PARENT_SCOPE
32
 )
33
 )

+ 7
- 30
Modules/FDEM1D/src/LayeredEarthEMReader.cpp Datei anzeigen

35
     //      Method:  LayeredEarthEMReader
35
     //      Method:  LayeredEarthEMReader
36
     // Description:  constructor (protected)
36
     // Description:  constructor (protected)
37
     //--------------------------------------------------------------------------------------
37
     //--------------------------------------------------------------------------------------
38
-    LayeredEarthEMReader::LayeredEarthEMReader ( const ctor_key& key ) : LemmaObject(),
38
+    LayeredEarthEMReader::LayeredEarthEMReader ( const ctor_key& key ) : LemmaObject( key ),
39
         LayEarth(nullptr) {
39
         LayEarth(nullptr) {
40
 
40
 
41
     }  // -----  end of method LayeredEarthEMReader::LayeredEarthEMReader  (constructor)  -----
41
     }  // -----  end of method LayeredEarthEMReader::LayeredEarthEMReader  (constructor)  -----
46
     //      Method:  New()
46
     //      Method:  New()
47
     // Description:  public constructor
47
     // Description:  public constructor
48
     //--------------------------------------------------------------------------------------
48
     //--------------------------------------------------------------------------------------
49
-    LayeredEarthEMReader* LayeredEarthEMReader::New() {
50
-        LayeredEarthEMReader*  Obj = new LayeredEarthEMReader("LayeredEarthEMReader");
51
-        Obj->AttachTo(Obj);
52
-        return Obj;
49
+    std::shared_ptr<LayeredEarthEMReader> LayeredEarthEMReader::NewSP() {
50
+        return std::make_shared<LayeredEarthEMReader>( ctor_key() );
53
     }
51
     }
54
 
52
 
55
     //--------------------------------------------------------------------------------------
53
     //--------------------------------------------------------------------------------------
58
     // Description:  destructor (protected)
56
     // Description:  destructor (protected)
59
     //--------------------------------------------------------------------------------------
57
     //--------------------------------------------------------------------------------------
60
     LayeredEarthEMReader::~LayeredEarthEMReader () {
58
     LayeredEarthEMReader::~LayeredEarthEMReader () {
61
-        if (LayEarth) LayEarth->Delete();
62
     }  // -----  end of method LayeredEarthEMReader::~LayeredEarthEMReader  (destructor)  -----
59
     }  // -----  end of method LayeredEarthEMReader::~LayeredEarthEMReader  (destructor)  -----
63
 
60
 
64
     //--------------------------------------------------------------------------------------
61
     //--------------------------------------------------------------------------------------
65
     //       Class:  LayeredEarthEMReader
62
     //       Class:  LayeredEarthEMReader
66
-    //      Method:  Delete
67
-    // Description:  public destructor
68
-    //--------------------------------------------------------------------------------------
69
-    void LayeredEarthEMReader::Delete() {
70
-        this->DetachFrom(this);
71
-    }
72
-
73
-    //--------------------------------------------------------------------------------------
74
-    //       Class:  LayeredEarthEMReader
75
-    //      Method:  Release
76
-    // Description:  destructor (protected)
77
-    //--------------------------------------------------------------------------------------
78
-    void LayeredEarthEMReader::Release() {
79
-        delete this;
80
-    }
81
-
82
-
83
-    //--------------------------------------------------------------------------------------
84
-    //       Class:  LayeredEarthEMReader
85
     //      Method:  GetLayeredEarth
63
     //      Method:  GetLayeredEarth
86
     //--------------------------------------------------------------------------------------
64
     //--------------------------------------------------------------------------------------
87
-    LayeredEarthEM* LayeredEarthEMReader::GetLayeredEarth (  ) {
65
+    std::shared_ptr<LayeredEarthEM> LayeredEarthEMReader::GetLayeredEarth (  ) {
88
         return LayEarth;
66
         return LayEarth;
89
     }		// -----  end of method LayeredEarthEMReader::GetLayeredEarth  -----
67
     }		// -----  end of method LayeredEarthEMReader::GetLayeredEarth  -----
90
 
68
 
94
     //      Method:  ReadASCIIInputFile
72
     //      Method:  ReadASCIIInputFile
95
     //--------------------------------------------------------------------------------------
73
     //--------------------------------------------------------------------------------------
96
     void LayeredEarthEMReader::ReadASCIIInputFile ( const std::string& name ) {
74
     void LayeredEarthEMReader::ReadASCIIInputFile ( const std::string& name ) {
97
-        if (LayEarth) LayEarth->Delete();
98
-        ASCIIParser* Parser = ASCIIParser::New();
99
-        LayEarth = LayeredEarthEM::New();
75
+
76
+        auto Parser = ASCIIParser::NewSP();
77
+        LayEarth = LayeredEarthEM::NewSP();
100
 
78
 
101
         Parser->SetCommentString("//");
79
         Parser->SetCommentString("//");
102
         Parser->Open(name);
80
         Parser->Open(name);
114
         sigma(nlay) = 1./Parser->ReadReals(1)[0];
92
         sigma(nlay) = 1./Parser->ReadReals(1)[0];
115
         LayEarth->SetLayerConductivity(sigma);
93
         LayEarth->SetLayerConductivity(sigma);
116
         if (thick.size() > 0) LayEarth->SetLayerThickness(thick);
94
         if (thick.size() > 0) LayEarth->SetLayerThickness(thick);
117
-        Parser->Delete();
118
         return ;
95
         return ;
119
     }		// -----  end of method LayeredEarthEMReader::ReadASCIIInputFile  -----
96
     }		// -----  end of method LayeredEarthEMReader::ReadASCIIInputFile  -----
120
 
97
 

Laden…
Abbrechen
Speichern