Parcourir la source

LayeredEarthEM works with partial serialization now

submodule
Trevor Irons il y a 7 ans
Parent
révision
67b2f4ffbe

+ 2
- 0
Modules/FDEM1D/include/FDEM1D Voir le fichier

@@ -9,6 +9,8 @@
9 9
 
10 10
 #include "EMEarth1D.h"
11 11
 
12
+//#include "AEMSurvey.h"
13
+
12 14
 // internal
13 15
 //#include "KernelEM1DManager.h"
14 16
 //#include "KernelEM1DSpec.h"

+ 35
- 15
Modules/FDEM1D/src/LayeredEarthEM.cpp Voir le fichier

@@ -26,21 +26,41 @@ namespace Lemma {
26 26
     }
27 27
 
28 28
     LayeredEarthEM::LayeredEarthEM( const YAML::Node& node, const ctor_key& ) : LayeredEarth(node) {
29
-
30
-        LayerConductivity = node["LayerConductivity"].as<VectorXcr>();
31
-
32
-        LayerSusceptibility = node["LayerSusceptibility"].as<VectorXcr>();
33
-        LayerLowFreqSusceptibility = node["LayerLowFreqSusceptibility"].as<VectorXr>();
34
-        LayerHighFreqSusceptibility = node["LayerHighFreqSusceptibility"].as<VectorXr>();
35
-        LayerTauSusceptibility = node["LayerTauSusceptibility"].as<VectorXr>();
36
-        LayerBreathSusceptibility = node["LayerBreathSusceptibility"].as<VectorXr>();
37
-
38
-        LayerPermitivity = node["LayerPermitivity"].as<VectorXcr>();
39
-        LayerLowFreqPermitivity = node["LayerLowFreqPermitivity"].as<VectorXr>();
40
-        LayerHighFreqPermitivity = node["LayerHighFreqPermitivity"].as<VectorXr>();
41
-        LayerTauPermitivity = node["LayerTauPermitivity"].as<VectorXr>();
42
-        LayerBreathPermitivity = node["LayerBreathPermitivity"].as<VectorXr>();
43
-
29
+        SetNumberOfLayers(NumberOfLayers);
30
+        LayerThickness = node["LayerThickness"].as<VectorXr>();
31
+        if (node["LayerConductivity"]) {
32
+            LayerConductivity = node["LayerConductivity"].as<VectorXcr>();
33
+        }
34
+        if (node["LayerSusceptibility"]) {
35
+            LayerSusceptibility = node["LayerSusceptibility"].as<VectorXcr>();
36
+        }
37
+        if (node["LayerLowFreqSusceptibility"]) {
38
+            LayerLowFreqSusceptibility = node["LayerLowFreqSusceptibility"].as<VectorXr>();
39
+        }
40
+        if (node["LayerHighFreqSusceptibility"]) {
41
+            LayerHighFreqSusceptibility = node["LayerHighFreqSusceptibility"].as<VectorXr>();
42
+        }
43
+        if (node["LayerTauSusceptibility"]) {
44
+            LayerTauSusceptibility = node["LayerTauSusceptibility"].as<VectorXr>();
45
+        }
46
+        if (node["LayerBreathSusceptibility"]) {
47
+            LayerBreathSusceptibility = node["LayerBreathSusceptibility"].as<VectorXr>();
48
+        }
49
+        if (node["LayerPermitivity"]) {
50
+            LayerPermitivity = node["LayerPermitivity"].as<VectorXcr>();
51
+        }
52
+        if (node["LayerLowFreqPermitivity "]) {
53
+            LayerLowFreqPermitivity = node["LayerLowFreqPermitivity"].as<VectorXr>();
54
+        }
55
+        if (node["LayerHighFreqPermitivity "]) {
56
+            LayerHighFreqPermitivity = node["LayerHighFreqPermitivity"].as<VectorXr>();
57
+        }
58
+        if (node["LayerTauPermitivity"]) {
59
+            LayerTauPermitivity = node["LayerTauPermitivity"].as<VectorXr>();
60
+        }
61
+        if (node["LayerBreathPermitivity"]) {
62
+            LayerBreathPermitivity = node["LayerBreathPermitivity"].as<VectorXr>();
63
+        }
44 64
     }
45 65
 
46 66
     LayeredEarthEM::~LayeredEarthEM() {

+ 1
- 1
Modules/FDEM1D/src/PolygonalWireAntenna.cpp Voir le fichier

@@ -16,7 +16,7 @@
16 16
 namespace Lemma {
17 17
 
18 18
     std::ostream &operator << (std::ostream &stream, const PolygonalWireAntenna &ob) {
19
-        stream << ob.Serialize()  << "\n---\n"; // End of doc --- as a direct stream should encapulste thingy
19
+        stream << ob.Serialize()  << "\n---\n"; // End of doc ---
20 20
         return stream;
21 21
     }
22 22
 

Chargement…
Annuler
Enregistrer