Browse Source

Better file naming

master
T-bone 7 years ago
parent
commit
98f9409ac0
3 changed files with 19 additions and 18 deletions
  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 View File

87
     std::vector<std::string> tx = {std::string("Coil 1"), std::string("Coil 2"), std::string("Coil 3") };
87
     std::vector<std::string> tx = {std::string("Coil 1"), std::string("Coil 2"), std::string("Coil 3") };
88
     //std::vector<std::string> rx = {std::string("Coil 1"), std::string("Coil 2")};//, std::string("Coil 3") };
88
     //std::vector<std::string> rx = {std::string("Coil 1"), std::string("Coil 2")};//, std::string("Coil 3") };
89
     std::vector<std::string> rx = {std::string(argv[3])};
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
     Kern->CalculateK0( tx, rx, false );
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
     dout << "# Transmitters: ";
93
     dout << "# Transmitters: ";
98
     for (auto lp : tx) {
94
     for (auto lp : tx) {
99
         dout << lp << "\t";
95
         dout << lp << "\t";
113
         dout << Kern->GetKernel().imag() << std::endl;
109
         dout << Kern->GetKernel().imag() << std::endl;
114
         dout.close();
110
         dout.close();
115
 
111
 
116
-<<<<<<< HEAD
117
     //std::ofstream out = std::ofstream(std::string("k0-3Tx-RxCh1-")+std::string(argv[1])+std::string(".yaml"));
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
     std::ofstream out = std::ofstream(std::string("k0-3Tx-RxCh-") + std::string(argv[3]) + std::string("-tol") + std::string(argv[1])+ std::string(".yaml"));
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
     out << *Kern;
114
     out << *Kern;
124
     out.close();
115
     out.close();
125
 }
116
 }

+ 17
- 7
examples/KernelV0-2.cpp View File

42
         Kern->SetLayeredEarthEM( earth );
42
         Kern->SetLayeredEarthEM( earth );
43
 
43
 
44
         Kern->SetIntegrationSize( (Vector3r() << 200,200,200).finished() );
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
 //         Kern->AlignWithAkvoDataset( YAML::LoadFile(argv[2]) );
49
 //         Kern->AlignWithAkvoDataset( YAML::LoadFile(argv[2]) );
49
 
50
 
62
         Kern->SetPulseCurrent( I ); // nbins, low, high
63
         Kern->SetPulseCurrent( I ); // nbins, low, high
63
 
64
 
64
         //VectorXr interfaces = VectorXr::LinSpaced( 41, .5, 45.5 ); // nlay, low, high
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
         Real thick = .5;
67
         Real thick = .5;
67
         for (int ilay=1; ilay<interfaces.size(); ++ilay) {
68
         for (int ilay=1; ilay<interfaces.size(); ++ilay) {
68
             interfaces(ilay) = interfaces(ilay-1) + thick;
69
             interfaces(ilay) = interfaces(ilay-1) + thick;
74
     // may be more natural to work with?
75
     // may be more natural to work with?
75
     std::vector<std::string> tx = {std::string("Coil 1")};
76
     std::vector<std::string> tx = {std::string("Coil 1")};
76
     std::vector<std::string> rx = {std::string("Coil 2")};
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
         dout << interfaces.transpose() << std::endl;
91
         dout << interfaces.transpose() << std::endl;
82
         dout << I.transpose() << std::endl;
92
         dout << I.transpose() << std::endl;
83
         dout << "#real\n";
93
         dout << "#real\n";
86
         dout << Kern->GetKernel().imag() << std::endl;
96
         dout << Kern->GetKernel().imag() << std::endl;
87
         dout.close();
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
     //std::ofstream out = std::ofstream(std::string("k-coincident.yaml"));
100
     //std::ofstream out = std::ofstream(std::string("k-coincident.yaml"));
91
     out << *Kern;
101
     out << *Kern;
92
     out.close();
102
     out.close();

+ 1
- 1
examples/KernelV0.cpp View File

32
 		earth->SetLayerThickness( (VectorXr(1) << 10).finished() );
32
 		earth->SetLayerThickness( (VectorXr(1) << 10).finished() );
33
         // Set mag field info
33
         // Set mag field info
34
         // From NOAA, Laramie WY, June 9 2016, aligned with mag. north
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
     // Transmitter loops
37
     // Transmitter loops
38
     auto Tx1 = CircularLoop(21, 15, 100, 100);
38
     auto Tx1 = CircularLoop(21, 15, 100, 100);

Loading…
Cancel
Save