Pārlūkot izejas kodu

Better file naming

master
T-bone 7 gadus atpakaļ
vecāks
revīzija
98f9409ac0
3 mainītis faili ar 19 papildinājumiem un 18 dzēšanām
  1. 1
    10
      examples/KV0-3loops.cpp
  2. 17
    7
      examples/KernelV0-2.cpp
  3. 1
    1
      examples/KernelV0.cpp

+ 1
- 10
examples/KV0-3loops.cpp Parādīt failu

@@ -87,13 +87,9 @@ int main(int argc, char** argv) {
87 87
     std::vector<std::string> tx = {std::string("Coil 1"), std::string("Coil 2"), std::string("Coil 3") };
88 88
     //std::vector<std::string> rx = {std::string("Coil 1"), std::string("Coil 2")};//, std::string("Coil 3") };
89 89
     std::vector<std::string> rx = {std::string(argv[3])};
90
-    //std::vector<std::string> rx = {std::string("Coil 1"), std::string("Coil 2"), std::string("Coil 3") };
91
-    //std::vector<std::string> rx = {std::string("Coil 1"), std::string("Coil 2")};//, std::string("Coil 3") };
92
-    std::vector<std::string> rx = {std::string(argv[3])};
93 90
     Kern->CalculateK0( tx, rx, false );
94 91
 
95
-    //std::ofstream dout = std::ofstream(std::string("k0-3Tx-RxCh-") + std::string(argv[3]) + std::string("-tol") + std::string(argv[1])+ std::string(".dat"));
96
-    std::ofstream dout = std::ofstream(std::string("k0-3Tx-RxCh-13") + std::string("-off-") + std::string(argv[1])+ std::string(".dat"));
92
+    std::ofstream dout = std::ofstream(std::string("k0-3Tx-RxCh-") + std::string(argv[3]) + std::string("-tol") + std::string(argv[1])+ std::string(".dat"));
97 93
     dout << "# Transmitters: ";
98 94
     for (auto lp : tx) {
99 95
         dout << lp << "\t";
@@ -113,13 +109,8 @@ int main(int argc, char** argv) {
113 109
         dout << Kern->GetKernel().imag() << std::endl;
114 110
         dout.close();
115 111
 
116
-<<<<<<< HEAD
117 112
     //std::ofstream out = std::ofstream(std::string("k0-3Tx-RxCh1-")+std::string(argv[1])+std::string(".yaml"));
118
-    std::ofstream out = std::ofstream(std::string("k0-3Tx-RxCh-13") + std::string("-off-") + std::string(argv[1])+ std::string(".yaml"));
119
-    //std::ofstream out = std::ofstream(std::string("k-coincident.yaml"));
120
-=======
121 113
     std::ofstream out = std::ofstream(std::string("k0-3Tx-RxCh-") + std::string(argv[3]) + std::string("-tol") + std::string(argv[1])+ std::string(".yaml"));
122
->>>>>>> 241215b41d033a7d74d572d479d486850b30ffce
123 114
     out << *Kern;
124 115
     out.close();
125 116
 }

+ 17
- 7
examples/KernelV0-2.cpp Parādīt failu

@@ -42,8 +42,9 @@ int main(int argc, char** argv) {
42 42
         Kern->SetLayeredEarthEM( earth );
43 43
 
44 44
         Kern->SetIntegrationSize( (Vector3r() << 200,200,200).finished() );
45
-        Kern->SetIntegrationOrigin( (Vector3r() << 0,0,0).finished() );
46
-        Kern->SetTolerance( 1e-10 ); // 1e-12
45
+        Kern->SetIntegrationOrigin( (Vector3r() << -100, -100, .5).finished() );
46
+        Real tol(1e-9);
47
+        Kern->SetTolerance( tol ); // 1e-12
47 48
 
48 49
 //         Kern->AlignWithAkvoDataset( YAML::LoadFile(argv[2]) );
49 50
 
@@ -62,7 +63,7 @@ int main(int argc, char** argv) {
62 63
         Kern->SetPulseCurrent( I ); // nbins, low, high
63 64
 
64 65
         //VectorXr interfaces = VectorXr::LinSpaced( 41, .5, 45.5 ); // nlay, low, high
65
-        VectorXr interfaces = VectorXr::LinSpaced( 51, .5, 45.5 ); // nlay, low, high
66
+        VectorXr interfaces = VectorXr::LinSpaced( 61, .5, 45.5 ); // nlay, low, high
66 67
         Real thick = .5;
67 68
         for (int ilay=1; ilay<interfaces.size(); ++ilay) {
68 69
             interfaces(ilay) = interfaces(ilay-1) + thick;
@@ -74,10 +75,19 @@ int main(int argc, char** argv) {
74 75
     // may be more natural to work with?
75 76
     std::vector<std::string> tx = {std::string("Coil 1")};
76 77
     std::vector<std::string> rx = {std::string("Coil 2")};
77
-    Kern->CalculateK0( tx, rx, false );
78
+    Kern->CalculateK0( tx, rx, false ); // 3rd argument is vtk output
79
+
80
+    std::ofstream dout = std::ofstream(std::string("Rx-")+std::string(argv[3])+std::string(".dat"));
81
+    dout << "# Transmitters: ";
82
+    for (auto lp : tx) {
83
+        dout << lp << "\t";
84
+    }
85
+    dout << "\n# Receivers: ";
86
+    for (auto lp : rx) {
87
+        dout << lp << "\t";
88
+    }
89
+    dout << "\n# Tolerance: " << tol << std::endl;
78 90
 
79
-    std::ofstream dout = std::ofstream(std::string("test-")+ std::string(argv[1])+ std::string(".dat"));
80
-    //std::ofstream dout = std::ofstream(std::string("k-coincident.dat"));
81 91
         dout << interfaces.transpose() << std::endl;
82 92
         dout << I.transpose() << std::endl;
83 93
         dout << "#real\n";
@@ -86,7 +96,7 @@ int main(int argc, char** argv) {
86 96
         dout << Kern->GetKernel().imag() << std::endl;
87 97
         dout.close();
88 98
 
89
-    std::ofstream out = std::ofstream(std::string("test-")+std::string(argv[1])+std::string(".yaml"));
99
+    std::ofstream out = std::ofstream(std::string("Rx-")+std::string(argv[2])+std::string(".yaml"));
90 100
     //std::ofstream out = std::ofstream(std::string("k-coincident.yaml"));
91 101
     out << *Kern;
92 102
     out.close();

+ 1
- 1
examples/KernelV0.cpp Parādīt failu

@@ -32,7 +32,7 @@ int main(int argc, char** argv) {
32 32
 		earth->SetLayerThickness( (VectorXr(1) << 10).finished() );
33 33
         // Set mag field info
34 34
         // From NOAA, Laramie WY, June 9 2016, aligned with mag. north
35
-        earth->SetMagneticFieldIncDecMag( 67, 0, 52750, NANOTESLA );
35
+        earth->SetMagneticFieldIncDecMag( 67, 9, 52750, NANOTESLA );
36 36
 
37 37
     // Transmitter loops
38 38
     auto Tx1 = CircularLoop(21, 15, 100, 100);

Notiek ielāde…
Atcelt
Saglabāt