Browse Source

changes for Lemma 0.2.0

master
T-bone 6 years ago
parent
commit
235639a0af
4 changed files with 19 additions and 24 deletions
  1. 13
    13
      examples/EMSchur3D.cpp
  2. 2
    4
      include/EMSchur3D.h
  3. 2
    5
      include/EMSchur3DBase.h
  4. 2
    2
      src/EMSchur3DBase.cpp

+ 13
- 13
examples/EMSchur3D.cpp View File

@@ -54,19 +54,19 @@ int main( int argc, char** argv ) {
54 54
 
55 55
     //////////////////////////////////////////////////
56 56
     // Read in Layered earth, for backgound model
57
-    auto LayEarthRead = LayeredEarthEMReader::NewSP();
58
-        try {
59
-            LayEarthRead->ReadASCIIInputFile( argv[2] );
60
-        } catch (std::exception& e) {
61
-		    std::cout << "Caught an error opening ASCII Layered Earth file: ";
62
-            std::cout << e.what() << std::endl;
63
-		    std::cout << "enter filename or 0 to exit programme\n";
64
-		    std::string inp;
65
-		    std::cin >> inp;
66
-		    if (inp != "0")
67
-                GridRead->ReadASCIIGridFile( inp.c_str() );
68
-            else exit(EXIT_FAILURE);
69
-	    }
57
+//     auto LayEarthRead = LayeredEarthEMReader::NewSP();
58
+//         try {
59
+//             LayEarthRead->ReadASCIIInputFile( argv[2] );
60
+//         } catch (std::exception& e) {
61
+// 		    std::cout << "Caught an error opening ASCII Layered Earth file: ";
62
+//             std::cout << e.what() << std::endl;
63
+// 		    std::cout << "enter filename or 0 to exit programme\n";
64
+// 		    std::string inp;
65
+// 		    std::cin >> inp;
66
+// 		    if (inp != "0")
67
+//                 GridRead->ReadASCIIGridFile( inp.c_str() );
68
+//             else exit(EXIT_FAILURE);
69
+// 	    }
70 70
 
71 71
     /*
72 72
     //////////////////////////////////////////////////

+ 2
- 4
include/EMSchur3D.h View File

@@ -41,8 +41,6 @@ namespace Lemma {
41 41
             return stream;
42 42
         }
43 43
 
44
-        struct ctor_key {};
45
-
46 44
         //friend std::ostream &operator<<(std::ostream &stream,
47 45
         //        const EMSchur3D &ob);
48 46
 
@@ -60,12 +58,12 @@ namespace Lemma {
60 58
         }
61 59
 
62 60
         /** Default protected constructor, use New */
63
-        explicit EMSchur3D ( const ctor_key& key ) : EMSchur3DBase( ), CSolver( nullptr ) {
61
+        explicit EMSchur3D ( const ctor_key& key ) : EMSchur3DBase( key ), CSolver( nullptr ) {
64 62
 
65 63
         }
66 64
 
67 65
         /** Locked DeDerializing constructor, use factory DeSerialize  method*/
68
-        EMSchur3D (const YAML::Node& node): EMSchur3DBase(node), CSolver( nullptr ) {
66
+        EMSchur3D (const YAML::Node& node, const ctor_key& key): EMSchur3DBase(node, key), CSolver( nullptr ) {
69 67
         }
70 68
 
71 69
         /** Default protected destructor, use Delete */

+ 2
- 5
include/EMSchur3DBase.h View File

@@ -143,9 +143,6 @@ class EMSchur3DBase : public LemmaObject {
143 143
 
144 144
     protected:
145 145
 
146
-    // since this is a ABC, key is not necessary...still would be nice to find a
147
-    // mechanism for specifying where keys may be passed down from...
148
-    //struct ctor_key {};
149 146
     //template<typename U>
150 147
     //friend class EMSchur3D;
151 148
 
@@ -154,10 +151,10 @@ class EMSchur3DBase : public LemmaObject {
154 151
     // ====================  LIFECYCLE     =======================
155 152
 
156 153
     /** Default protected constructor, use New */
157
-    explicit EMSchur3DBase (  );
154
+    explicit EMSchur3DBase ( const ctor_key&  );
158 155
 
159 156
     /** Default protected constructor, use New */
160
-    explicit EMSchur3DBase ( const YAML::Node& node );
157
+    explicit EMSchur3DBase ( const YAML::Node& node, const ctor_key& );
161 158
 
162 159
     /** Default protected destructor, use Delete */
163 160
     virtual ~EMSchur3DBase ( );

+ 2
- 2
src/EMSchur3DBase.cpp View File

@@ -56,7 +56,7 @@ namespace Lemma {
56 56
     //      Method:  EMSchur3DBase
57 57
     // Description:  constructor (protected)
58 58
     //--------------------------------------------------------------------------------------
59
-    EMSchur3DBase::EMSchur3DBase ( ) : LemmaObject( ),
59
+    EMSchur3DBase::EMSchur3DBase ( const ctor_key& key ) : LemmaObject( key ),
60 60
         Grid(nullptr),
61 61
         //Survey(nullptr),
62 62
         LayModel(nullptr), Cvec(nullptr),
@@ -69,7 +69,7 @@ namespace Lemma {
69 69
     //      Method:  EMSchur3DBase
70 70
     // Description:  constructor (protected)
71 71
     //--------------------------------------------------------------------------------------
72
-    EMSchur3DBase::EMSchur3DBase ( const YAML::Node& node ) : LemmaObject(),
72
+    EMSchur3DBase::EMSchur3DBase ( const YAML::Node& node, const ctor_key& key ) : LemmaObject( key ),
73 73
         Grid(nullptr),
74 74
         //Survey(nullptr),
75 75
         LayModel(nullptr), Cvec(nullptr),

Loading…
Cancel
Save