Parcourir la source

Timing and comparison work.

pull/2/head
Trevor Irons il y a 5 ans
Parent
révision
f3ecc70824

+ 5
- 0
Modules/FDEM1D/examples/CMakeLists.txt Voir le fichier

@@ -26,6 +26,10 @@ add_executable( Hantenna Hantenna.cpp  )
26 26
 target_link_libraries(  Hantenna  "lemmacore" "fdem1d")
27 27
 set_property(TARGET Hantenna PROPERTY CXX_STANDARD 14)
28 28
 
29
+add_executable( Eantenna Eantenna.cpp  )
30
+target_link_libraries(  Eantenna  "lemmacore" "fdem1d")
31
+set_property(TARGET Eantenna PROPERTY CXX_STANDARD 14)
32
+
29 33
 add_executable( DipoleSource DipoleSource.cpp  )
30 34
 target_link_libraries(  DipoleSource  "lemmacore" "fdem1d")
31 35
 set_property(TARGET DipoleSource PROPERTY CXX_STANDARD 14)
@@ -37,6 +41,7 @@ INSTALL_TARGETS( "/share/FDEM1D/"
37 41
 	EMDipEarth1D
38 42
     CircularLoop
39 43
 	Hantenna
44
+	Eantenna
40 45
 	DipoleSource
41 46
 )
42 47
 

+ 4
- 2
Modules/FDEM1D/examples/EMDipEarth1D.cpp Voir le fichier

@@ -45,7 +45,7 @@ int main() {
45 45
 		dipole->SetFrequency(0, 4400.1000);
46 46
 		//dipole->SetPhase(0);
47 47
 		//dipole->SetLocation( (VectorXr(3) << 49, 49, -1e-4).finished() );
48
-		dipole->SetLocation( 0, 0, -1e-4  );
48
+		dipole->SetLocation( 49, 49, -1e-4  );
49 49
 
50 50
 
51 51
 	// Define model
@@ -74,7 +74,7 @@ int main() {
74 74
 		int ir = 0;
75 75
 		for (int iz=0; iz<nz; ++iz) {
76 76
 			loc << ox, oy, depth;
77
-            std::cout << "Receiver location " << loc.transpose() << std::endl;
77
+            //std::cout << "Receiver location " << loc.transpose() << std::endl;
78 78
 			receivers->SetLocation(ir, loc);
79 79
 			depth += dz;
80 80
 			++ ir;
@@ -93,6 +93,8 @@ int main() {
93 93
 //         //for
94 94
 // 	    receivers->SetLocation(0, ox, oy, depth);
95 95
 
96
+    std::cout << "Dipole location " << dipole->GetLocation( ).transpose() << "\n";
97
+    std::cout << "Receiver location " << receivers->GetLocation(0).transpose() << "\n";
96 98
 
97 99
 	std::cout << "C++\n";
98 100
 	EmEarth->MakeCalc3();

+ 2
- 2
Modules/FDEM1D/examples/Hantenna.cpp Voir le fichier

@@ -197,14 +197,14 @@ const char *buildString = __DATE__ ", " __TIME__;
197 197
     //hreal << *earth << std::endl;
198 198
 
199 199
     hreal << "// Right hand coordinate system, z is positive down\n";
200
-    hreal << "// x[m]\ty[m]\tz[m]\tHx[A/m]\tHy[A/m]\tHz[A/m]\n";
200
+    hreal << "// x[m]\ty[m]\tz[m]\tRe(Hx[A/m])\tRe(Hy[A/m])\tRe(Hz[A/m])\tIm(Hx)\tIm(Hy)\tIm(Hz)\n";
201 201
     hreal.precision(8);
202 202
     int i=0;
203 203
 	for (int iz=0; iz<nz; ++iz) {
204 204
 	for (int iy=0; iy<ny; ++iy) {
205 205
 	for (int ix=0; ix<nx; ++ix) {
206 206
         hreal << receivers->GetLocation(i).transpose() << "\t";
207
- 		//hreal << receivers->GetHfield(0, i).transpose() << "\n"; ( complex, notation )
207
+ 		//hreal << receivers->GetHfield(0, i).transpose() << "\n"; // ( complex, notation )
208 208
  		hreal << receivers->GetHfield(0, i).transpose().real() << "\t";
209 209
  		hreal << receivers->GetHfield(0, i).transpose().imag() << "\n";
210 210
         ++i;

+ 3
- 0
Modules/FDEM1D/examples/plottimings.py Voir le fichier

@@ -65,5 +65,8 @@ leg = plt.legend()
65 65
 deSpine(plt.gca())
66 66
 fixLeg(leg)
67 67
 
68
+plt.gca().set_xlabel("OMP_NUM_THREADS")
69
+plt.gca().set_ylabel("execution time (s)")
70
+
68 71
 plt.savefig("timings.png")
69 72
 plt.show()

+ 6
- 6
Modules/FDEM1D/testing/BenchKiHa.h Voir le fichier

@@ -59,15 +59,15 @@ public:
59 59
 		dipole->SetLocation( 0, 0, -1e-4  );
60 60
 
61 61
 	    // Define model
62
-	    VectorXcr sigma(2);
63
-		sigma << 0., 1e-3;//, .1;//, .01, .001;
64
-	    VectorXr  thick(1);
65
-		thick << 10;//, 10, 10;
62
+	    VectorXcr sigma(8);
63
+		sigma << 0., 1e-2, .1, .01, .001, .1, .05, .2;
64
+	    VectorXr  thick(6);
65
+		thick << 10, 10, 10, 10, 10;
66 66
 
67 67
 	    earth = LayeredEarthEM::NewSP();
68
-        earth->SetNumberOfLayers(2);
68
+        earth->SetNumberOfLayers(8);
69 69
 		earth->SetLayerConductivity(sigma);
70
-		//earth->SetLayerThickness(thick);
70
+		earth->SetLayerThickness(thick);
71 71
 
72 72
 	    receivers = FieldPoints::NewSP();
73 73
 		Vector3r loc;

Chargement…
Annuler
Enregistrer