|
@@ -133,8 +133,7 @@ namespace Lemma {
|
133
|
133
|
EMEarths[rx]->SetTxRxMode(RX);
|
134
|
134
|
}
|
135
|
135
|
}
|
136
|
|
- IntegrateOnOctreeGrid( 1e-7, vtkOutput );
|
137
|
|
-
|
|
136
|
+ IntegrateOnOctreeGrid( 1e-13, vtkOutput );
|
138
|
137
|
}
|
139
|
138
|
|
140
|
139
|
//--------------------------------------------------------------------------------------
|
|
@@ -145,7 +144,7 @@ namespace Lemma {
|
145
|
144
|
|
146
|
145
|
this->tol = tolerance;
|
147
|
146
|
//Vector3r Size;
|
148
|
|
- Size << 200,200,20;
|
|
147
|
+ Size << 200,200,2;
|
149
|
148
|
//Vector3r Origin;
|
150
|
149
|
Origin << 0,0,5.0;
|
151
|
150
|
Vector3r cpos; // centre position
|
|
@@ -177,12 +176,33 @@ namespace Lemma {
|
177
|
176
|
ki->SetNumberOfComponents(1);
|
178
|
177
|
ki->SetName("Im($K_0$)");
|
179
|
178
|
ki->SetNumberOfTuples( oct->GetNumberOfLeaves() );
|
|
179
|
+ vtkDoubleArray* km = vtkDoubleArray::New();
|
|
180
|
+ km->SetNumberOfComponents(1);
|
|
181
|
+ km->SetName("mod($K_0$)");
|
|
182
|
+ km->SetNumberOfTuples( oct->GetNumberOfLeaves() );
|
|
183
|
+ vtkIntArray* kid = vtkIntArray::New();
|
|
184
|
+ kid->SetNumberOfComponents(1);
|
|
185
|
+ kid->SetName("ID");
|
|
186
|
+ kid->SetNumberOfTuples( oct->GetNumberOfLeaves() );
|
|
187
|
+ //vtkDoubleArray* kerr = vtkDoubleArray::New();
|
|
188
|
+ // kerr->SetNumberOfComponents(1);
|
|
189
|
+ // kerr->SetName("Error");
|
|
190
|
+
|
180
|
191
|
for (auto leaf : LeafDict) {
|
181
|
192
|
kr->InsertTuple1( leaf.first, std::real(leaf.second) );
|
182
|
193
|
ki->InsertTuple1( leaf.first, std::imag(leaf.second) );
|
|
194
|
+ kid->InsertTuple1( leaf.first, leaf.first );
|
183
|
195
|
}
|
|
196
|
+
|
|
197
|
+ //for (auto leaf : LeafDictErr) {
|
|
198
|
+ // kerr->InsertTuple1( leaf.first, std::imag(leaf.second) );
|
|
199
|
+ //}
|
|
200
|
+
|
184
|
201
|
oct->GetLeafData()->AddArray(kr);
|
185
|
202
|
oct->GetLeafData()->AddArray(ki);
|
|
203
|
+ oct->GetLeafData()->AddArray(km);
|
|
204
|
+ oct->GetLeafData()->AddArray(kid);
|
|
205
|
+ //oct->GetLeafData()->AddArray(kerr);
|
186
|
206
|
|
187
|
207
|
auto write = vtkXMLHyperOctreeWriter::New();
|
188
|
208
|
//write.SetDataModeToAscii()
|
|
@@ -191,8 +211,11 @@ namespace Lemma {
|
191
|
211
|
write->Write();
|
192
|
212
|
write->Delete();
|
193
|
213
|
|
|
214
|
+ //kerr->Delete();
|
|
215
|
+ kid->Delete();
|
194
|
216
|
kr->Delete();
|
195
|
217
|
ki->Delete();
|
|
218
|
+ km->Delete();
|
196
|
219
|
curse->Delete();
|
197
|
220
|
oct->Delete();
|
198
|
221
|
#else
|
|
@@ -212,8 +235,8 @@ namespace Lemma {
|
212
|
235
|
// Method: f
|
213
|
236
|
//--------------------------------------------------------------------------------------
|
214
|
237
|
Complex KernelV0::f( const Vector3r& r, const Real& volume, const Vector3cr& Ht, const Vector3cr& Hr ) {
|
215
|
|
- return Complex(volume*Ht.dot(Hr));
|
216
|
|
- //return ComputeV0Cell(MU0*Ht, MU0*Hr, volume, 1.0);
|
|
238
|
+ //return Complex(volume*Ht.dot(Hr));
|
|
239
|
+ return ComputeV0Cell(MU0*Ht, MU0*Hr, volume, 1.0);
|
217
|
240
|
}
|
218
|
241
|
|
219
|
242
|
//--------------------------------------------------------------------------------------
|
|
@@ -224,8 +247,10 @@ namespace Lemma {
|
224
|
247
|
const Vector3cr& Br, const Real& vol, const Real& phi) {
|
225
|
248
|
|
226
|
249
|
// Compute the elliptic fields
|
227
|
|
- Vector3r B0hat = {1,0,0};
|
228
|
|
- Vector3r B0 = 53000 * B0hat; // nT
|
|
250
|
+ Vector3r B0hat = SigmaModel->GetMagneticFieldUnitVector();
|
|
251
|
+ Vector3r B0 = SigmaModel->GetMagneticField();
|
|
252
|
+
|
|
253
|
+ // Elliptic representation
|
229
|
254
|
EllipticB EBT = EllipticFieldRep(Bt, B0hat);
|
230
|
255
|
EllipticB EBR = EllipticFieldRep(Br, B0hat);
|
231
|
256
|
|
|
@@ -234,7 +259,7 @@ namespace Lemma {
|
234
|
259
|
Real Mn0Abs = Mn0.norm();
|
235
|
260
|
|
236
|
261
|
Real Taup = 0.020; // s
|
237
|
|
- Real Ip = 10; // A
|
|
262
|
+ Real Ip = 10; // A
|
238
|
263
|
|
239
|
264
|
// Compute the tipping angle
|
240
|
265
|
Real sintheta = std::sin(0.5*GAMMA*Ip*Taup*std::abs(EBT.alpha-EBT.beta));
|
|
@@ -264,8 +289,11 @@ namespace Lemma {
|
264
|
289
|
return -vol*Complex(0,Larmor)*Mn0Abs*(EBR.alpha+EBR.beta)*ejztr*sintheta*PhaseTerm;
|
265
|
290
|
}
|
266
|
291
|
|
|
292
|
+ //--------------------------------------------------------------------------------------
|
|
293
|
+ // Class: KernelV0
|
|
294
|
+ // Method: ComputeV0Cell
|
|
295
|
+ //--------------------------------------------------------------------------------------
|
267
|
296
|
Vector3r KernelV0::ComputeMn0(const Real& Porosity, const Vector3r& B0) {
|
268
|
|
- Real Temperature = 283; // in K
|
269
|
297
|
Real chi_n = NH2O*((GAMMA*GAMMA*HBAR*HBAR)/(4.*KB*Temperature));
|
270
|
298
|
return chi_n*Porosity*B0;
|
271
|
299
|
}
|