|
@@ -22,8 +22,8 @@ using namespace Lemma;
|
22
|
22
|
|
23
|
23
|
static constexpr Real GAMMA = 2.67518e8; // MKS units
|
24
|
24
|
|
25
|
|
-std::shared_ptr<PolygonalWireAntenna> CircularLoop ( int nd, Real radius, Real Offsetx, Real Offsety, Real wL ) ;
|
26
|
|
-void MoveLoop( std::shared_ptr<PolygonalWireAntenna> Loop, int nd, Real Radius, Real Offsetx, Real Offsety, Real wL );
|
|
25
|
+std::shared_ptr<PolygonalWireAntenna> CircularLoop ( int nd, Real Radius, Real Offsetx, Real Offsety, Real wL, Real pol=1. ) ;
|
|
26
|
+void MoveLoop( std::shared_ptr<PolygonalWireAntenna> Loop, int nd, Real Radius, Real Offsetx, Real Offsety, Real wL, Real pol=1. );
|
27
|
27
|
|
28
|
28
|
int main(int argc, char** argv) {
|
29
|
29
|
/*
|
|
@@ -50,8 +50,8 @@ int main(int argc, char** argv) {
|
50
|
50
|
Real Larmor = earth->GetMagneticFieldMagnitude()*GAMMA/(2*PI);
|
51
|
51
|
|
52
|
52
|
// Transmitter loops
|
53
|
|
- auto Tx1 = CircularLoop(21, 15, 50, 50, Larmor);
|
54
|
|
- auto Tx2 = CircularLoop(21, 15, 50, 50, Larmor); // initially coincident
|
|
53
|
+ auto Tx1 = CircularLoop(21, 15, 50, 50, Larmor, 1);
|
|
54
|
+ auto Tx2 = CircularLoop(21, 15, 50, 50, Larmor, -1); // initially coincident
|
55
|
55
|
|
56
|
56
|
auto Kern = LoopInteractions<INTERFERENCE>::NewSP();
|
57
|
57
|
Kern->PushCoil( "Coil 1", Tx1 );
|
|
@@ -59,16 +59,16 @@ int main(int argc, char** argv) {
|
59
|
59
|
Kern->SetLayeredEarthEM( earth );
|
60
|
60
|
|
61
|
61
|
Kern->SetIntegrationSize( (Vector3r() << 50,200,50).finished() );
|
62
|
|
- Kern->SetIntegrationOrigin( (Vector3r() << 0,0,5.0).finished() );
|
63
|
|
- Kern->SetTolerance( 1e-3 ); // 1e-12
|
|
62
|
+ Kern->SetIntegrationOrigin( (Vector3r() << 0, 0, 0.1).finished() );
|
|
63
|
+ Kern->SetTolerance( 1e-5 ); // 1e-12
|
64
|
64
|
|
65
|
65
|
std::vector<std::string> tx = {std::string("Coil 1")};//,std::string("Coil 2")};
|
66
|
66
|
std::vector<std::string> rx = {std::string("Coil 2")};
|
67
|
67
|
VectorXr Offsets = VectorXr::LinSpaced(61, 0.00, 60.0); // nbins, low, high
|
68
|
68
|
|
69
|
|
- auto outfile = std::ofstream("interference.dat");
|
|
69
|
+ auto outfile = std::ofstream("interference-opposed.dat");
|
70
|
70
|
for (int ii=0; ii< Offsets.size(); ++ii) {
|
71
|
|
- MoveLoop(Tx2, 21, 15, 50, 50 + Offsets(ii), Larmor);
|
|
71
|
+ MoveLoop(Tx2, 21, 15, 50, 50 + Offsets(ii), Larmor, -1.);
|
72
|
72
|
#ifdef LEMMAUSEVTK
|
73
|
73
|
Complex coupling = Kern->Calculate( tx, rx, true );
|
74
|
74
|
#else
|
|
@@ -80,7 +80,7 @@ int main(int argc, char** argv) {
|
80
|
80
|
outfile.close();
|
81
|
81
|
}
|
82
|
82
|
|
83
|
|
-std::shared_ptr<Lemma::PolygonalWireAntenna> CircularLoop ( int nd, Real Radius, Real Offsetx, Real Offsety, Real wL ) {
|
|
83
|
+std::shared_ptr<Lemma::PolygonalWireAntenna> CircularLoop ( int nd, Real Radius, Real Offsetx, Real Offsety, Real wL, Real pol ) {
|
84
|
84
|
|
85
|
85
|
auto Tx1 = Lemma::PolygonalWireAntenna::NewSP();
|
86
|
86
|
Tx1->SetNumberOfPoints(nd);
|
|
@@ -88,7 +88,7 @@ std::shared_ptr<Lemma::PolygonalWireAntenna> CircularLoop ( int nd, Real Radius,
|
88
|
88
|
VectorXr range = VectorXr::LinSpaced(nd, 0, 2*PI);
|
89
|
89
|
int ii;
|
90
|
90
|
for (ii=0; ii<nd; ++ii) {
|
91
|
|
- Tx1->SetPoint(ii, Vector3r(Offsetx+Radius*std::cos(range(ii)), Offsety+Radius*std::sin(range(ii)), -1e-3));
|
|
91
|
+ Tx1->SetPoint(ii, Vector3r(Offsetx+Radius*std::cos(range(ii)), Offsety+pol*Radius*std::sin(range(ii)), -1e-3));
|
92
|
92
|
}
|
93
|
93
|
|
94
|
94
|
Tx1->SetCurrent(1.);
|
|
@@ -99,14 +99,14 @@ std::shared_ptr<Lemma::PolygonalWireAntenna> CircularLoop ( int nd, Real Radius,
|
99
|
99
|
return Tx1;
|
100
|
100
|
}
|
101
|
101
|
|
102
|
|
-void MoveLoop( std::shared_ptr<Lemma::PolygonalWireAntenna> Tx1, int nd, Real Radius, Real Offsetx, Real Offsety, Real wL ) {
|
|
102
|
+void MoveLoop( std::shared_ptr<Lemma::PolygonalWireAntenna> Tx1, int nd, Real Radius, Real Offsetx, Real Offsety, Real wL, Real pol ) {
|
103
|
103
|
|
104
|
104
|
Tx1->SetNumberOfPoints(nd);
|
105
|
105
|
|
106
|
106
|
VectorXr range = VectorXr::LinSpaced(nd, 0, 2*PI);
|
107
|
107
|
int ii;
|
108
|
108
|
for (ii=0; ii<nd; ++ii) {
|
109
|
|
- Tx1->SetPoint(ii, Vector3r(Offsetx+Radius*std::cos(range(ii)), Offsety+Radius*std::sin(range(ii)), -1e-3));
|
|
109
|
+ Tx1->SetPoint(ii, Vector3r(Offsetx+Radius*std::cos(range(ii)), Offsety+pol*Radius*std::sin(range(ii)), -1e-3));
|
110
|
110
|
}
|
111
|
111
|
|
112
|
112
|
Tx1->SetCurrent(1.);
|