Browse Source

changes for Lemma 0.2.0

master
T-bone 7 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
 
54
 
55
     //////////////////////////////////////////////////
55
     //////////////////////////////////////////////////
56
     // Read in Layered earth, for backgound model
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
             return stream;
41
             return stream;
42
         }
42
         }
43
 
43
 
44
-        struct ctor_key {};
45
-
46
         //friend std::ostream &operator<<(std::ostream &stream,
44
         //friend std::ostream &operator<<(std::ostream &stream,
47
         //        const EMSchur3D &ob);
45
         //        const EMSchur3D &ob);
48
 
46
 
60
         }
58
         }
61
 
59
 
62
         /** Default protected constructor, use New */
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
         /** Locked DeDerializing constructor, use factory DeSerialize  method*/
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
         /** Default protected destructor, use Delete */
69
         /** Default protected destructor, use Delete */

+ 2
- 5
include/EMSchur3DBase.h View File

143
 
143
 
144
     protected:
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
     //template<typename U>
146
     //template<typename U>
150
     //friend class EMSchur3D;
147
     //friend class EMSchur3D;
151
 
148
 
154
     // ====================  LIFECYCLE     =======================
151
     // ====================  LIFECYCLE     =======================
155
 
152
 
156
     /** Default protected constructor, use New */
153
     /** Default protected constructor, use New */
157
-    explicit EMSchur3DBase (  );
154
+    explicit EMSchur3DBase ( const ctor_key&  );
158
 
155
 
159
     /** Default protected constructor, use New */
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
     /** Default protected destructor, use Delete */
159
     /** Default protected destructor, use Delete */
163
     virtual ~EMSchur3DBase ( );
160
     virtual ~EMSchur3DBase ( );

+ 2
- 2
src/EMSchur3DBase.cpp View File

56
     //      Method:  EMSchur3DBase
56
     //      Method:  EMSchur3DBase
57
     // Description:  constructor (protected)
57
     // Description:  constructor (protected)
58
     //--------------------------------------------------------------------------------------
58
     //--------------------------------------------------------------------------------------
59
-    EMSchur3DBase::EMSchur3DBase ( ) : LemmaObject( ),
59
+    EMSchur3DBase::EMSchur3DBase ( const ctor_key& key ) : LemmaObject( key ),
60
         Grid(nullptr),
60
         Grid(nullptr),
61
         //Survey(nullptr),
61
         //Survey(nullptr),
62
         LayModel(nullptr), Cvec(nullptr),
62
         LayModel(nullptr), Cvec(nullptr),
69
     //      Method:  EMSchur3DBase
69
     //      Method:  EMSchur3DBase
70
     // Description:  constructor (protected)
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
         Grid(nullptr),
73
         Grid(nullptr),
74
         //Survey(nullptr),
74
         //Survey(nullptr),
75
         LayModel(nullptr), Cvec(nullptr),
75
         LayModel(nullptr), Cvec(nullptr),

Loading…
Cancel
Save