|
@@ -278,8 +278,13 @@ namespace Lemma {
|
278
|
278
|
} else {
|
279
|
279
|
#ifdef LEMMAUSEVTK
|
280
|
280
|
vtkHyperTreeGrid* oct = vtkHyperTreeGrid::New();
|
|
281
|
+ #if LEMMA_VTK8_SUPPORT
|
281
|
282
|
oct->SetGridSize( 1, 1, 1 ); // Important!
|
282
|
283
|
oct->SetDimension(3);
|
|
284
|
+ #elif LEMMA_VTK9_SUPPORT
|
|
285
|
+ oct->SetExtent( 0, 1, 0, 1, 0, 1 ); // Important!
|
|
286
|
+ oct->SetDimensions(1,1,1);
|
|
287
|
+ #endif
|
283
|
288
|
vtkNew<vtkDoubleArray> xcoords;
|
284
|
289
|
xcoords->SetNumberOfComponents(1);
|
285
|
290
|
xcoords->SetNumberOfTuples(2);
|
|
@@ -306,9 +311,15 @@ namespace Lemma {
|
306
|
311
|
|
307
|
312
|
//vtkHyperTreeGridLevelEntry* curse2 = vtkHyperTreeGridLevelEntry::New(); // VTK 9
|
308
|
313
|
// I belive the index in NewCursor maybe points to which cell in the Rectilinear Grid?
|
|
314
|
+ #if LEMMA_VTK8_SUPPORT
|
309
|
315
|
vtkHyperTreeCursor* curse = oct->NewCursor(0, true); // true creates the cursor
|
310
|
316
|
curse->ToRoot();
|
311
|
317
|
EvaluateKids2( Size, 0, cpos, VectorXcr::Ones(PulseI.size()), oct, curse );
|
|
318
|
+ #elif LEMMA_VTK9_SUPPORT
|
|
319
|
+ auto curse = oct->NewNonOrientedCursor(0, true); // true creates the cursor
|
|
320
|
+ curse->ToRoot();
|
|
321
|
+ EvaluateKids2( Size, 0, cpos, VectorXcr::Ones(PulseI.size()), oct->GetTree(0, true), curse );
|
|
322
|
+ #endif
|
312
|
323
|
|
313
|
324
|
for (int iq=0; iq<PulseI.size(); ++iq) {
|
314
|
325
|
|
|
@@ -643,9 +654,13 @@ namespace Lemma {
|
643
|
654
|
// Class: KernelV0
|
644
|
655
|
// Method: EvaluateKids2 -- same as Evaluate Kids, but include VTK octree generation
|
645
|
656
|
//--------------------------------------------------------------------------------------
|
|
657
|
+ #ifdef LEMMA_VTK8_SUPPORT
|
646
|
658
|
void KernelV0::EvaluateKids2( const Vector3r& size, const int& level, const Vector3r& cpos,
|
647
|
659
|
const VectorXcr& parentVal, vtkHyperTreeGrid* oct, vtkHyperTreeCursor* curse) {
|
648
|
|
-
|
|
660
|
+ #elif LEMMA_VTK9_SUPPORT
|
|
661
|
+ void KernelV0::EvaluateKids2( const Vector3r& size, const int& level, const Vector3r& cpos,
|
|
662
|
+ const VectorXcr& parentVal, vtkHyperTree* oct, vtkHyperTreeGridNonOrientedCursor* curse) {
|
|
663
|
+ #endif
|
649
|
664
|
int pdone = (int)(1e2*VOLSUM/(Size[0]*Size[1]*Size[2]));
|
650
|
665
|
if (pdone > percent_done ) {
|
651
|
666
|
percent_done = pdone;
|
|
@@ -708,7 +723,11 @@ namespace Lemma {
|
708
|
723
|
// Evaluate whether or not furthur splitting is needed
|
709
|
724
|
if ( (((ksum - parentVal).array().abs() > tol).any() && level<maxLevel) || level < minLevel ) {
|
710
|
725
|
// 0 after curse is vtkIdType?
|
|
726
|
+ #ifdef LEMMA_VTK8_SUPPORT
|
711
|
727
|
oct->SubdivideLeaf(curse, 0);
|
|
728
|
+ #elif LEMMA_VTK9_SUPPORT
|
|
729
|
+ curse->SubdivideLeaf();
|
|
730
|
+ #endif
|
712
|
731
|
for (int ichild=0; ichild<8; ++ichild) {
|
713
|
732
|
curse->ToChild(ichild);
|
714
|
733
|
Vector3r cp = pos; // Eigen complains about combining these
|
|
@@ -739,7 +758,11 @@ namespace Lemma {
|
739
|
758
|
*/
|
740
|
759
|
|
741
|
760
|
// 0 after curse is vtkIdType?
|
|
761
|
+ #ifdef LEMMA_VTK8_SUPPORT
|
742
|
762
|
oct->SubdivideLeaf(curse, 0);
|
|
763
|
+ #elif LEMMA_VTK9_SUPPORT
|
|
764
|
+ curse->SubdivideLeaf();
|
|
765
|
+ #endif
|
743
|
766
|
for (int ichild=0; ichild<8; ++ichild) {
|
744
|
767
|
curse->ToChild(ichild);
|
745
|
768
|
LeafDict[curse->GetVertexId()] = ksum/(8.*vol);
|