소스 검색

work towards AEM support again

submodule
Trevor Irons 7 년 전
부모
커밋
f18a9aa3b3

+ 1
- 1
Modules/FDEM1D/include/AEMSurvey.h 파일 보기

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

+ 1
- 0
Modules/FDEM1D/include/FDEM1D 파일 보기

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

+ 6
- 8
Modules/FDEM1D/include/LayeredEarthEMReader.h 파일 보기

@@ -34,8 +34,6 @@ namespace Lemma {
34 34
 		friend std::ostream &operator<<(std::ostream &stream,
35 35
 			const LayeredEarthEMReader &ob);
36 36
 
37
-        struct ctor_key{};
38
-
39 37
         public:
40 38
 
41 39
         // ====================  LIFECYCLE     =======================
@@ -55,14 +53,14 @@ namespace Lemma {
55 53
         /** Default destructor */
56 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 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 65
         // ====================  OPERATORS     =======================
68 66
 
@@ -84,7 +82,7 @@ namespace Lemma {
84 82
 
85 83
         /** @return the pointer address of the LayeredEarthEM
86 84
          */
87
-        LayeredEarthEM* GetLayeredEarth();
85
+        std::shared_ptr<LayeredEarthEM> GetLayeredEarth();
88 86
 
89 87
         // ====================  INQUIRY       =======================
90 88
 
@@ -101,7 +99,7 @@ namespace Lemma {
101 99
 
102 100
         // ====================  DATA MEMBERS  =========================
103 101
 
104
-        LayeredEarthEM*         LayEarth;
102
+        std::shared_ptr<LayeredEarthEM>         LayEarth;
105 103
 
106 104
         /** ASCII string representation of the class name */
107 105
         static constexpr auto CName = "LayeredEarthEMReader";

+ 4
- 3
Modules/FDEM1D/src/CMakeLists.txt 파일 보기

@@ -2,7 +2,7 @@ set (FDEM1DSOURCE
2 2
 	${FDEM1DSOURCE}
3 3
 
4 4
 	${CMAKE_CURRENT_SOURCE_DIR}/LayeredEarthEM.cpp
5
-#	${CMAKE_CURRENT_SOURCE_DIR}/LayeredEarthEMReader.cpp
5
+	${CMAKE_CURRENT_SOURCE_DIR}/LayeredEarthEMReader.cpp
6 6
 	
7 7
 	${CMAKE_CURRENT_SOURCE_DIR}/FieldPoints.cpp
8 8
 	
@@ -25,8 +25,9 @@ set (FDEM1DSOURCE
25 25
 	
26 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 31
 	#${CMAKE_CURRENT_SOURCE_DIR}/UngroundedElectricDipole.cpp
31 32
 	PARENT_SCOPE
32 33
 )

+ 7
- 30
Modules/FDEM1D/src/LayeredEarthEMReader.cpp 파일 보기

@@ -35,7 +35,7 @@ namespace Lemma {
35 35
     //      Method:  LayeredEarthEMReader
36 36
     // Description:  constructor (protected)
37 37
     //--------------------------------------------------------------------------------------
38
-    LayeredEarthEMReader::LayeredEarthEMReader ( const ctor_key& key ) : LemmaObject(),
38
+    LayeredEarthEMReader::LayeredEarthEMReader ( const ctor_key& key ) : LemmaObject( key ),
39 39
         LayEarth(nullptr) {
40 40
 
41 41
     }  // -----  end of method LayeredEarthEMReader::LayeredEarthEMReader  (constructor)  -----
@@ -46,10 +46,8 @@ namespace Lemma {
46 46
     //      Method:  New()
47 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,33 +56,13 @@ namespace Lemma {
58 56
     // Description:  destructor (protected)
59 57
     //--------------------------------------------------------------------------------------
60 58
     LayeredEarthEMReader::~LayeredEarthEMReader () {
61
-        if (LayEarth) LayEarth->Delete();
62 59
     }  // -----  end of method LayeredEarthEMReader::~LayeredEarthEMReader  (destructor)  -----
63 60
 
64 61
     //--------------------------------------------------------------------------------------
65 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 63
     //      Method:  GetLayeredEarth
86 64
     //--------------------------------------------------------------------------------------
87
-    LayeredEarthEM* LayeredEarthEMReader::GetLayeredEarth (  ) {
65
+    std::shared_ptr<LayeredEarthEM> LayeredEarthEMReader::GetLayeredEarth (  ) {
88 66
         return LayEarth;
89 67
     }		// -----  end of method LayeredEarthEMReader::GetLayeredEarth  -----
90 68
 
@@ -94,9 +72,9 @@ namespace Lemma {
94 72
     //      Method:  ReadASCIIInputFile
95 73
     //--------------------------------------------------------------------------------------
96 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 79
         Parser->SetCommentString("//");
102 80
         Parser->Open(name);
@@ -114,7 +92,6 @@ namespace Lemma {
114 92
         sigma(nlay) = 1./Parser->ReadReals(1)[0];
115 93
         LayEarth->SetLayerConductivity(sigma);
116 94
         if (thick.size() > 0) LayEarth->SetLayerThickness(thick);
117
-        Parser->Delete();
118 95
         return ;
119 96
     }		// -----  end of method LayeredEarthEMReader::ReadASCIIInputFile  -----
120 97
 

Loading…
취소
저장