Read and save Voxel data for paraview

Hello everyone,

I am currently trying to find a solution for the following:
I do calculations on a square VoxelMesh, which is simply represented by an array. However, this also contains material data for multiple phases, as well as stress and strain results after computing. (2D and 3D). Currently, we do this by WriteVTK, which just works fine. However, for the whole pipeline i’m not quite satisfied. Some of our material data uses a legacy? vtr file, which can’t be read with ReadVTK, instead we have to use VTKDataIO, which relies on some python code, but we want to stay in Julia without the need to load python as well.

I had a look now at several option, but could not find a solution. I tried using HDF5.jl and the native Julia FileIO, but ParaView is not happy with the produced files.

So my question would be, how do you approach result storage/visualization, especially for 3D arrays and in combination with paraview.


Is it possible to load the legacy data into paraview and then resave the data as a non-legacy vtk file?

It is possible to create a script that calls a headless version of paraview to do this. You just need to do it once with a “trace” and then look at the python code that it calls. Then run the command “pvserver” or something like that.

My workflow is:
run OpenFOAM → Paraview to convert foam to vtu → ReadVTK to load vtu

I think that should work, I will give it a try next time I’m working on it.