vtkAMRFlashReader only loads first level
Using the vtkAMRFlashReader, only the uniform grid data sets/blocks from level 0 get loaded. I think it's due to Flash's finest block AMR level being 0, whereas in VTK that's the coarsest. The Flash reader would have to set MaxLevel
on its reader base class but never does that.
I debugged this and found that with my data, here the local variable maxLevel
is set to 0
because MaxLevel
is 0
, and consequently all iterators or loop stops short after processing the blocks from level 0.
This:
index 980bc316d7..f44870f5de 100644
--- a/IO/AMR/vtkAMRFlashReader.cxx
+++ b/IO/AMR/vtkAMRFlashReader.cxx
@@ -208,6 +208,8 @@ int vtkAMRFlashReader::FillMetaData()
b2level[level]++;
} // END for all blocks
+ this->SetMaxLevel(this->Internal->NumberOfLevels);
+
return (1);
}
fixes this problem for me. I'm not sure if this is a reasonable solution or if it should be fixed differently, the max-level variable be set somewhere else, etc.
Attached you can find a minimal vtk program to reproduce the issue.
I encounter the problem with data from this website: http://silcc.mpa-garching.mpg.de/index.php
- on the top select the first simulation (DR1) and press submit
- on the page now loaded, on the right panel, check the box next to "S10-KS-clus" (first item in the list), press button "DR01"
- Download the hdf5 version of the 2nd time step (SILCC_hdf5_plt_cnt_0100) (1.3 GB download)
When running the repro on that data set, you will find that the iterator only processes the first 20 blocks (all on L0) whereas with the patch all the blocks get processed.