|
@@ -0,0 +1,139 @@
|
|
1
|
+/* This file is part of Lemma, a geophysical modelling and inversion API.
|
|
2
|
+ * More information is available at http://lemmasoftware.org
|
|
3
|
+ */
|
|
4
|
+
|
|
5
|
+/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
6
|
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
7
|
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
8
|
+ */
|
|
9
|
+
|
|
10
|
+/**
|
|
11
|
+ * @file
|
|
12
|
+ * @date 11/11/2016 01:47:25 PM
|
|
13
|
+ * @version $Id$
|
|
14
|
+ * @author Trevor Irons (ti)
|
|
15
|
+ * @email tirons@egi.utah.edu
|
|
16
|
+ * @copyright Copyright (c) 2016, University of Utah
|
|
17
|
+ * @copyright Copyright (c) 2016, Lemma Software, LLC
|
|
18
|
+ */
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+#include "KernelV0.h"
|
|
22
|
+#include "EMEarth1D.h"
|
|
23
|
+#include "FieldPoints.h"
|
|
24
|
+
|
|
25
|
+namespace Lemma {
|
|
26
|
+
|
|
27
|
+ // ==================== FRIEND METHODS =====================
|
|
28
|
+
|
|
29
|
+ std::ostream &operator << (std::ostream &stream, const KernelV0 &ob) {
|
|
30
|
+ stream << ob.Serialize() << "\n---\n"; // End of doc ---
|
|
31
|
+ return stream;
|
|
32
|
+ }
|
|
33
|
+
|
|
34
|
+ // ==================== LIFECYCLE =======================
|
|
35
|
+
|
|
36
|
+ //--------------------------------------------------------------------------------------
|
|
37
|
+ // Class: KernelV0
|
|
38
|
+ // Method: KernelV0
|
|
39
|
+ // Description: constructor (locked)
|
|
40
|
+ //--------------------------------------------------------------------------------------
|
|
41
|
+ KernelV0::KernelV0 (const ctor_key&) : LemmaObject( ) {
|
|
42
|
+
|
|
43
|
+ } // ----- end of method KernelV0::KernelV0 (constructor) -----
|
|
44
|
+
|
|
45
|
+ //--------------------------------------------------------------------------------------
|
|
46
|
+ // Class: KernelV0
|
|
47
|
+ // Method: KernelV0
|
|
48
|
+ // Description: DeSerializing constructor (locked)
|
|
49
|
+ //--------------------------------------------------------------------------------------
|
|
50
|
+ KernelV0::KernelV0 (const YAML::Node& node, const ctor_key&) : LemmaObject(node) {
|
|
51
|
+
|
|
52
|
+ } // ----- end of method KernelV0::KernelV0 (constructor) -----
|
|
53
|
+
|
|
54
|
+ //--------------------------------------------------------------------------------------
|
|
55
|
+ // Class: KernelV0
|
|
56
|
+ // Method: NewSP()
|
|
57
|
+ // Description: public constructor returing a shared_ptr
|
|
58
|
+ //--------------------------------------------------------------------------------------
|
|
59
|
+ std::shared_ptr< KernelV0 > KernelV0::NewSP() {
|
|
60
|
+ return std::make_shared< KernelV0 >( ctor_key() );
|
|
61
|
+ }
|
|
62
|
+
|
|
63
|
+ //--------------------------------------------------------------------------------------
|
|
64
|
+ // Class: KernelV0
|
|
65
|
+ // Method: ~KernelV0
|
|
66
|
+ // Description: destructor (protected)
|
|
67
|
+ //--------------------------------------------------------------------------------------
|
|
68
|
+ KernelV0::~KernelV0 () {
|
|
69
|
+
|
|
70
|
+ } // ----- end of method KernelV0::~KernelV0 (destructor) -----
|
|
71
|
+
|
|
72
|
+ //--------------------------------------------------------------------------------------
|
|
73
|
+ // Class: KernelV0
|
|
74
|
+ // Method: Serialize
|
|
75
|
+ //--------------------------------------------------------------------------------------
|
|
76
|
+ YAML::Node KernelV0::Serialize ( ) const {
|
|
77
|
+ YAML::Node node = LemmaObject::Serialize();
|
|
78
|
+ node.SetTag( GetName() );
|
|
79
|
+
|
|
80
|
+ // Coils Transmitters & Receivers
|
|
81
|
+ for ( auto txm : TxRx) {
|
|
82
|
+ node[txm.first] = txm.second->Serialize();
|
|
83
|
+ }
|
|
84
|
+
|
|
85
|
+ // LayeredEarthEM
|
|
86
|
+ node["SigmaModel"] = SigmaModel->Serialize();
|
|
87
|
+
|
|
88
|
+ return node;
|
|
89
|
+ } // ----- end of method KernelV0::Serialize -----
|
|
90
|
+
|
|
91
|
+ //--------------------------------------------------------------------------------------
|
|
92
|
+ // Class: KernelV0
|
|
93
|
+ // Method: DeSerialize
|
|
94
|
+ //--------------------------------------------------------------------------------------
|
|
95
|
+ std::shared_ptr<KernelV0> KernelV0::DeSerialize ( const YAML::Node& node ) {
|
|
96
|
+ if (node.Tag() != "KernelV0" ) {
|
|
97
|
+ throw DeSerializeTypeMismatch( "KernelV0", node.Tag());
|
|
98
|
+ }
|
|
99
|
+ return std::make_shared< KernelV0 > ( node, ctor_key() );
|
|
100
|
+ } // ----- end of method KernelV0::DeSerialize -----
|
|
101
|
+
|
|
102
|
+ //--------------------------------------------------------------------------------------
|
|
103
|
+ // Class: KernelV0
|
|
104
|
+ // Method: DeSerialize
|
|
105
|
+ //--------------------------------------------------------------------------------------
|
|
106
|
+ void KernelV0::CalculateK0 (const std::vector< std::string>& Tx, const std::vector<std::string >& Rx ) {
|
|
107
|
+
|
|
108
|
+ for (auto tx : Tx) {
|
|
109
|
+ // Set up EMEarth
|
|
110
|
+ auto EmEarth = EMEarth1D::NewSP();
|
|
111
|
+ EmEarth->AttachWireAntenna(TxRx[tx]);
|
|
112
|
+ EmEarth->AttachLayeredEarthEM(SigmaModel);
|
|
113
|
+ EmEarth->SetFieldsToCalculate(H);
|
|
114
|
+ // TODO query for method, altough with flat antennae, this is fastest
|
|
115
|
+ EmEarth->SetHankelTransformMethod(ANDERSON801);
|
|
116
|
+
|
|
117
|
+// EmEarth->AttachFieldPoints(receivers);
|
|
118
|
+// //EmEarth->SetHankelTransformMethod(FHTKEY101);
|
|
119
|
+// EmEarth->CalculateWireAntennaFields();
|
|
120
|
+// Vector3Xcr Rx1 = receivers->GetHfield(0);
|
|
121
|
+// //receivers->ClearFields();
|
|
122
|
+//
|
|
123
|
+// //EmEarth->AttachWireAntenna(Tx2);
|
|
124
|
+// EmEarth->CalculateWireAntennaFields();
|
|
125
|
+// Rx1 += receivers->GetHfield(0);
|
|
126
|
+
|
|
127
|
+ }
|
|
128
|
+
|
|
129
|
+ }
|
|
130
|
+
|
|
131
|
+ void KernelV0::CalculateK0 ( const char* tx, const char* rx ) {
|
|
132
|
+
|
|
133
|
+ }
|
|
134
|
+
|
|
135
|
+} // ---- end of namespace Lemma ----
|
|
136
|
+
|
|
137
|
+/* vim: set tabstop=4 expandtab: */
|
|
138
|
+/* vim: set filetype=cpp: */
|
|
139
|
+
|