|
@@ -0,0 +1,55 @@
|
|
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 12/01/2017 09:38:57 PM
|
|
13
|
+ * @version $Id$
|
|
14
|
+ * @author Trevor Irons (ti)
|
|
15
|
+ * @email tirons@egi.utah.edu
|
|
16
|
+ * @copyright Copyright (c) 2017, University of Utah
|
|
17
|
+ * @copyright Copyright (c) 2017, Trevor Irons & Lemma Software, LLC
|
|
18
|
+ */
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+#include <FDEM1D>
|
|
22
|
+using namespace Lemma;
|
|
23
|
+
|
|
24
|
+int main(int argc, char** argv) {
|
|
25
|
+
|
|
26
|
+ if (argc < 6) {
|
|
27
|
+ std::cout << "Usage:\n";
|
|
28
|
+ std::cout << "CircularLoop <radius> <centreNorthing> <centreEasting>"
|
|
29
|
+ << " <numTurns> <npoints>\n" ;
|
|
30
|
+ exit(EXIT_SUCCESS);
|
|
31
|
+ }
|
|
32
|
+
|
|
33
|
+ Real rad = atof(argv[1]);
|
|
34
|
+ Real cx = atof(argv[2]);
|
|
35
|
+ Real cy = atof(argv[3]);
|
|
36
|
+ int nt = atoi(argv[4]);
|
|
37
|
+ int np = atoi(argv[5]);
|
|
38
|
+ std::cout << rad << std::endl;
|
|
39
|
+
|
|
40
|
+ auto wire = PolygonalWireAntenna::NewSP();
|
|
41
|
+ wire->SetNumberOfPoints(np);
|
|
42
|
+ wire->SetNumberOfTurns(nt);
|
|
43
|
+ Real da = 2.*PI / (Real)(np-1);
|
|
44
|
+ for (int ip=0; ip<np-1; ++ip) {
|
|
45
|
+ wire->SetPoint(ip, cx+rad*std::sin(da*static_cast<Real>(ip)),
|
|
46
|
+ cy+rad*std::cos(da*static_cast<Real>(ip)), -1e-3);
|
|
47
|
+ }
|
|
48
|
+ wire->SetPoint(np-1, cx, cy+rad, -1e-3);
|
|
49
|
+
|
|
50
|
+ std::cout << *wire << std::endl;
|
|
51
|
+
|
|
52
|
+ //auto wire2 = wire->Clone();
|
|
53
|
+ //std::cout << "copy\n" << *wire2 << std::endl;
|
|
54
|
+}
|
|
55
|
+
|