openmc icon indicating copy to clipboard operation
openmc copied to clipboard

adding hdfvtk format export for all meshes

Open shimwell opened this issue 2 months ago • 2 comments

Description

We can currently export mesh data to an asci format vtk file using mesh.write_data_to_vtk().

This makes use of an optional dependency vtk to write the asci vtk format file.

Avoiding importing or using the vtk package is possible as we can also write hdf5 format vtk files with h5py. H5py is a core dependency of openmc and the format is newer. Newer versions of Paraview can open the hdfvtk format quickly and it takes up less disk space.

We should allow this hdfvtk format for all meshes

  • [ ] RegularMesh
  • [ ] RectalinearMesh
  • [ ] SphericalMesh
  • [ ] CylindricalMesh
  • [X] UnstructuredMesh

I have done UnstructuredMesh in this PR which serves as an example of how to do this.

Compatibility

The old asci legacy vtk expirt remains as the default option.

shimwell avatar Oct 30 '25 18:10 shimwell

Adding a note here that hex elements have yet to be supported for UnstructuredMesh

pshriwise avatar Nov 05 '25 20:11 pshriwise

RectalinearMesh

Please note vtkRectilinearGrid is not part of VTKHDF spec yet. We would love for it to be though.

mwestphal avatar Nov 08 '25 08:11 mwestphal