|
@@ -0,0 +1,108 @@
|
|
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 22/04/19 14:06:32
|
|
13
|
+ * @version $Id$
|
|
14
|
+ * @author Trevor Irons (ti)
|
|
15
|
+ * @email Trevor.Irons@utah.edu
|
|
16
|
+ * @copyright Copyright (c) 2019, University of Utah
|
|
17
|
+ * @copyright Copyright (c) 2019, Lemma Software, LLC
|
|
18
|
+ */
|
|
19
|
+
|
|
20
|
+#include <pybind11/pybind11.h>
|
|
21
|
+#include <pybind11/iostream.h>
|
|
22
|
+#include <pybind11/eigen.h>
|
|
23
|
+#include "FDEM1D"
|
|
24
|
+
|
|
25
|
+namespace py = pybind11;
|
|
26
|
+
|
|
27
|
+PYBIND11_MODULE(pyFDEM1D, m) {
|
|
28
|
+
|
|
29
|
+ py::add_ostream_redirect(m, "ostream_redirect");
|
|
30
|
+
|
|
31
|
+ m.doc() = "Python binding of Lemma::FDEM1D, additional details can be found at https://lemmasoftware.org";
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+ py::class_<Lemma::WireAntenna, std::shared_ptr<Lemma::WireAntenna> > WireAntenna(m, "WireAntenna"); //, py::dynamic_attr());
|
|
35
|
+
|
|
36
|
+ // lifecycle
|
|
37
|
+ WireAntenna.def(py::init(&Lemma::WireAntenna::NewSP))
|
|
38
|
+
|
|
39
|
+ // print
|
|
40
|
+ .def("__repr__", &Lemma::WireAntenna::Print)
|
|
41
|
+ .def("Serialize", &Lemma::WireAntenna::Print, "YAML representation of the class")
|
|
42
|
+ .def_static("DeSerialize", py::overload_cast<const std::string&>(&Lemma::WireAntenna::DeSerialize), "Construct object from yaml representation")
|
|
43
|
+
|
|
44
|
+ // modifiers
|
|
45
|
+ .def("SetNumberOfPoints", &Lemma::WireAntenna::SetNumberOfPoints, "Sets the number of points comprising the antenna")
|
|
46
|
+ .def("SetPoint", py::overload_cast<const int&, const Lemma::Real&, const Lemma::Real&, const Lemma::Real&>(&Lemma::WireAntenna::SetPoint), "Sets a point in the antenna")
|
|
47
|
+ .def("SetPoint", py::overload_cast<const int&, const Lemma::Vector3r&>(&Lemma::WireAntenna::SetPoint), "Sets a point in the antenna")
|
|
48
|
+ .def("SetNumberOfTurns", &Lemma::WireAntenna::SetNumberOfTurns, "Sets the number of turns of the antenna")
|
|
49
|
+ .def("SetNumberOfFrequencies", &Lemma::WireAntenna::SetNumberOfFrequencies, "Sets the number of frequencies of the transmitter")
|
|
50
|
+ .def("SetFrequency", &Lemma::WireAntenna::SetFrequency, "Sets a single frequency of the transmitter")
|
|
51
|
+ .def("SetCurrent", &Lemma::WireAntenna::SetCurrent, "Sets the current of the transmitter in amps")
|
|
52
|
+
|
|
53
|
+ // accessors
|
|
54
|
+ .def("GetCurrent", &Lemma::WireAntenna::GetCurrent, "Returns the current of the transmitter in amps")
|
|
55
|
+ .def("GetPoints", &Lemma::WireAntenna::GetPoints, "Returns the points defining the transmitter")
|
|
56
|
+ .def("GetNumberOfDipoles", &Lemma::WireAntenna::GetNumberOfDipoles, "Returns the number of dipoles defining the transmitter")
|
|
57
|
+ .def("GetNumberOfFrequencies", &Lemma::WireAntenna::GetNumberOfFrequencies, "Returns the number of frequencies for the transmitter")
|
|
58
|
+ .def("IsHorizontallyPlanar", &Lemma::WireAntenna::IsHorizontallyPlanar, "Returns true if the transmitter is flat")
|
|
59
|
+ .def("GetName", &Lemma::WireAntenna::GetName, "Returns the class name of the object")
|
|
60
|
+
|
|
61
|
+ // operations
|
|
62
|
+ .def("ApproximateWithElectricDipoles", &Lemma::WireAntenna::ApproximateWithElectricDipoles, "Approximates loop with electric dipoles")
|
|
63
|
+
|
|
64
|
+ ;
|
|
65
|
+
|
|
66
|
+ py::class_<Lemma::PolygonalWireAntenna, std::shared_ptr<Lemma::PolygonalWireAntenna> > PolygonalWireAntenna(m, "PolygonalWireAntenna", WireAntenna); //, py::dynamic_attr())
|
|
67
|
+
|
|
68
|
+ // lifecycle
|
|
69
|
+ PolygonalWireAntenna.def(py::init(&Lemma::PolygonalWireAntenna::NewSP))
|
|
70
|
+
|
|
71
|
+ // print
|
|
72
|
+ .def("__repr__", &Lemma::PolygonalWireAntenna::Print)
|
|
73
|
+ .def("Serialize", &Lemma::PolygonalWireAntenna::Print, "YAML representation of the class")
|
|
74
|
+
|
|
75
|
+ // accessors
|
|
76
|
+ .def("GetName", &Lemma::PolygonalWireAntenna::GetName, "Returns the name of the class")
|
|
77
|
+
|
|
78
|
+ // modifiers
|
|
79
|
+ //.def("SetNumberOfPoints", &Lemma::WireAntenna::SetNumberOfPoints, "Sets the number of points comprising the antenna")
|
|
80
|
+
|
|
81
|
+ // operations
|
|
82
|
+ .def("ApproximateWithElectricDipoles", &Lemma::PolygonalWireAntenna::ApproximateWithElectricDipoles, "Approximates loop with series of electric dipoles around loop")
|
|
83
|
+
|
|
84
|
+ ;
|
|
85
|
+
|
|
86
|
+}
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+/*
|
|
90
|
+BOOST_PYTHON_MODULE(pyLemmaCore)
|
|
91
|
+{
|
|
92
|
+ Py_Initialize();
|
|
93
|
+ np::initialize();
|
|
94
|
+
|
|
95
|
+ bp::class_<Lemma::PolygonalWireAntenna, boost::noncopyable> ("PolygonalWireAntenna", boost::python::no_init)
|
|
96
|
+
|
|
97
|
+ // print
|
|
98
|
+ .def(boost::python::self_ns::str(bp::self))
|
|
99
|
+
|
|
100
|
+ // Lifecycle
|
|
101
|
+ .def("__init__", boost::python::make_constructor(&Lemma::PolygonalWireAntenna::NewSP))
|
|
102
|
+ //.def("Serialize", &Lemma::PolygonalWireAntenna::Serialize)
|
|
103
|
+ //.def("DeSerialize", &Lemma::PolygonalWireAntenna::DeSerialize)
|
|
104
|
+
|
|
105
|
+ // Accessors
|
|
106
|
+ ;
|
|
107
|
+}
|
|
108
|
+*/
|