Bladeren bron

Imporovements still coming to kernel calculation

master
Trevor Irons 8 jaren geleden
bovenliggende
commit
2da966371e
2 gewijzigde bestanden met toevoegingen van 16 en 6 verwijderingen
  1. 1
    1
      examples/KernelV0.cpp
  2. 15
    5
      src/KernelV0.cpp

+ 1
- 1
examples/KernelV0.cpp Bestand weergeven

@@ -44,7 +44,7 @@ int main() {
44 44
     // may be more natural to work with?
45 45
     std::vector<std::string> tx = {std::string("Coil 1")};
46 46
     std::vector<std::string> rx = {std::string("Coil 1")};
47
-    Kern->CalculateK0( tx, rx , false ); //, false );
47
+    Kern->CalculateK0( tx, rx , true ); //, false );
48 48
     //Kern->CalculateK0( "Coil 1", "Coil 1" );
49 49
 
50 50
 }

+ 15
- 5
src/KernelV0.cpp Bestand weergeven

@@ -118,7 +118,7 @@ namespace Lemma {
118 118
                 // TODO query for method, altough with flat antennae, this is fastest
119 119
                 EMEarths.back()->SetHankelTransformMethod(ANDERSON801);
120 120
         }
121
-        IntegrateOnOctreeGrid( 1e-1, vtkOutput );
121
+        IntegrateOnOctreeGrid( 1e-5, vtkOutput );
122 122
 
123 123
     }
124 124
 
@@ -130,9 +130,9 @@ namespace Lemma {
130 130
 
131 131
         this->tol = tolerance;
132 132
         //Vector3r                Size;
133
-            Size << 200,200,100;
133
+            Size << 200,200,200;
134 134
         //Vector3r                Origin;
135
-            Origin << 0,0,0;
135
+            Origin << 0,0,1.0;
136 136
         Vector3r                cpos;  // centre position
137 137
             //cpos << 100,100,50;
138 138
             cpos = (Size-Origin).array() / 2.;
@@ -200,6 +200,8 @@ namespace Lemma {
200 200
         //return Complex(volume*Bt.norm());
201 201
         return Complex(volume*Bt.norm());
202 202
         //return Complex(volume);
203
+
204
+//        Vn(ir) = ComputeV0Cell(Bt, Br, volume, 1.0);
203 205
     }
204 206
 
205 207
     //--------------------------------------------------------------------------------------
@@ -209,6 +211,9 @@ namespace Lemma {
209 211
     bool KernelV0::EvaluateKids( const Vector3r& size, const int& level, const Vector3r& cpos,
210 212
         const Complex& parentVal ) {
211 213
 
214
+        std::cout << "\r" << (int)(1e2*VOLSUM/(Size[0]*Size[1]*Size[2])) << "\t" << nleaves;
215
+        std::cout.flush();
216
+
212 217
         // Next level step, interested in one level below
213 218
         // bitshift requires one extra, faster than, and equivalent to std::pow(2, level+1)
214 219
         Vector3r step  = size.array() / (Real)(1 << (level+1) );
@@ -277,8 +282,8 @@ namespace Lemma {
277 282
     bool KernelV0::EvaluateKids2( const Vector3r& size, const int& level, const Vector3r& cpos,
278 283
         const Complex& parentVal, vtkHyperOctree* oct, vtkHyperOctreeCursor* curse) {
279 284
 
280
-        //std::cout << "\rlevel " << level << "\t" << nleaves;
281
-        //std::cout.flush();
285
+        std::cout << "\r" << (int)(1e2*VOLSUM/(Size[0]*Size[1]*Size[2])) << "\t" << nleaves;
286
+        std::cout.flush();
282 287
 
283 288
         // Next level step, interested in one level below
284 289
         // bitshift requires one extra, faster than, and equivalent to std::pow(2, level+1)
@@ -328,6 +333,7 @@ namespace Lemma {
328 333
                 curse->ToChild(ichild);
329 334
                 Vector3r cp = pos; // Eigen complains about combining these
330 335
                 cp += posadd.row(ichild);
336
+                // Testing for position via alternative means
331 337
                 //Real p[3];
332 338
                 //GetPosition(curse, p);
333 339
                 //std::cout << cp[0] << "\t" << p[0] << "\t" << cp[1] << "\t" << p[1] << "\t" << cp[2] << "\t" << p[2] << "\t" <<  vol<< std::endl;
@@ -345,6 +351,10 @@ namespace Lemma {
345 351
         return true;       // leaf
346 352
     }
347 353
 
354
+    //--------------------------------------------------------------------------------------
355
+    //       Class:  KernelV0
356
+    //      Method:  GetPosition
357
+    //--------------------------------------------------------------------------------------
348 358
     void KernelV0::GetPosition( vtkHyperOctreeCursor* Cursor, Real* p ) {
349 359
         Real ratio=1.0/(1<<(Cursor->GetCurrentLevel()));
350 360
         //step  = ((Size).array() / std::pow(2.,Cursor->GetCurrentLevel()));

Laden…
Annuleren
Opslaan