|
@@ -163,9 +163,7 @@ namespace Lemma {
|
163
|
163
|
oct->SetSize( Size(0), Size(1), Size(2) );
|
164
|
164
|
vtkHyperOctreeCursor* curse = oct->NewCellCursor();
|
165
|
165
|
curse->ToRoot();
|
166
|
|
- EvaluateKids2( Size, 0, cpos, VectorXcr::Ones(PulseI.size()), oct, curse );
|
167
|
|
-
|
168
|
|
- for (int iq=0; iq<PulseI.size(); ++iq) {
|
|
166
|
+ EvaluateKids2( Size, 0, cpos, Complex(100.0), oct, curse );
|
169
|
167
|
|
170
|
168
|
// Fill in leaf data
|
171
|
169
|
vtkDoubleArray* kr = vtkDoubleArray::New();
|
|
@@ -190,9 +188,9 @@ namespace Lemma {
|
190
|
188
|
|
191
|
189
|
//Real LeafVol(0);
|
192
|
190
|
for (auto leaf : LeafDict) {
|
193
|
|
- kr->InsertTuple1( leaf.first, std::real(leaf.second(iq)) );
|
194
|
|
- ki->InsertTuple1( leaf.first, std::imag(leaf.second(iq)) );
|
195
|
|
- km->InsertTuple1( leaf.first, std::abs(leaf.second(iq)) );
|
|
191
|
+ kr->InsertTuple1( leaf.first, std::real(leaf.second) );
|
|
192
|
+ ki->InsertTuple1( leaf.first, std::imag(leaf.second) );
|
|
193
|
+ km->InsertTuple1( leaf.first, std::abs(leaf.second) );
|
196
|
194
|
kid->InsertTuple1( leaf.first, leaf.first );
|
197
|
195
|
//LeafVol += std::real(leaf.second);
|
198
|
196
|
}
|
|
@@ -211,8 +209,7 @@ namespace Lemma {
|
211
|
209
|
auto write = vtkXMLHyperOctreeWriter::New();
|
212
|
210
|
//write.SetDataModeToAscii()
|
213
|
211
|
write->SetInputData(oct);
|
214
|
|
- std::string fname = std::string("octree-") + to_string(ilay)
|
215
|
|
- + std::string("-") + to_string(iq) + std::string(".vto");
|
|
212
|
+ std::string fname = std::string("octree-couple") + std::string(".vto");
|
216
|
213
|
write->SetFileName(fname.c_str());
|
217
|
214
|
write->Write();
|
218
|
215
|
write->Delete();
|
|
@@ -229,8 +226,6 @@ namespace Lemma {
|
229
|
226
|
ki->Delete();
|
230
|
227
|
km->Delete();
|
231
|
228
|
|
232
|
|
- }
|
233
|
|
-
|
234
|
229
|
curse->Delete();
|
235
|
230
|
oct->Delete();
|
236
|
231
|
#else
|
|
@@ -248,6 +243,7 @@ namespace Lemma {
|
248
|
243
|
//--------------------------------------------------------------------------------------
|
249
|
244
|
Complex Coupling::f( const Vector3r& r, const Real& volume, const Vector3cr& Ht, const Vector3cr& Hr ) {
|
250
|
245
|
return volume*Ht.dot(Hr);
|
|
246
|
+ //return Ht.dot(Hr);
|
251
|
247
|
}
|
252
|
248
|
|
253
|
249
|
//--------------------------------------------------------------------------------------
|
|
@@ -258,7 +254,7 @@ namespace Lemma {
|
258
|
254
|
const Complex& parentVal ) {
|
259
|
255
|
|
260
|
256
|
std::cout << "\r" << (int)(1e2*VOLSUM/(Size[0]*Size[1]*Size[2])) << "\t" << nleaves;
|
261
|
|
- //std::cout.flush();
|
|
257
|
+ std::cout.flush();
|
262
|
258
|
|
263
|
259
|
// Next level step, interested in one level below
|
264
|
260
|
// bitshift requires one extra, faster than, and equivalent to std::pow(2, level+1)
|
|
@@ -410,14 +406,14 @@ namespace Lemma {
|
410
|
406
|
}
|
411
|
407
|
*/
|
412
|
408
|
/* End of position test */
|
413
|
|
- EvaluateKids2( size, level+1, cp, kvals.row(ichild), oct, curse );
|
|
409
|
+ EvaluateKids2( size, level+1, cp, kvals(ichild), oct, curse );
|
414
|
410
|
curse->ToParent();
|
415
|
411
|
}
|
416
|
412
|
return; // not a leaf
|
417
|
413
|
}
|
418
|
414
|
LeafDict[curse->GetLeafId()] = ksum/(8.*vol);
|
419
|
415
|
LeafDictIdx[curse->GetLeafId()] = nleaves;
|
420
|
|
- Kern.row(ilay) += ksum;
|
|
416
|
+ SUM += ksum;
|
421
|
417
|
VOLSUM += 8*vol;
|
422
|
418
|
nleaves += 1;
|
423
|
419
|
return; // is a leaf
|