henry2004y / Batsrus.jl

BATSRUS/SWMF Data Processor
https://henry2004y.github.io/Batsrus.jl/dev/
MIT License
5 stars 2 forks source link

VTK support #16

Closed henry2004y closed 3 years ago

henry2004y commented 3 years ago
  1. The VTK files does not have timestep information. To allow for further time series processing in Paraview, a script create_pvd.jl is provided for generating the pvd container that stores the filenames and timestamps calculated from the filenames. This then becomes the new function create_pvd in vtk.jl. After dicussing with the author of WriteVTK.jl, the timestamp information is now added to each file through a scalar that is not related to grid in VTK, i.e. "global data" in the VTK world.

  2. Currently, multi-block (VTM), rectilinear (VTR), and unstructured (VTU) conversions are supported. By default the file size will be reduced with compression level 6, but the actual compression ratio depends on the original data.

  3. Currently, BATSRUS output contains only cell center coordinates and cell center values (referring as tcp in PARAM.in), or node coordinates and interpolated nodal values (referring as tec). It is recommended to save in the tcp format to avoid interpolation. In principle VTK also supports the combination of node coordinates and cell center values, but it is not necessary here.

  4. The simple multiblock VTK format conversion can only deal with data within a block, but it cannot figure out the connectivities between neighboring blocks. To fill the gap between blocks, we have to retrieve the tree data stored in .tree files. This requires a in-depth understanding of the grid tree structure in BATSRUS, and it took me a whole week to think, write and debug the code!

Information contained in iTree_IA:

Basically, it requires several steps:

  1. Obtain the neighbor block indexes.
  2. Obtain the relative AMR level between neighbor blocks.
  3. Calculate the global cell indexes.
  4. Fill in the connectivity list.

Several issues worth noticing:

henry2004y commented 3 years ago

I will close this for now. Reopen it if some new features are required in the future.