|
@@ -0,0 +1,123 @@
|
|
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 03/21/2016 02:10:08 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
|
+#include "LinearMag.h"
|
|
21
|
+
|
|
22
|
+namespace Lemma {
|
|
23
|
+
|
|
24
|
+// ==================== FRIEND METHODS =====================
|
|
25
|
+#ifdef HAVE_YAMLCPP
|
|
26
|
+std::ostream &operator << (std::ostream &stream, const LinearMag &ob) {
|
|
27
|
+ stream << ob.Serialize() << "\n---\n"; // End of doc --- as a direct stream should encapsulate thingy
|
|
28
|
+ return stream;
|
|
29
|
+}
|
|
30
|
+#else
|
|
31
|
+std::ostream &operator<<(std::ostream &stream, const LinearMag& ob) {
|
|
32
|
+ stream << *(FEM4EllipticPDE*)(&ob);
|
|
33
|
+ return stream;
|
|
34
|
+}
|
|
35
|
+#endif
|
|
36
|
+
|
|
37
|
+// ==================== LIFECYCLE =======================
|
|
38
|
+
|
|
39
|
+//--------------------------------------------------------------------------------------
|
|
40
|
+// Class: LinearMag
|
|
41
|
+// Method: LinearMag
|
|
42
|
+// Description: constructor (protected)
|
|
43
|
+//--------------------------------------------------------------------------------------
|
|
44
|
+LinearMag::LinearMag (const std::string& name) : FEM4EllipticPDE(name) {
|
|
45
|
+
|
|
46
|
+} // ----- end of method LinearMag::LinearMag (constructor) -----
|
|
47
|
+
|
|
48
|
+#ifdef HAVE_YAMLCPP
|
|
49
|
+//--------------------------------------------------------------------------------------
|
|
50
|
+// Class: LinearMag
|
|
51
|
+// Method: LinearMag
|
|
52
|
+// Description: DeSerializing constructor (protected)
|
|
53
|
+//--------------------------------------------------------------------------------------
|
|
54
|
+LinearMag::LinearMag (const YAML::Node& node) : FEM4EllipticPDE(node) {
|
|
55
|
+
|
|
56
|
+} // ----- end of method LinearMag::LinearMag (constructor) -----
|
|
57
|
+#endif
|
|
58
|
+
|
|
59
|
+//--------------------------------------------------------------------------------------
|
|
60
|
+// Class: LinearMag
|
|
61
|
+// Method: New()
|
|
62
|
+// Description: public constructor
|
|
63
|
+//--------------------------------------------------------------------------------------
|
|
64
|
+LinearMag* LinearMag::New() {
|
|
65
|
+ LinearMag* Obj = new LinearMag("LinearMag");
|
|
66
|
+ Obj->AttachTo(Obj);
|
|
67
|
+ return Obj;
|
|
68
|
+}
|
|
69
|
+
|
|
70
|
+//--------------------------------------------------------------------------------------
|
|
71
|
+// Class: LinearMag
|
|
72
|
+// Method: ~LinearMag
|
|
73
|
+// Description: destructor (protected)
|
|
74
|
+//--------------------------------------------------------------------------------------
|
|
75
|
+LinearMag::~LinearMag () {
|
|
76
|
+
|
|
77
|
+} // ----- end of method LinearMag::~LinearMag (destructor) -----
|
|
78
|
+
|
|
79
|
+//--------------------------------------------------------------------------------------
|
|
80
|
+// Class: LinearMag
|
|
81
|
+// Method: Delete
|
|
82
|
+// Description: public destructor
|
|
83
|
+//--------------------------------------------------------------------------------------
|
|
84
|
+void LinearMag::Delete() {
|
|
85
|
+ this->DetachFrom(this);
|
|
86
|
+}
|
|
87
|
+
|
|
88
|
+//--------------------------------------------------------------------------------------
|
|
89
|
+// Class: LinearMag
|
|
90
|
+// Method: Release
|
|
91
|
+// Description: destructor (protected)
|
|
92
|
+//--------------------------------------------------------------------------------------
|
|
93
|
+void LinearMag::Release() {
|
|
94
|
+ delete this;
|
|
95
|
+}
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+#ifdef HAVE_YAMLCPP
|
|
99
|
+//--------------------------------------------------------------------------------------
|
|
100
|
+// Class: LinearMag
|
|
101
|
+// Method: Serialize
|
|
102
|
+//--------------------------------------------------------------------------------------
|
|
103
|
+YAML::Node LinearMag::Serialize ( ) const {
|
|
104
|
+ YAML::Node node = FEM4EllipticPDE::Serialize();;
|
|
105
|
+ node.SetTag( this->Name );
|
|
106
|
+ // FILL IN CLASS SPECIFICS HERE
|
|
107
|
+ return node;
|
|
108
|
+} // ----- end of method LinearMag::Serialize -----
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+//--------------------------------------------------------------------------------------
|
|
112
|
+// Class: LinearMag
|
|
113
|
+// Method: DeSerialize
|
|
114
|
+//--------------------------------------------------------------------------------------
|
|
115
|
+LinearMag* LinearMag::DeSerialize ( const YAML::Node& node ) {
|
|
116
|
+ LinearMag* Object = new LinearMag(node);
|
|
117
|
+ Object->AttachTo(Object);
|
|
118
|
+ DESERIALIZECHECK( node, Object )
|
|
119
|
+ return Object ;
|
|
120
|
+} // ----- end of method LinearMag::DeSerialize -----
|
|
121
|
+#endif
|
|
122
|
+
|
|
123
|
+} // ----- end of Lemma name -----
|