Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding vtkhdf option to write vtk data #3252

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from

Conversation

jon-proximafusion
Copy link
Contributor

@jon-proximafusion jon-proximafusion commented Jan 8, 2025

Description

As discussed in #3113 it would be great to have a method of writing VTKHDF files for mesh tally data.

This PR allows users to write .hdf file VTKHDF compatible files with the existing UnstructuredMesh.write_data_to_vtk() method. This has a few advantages over the legacy vtk files we currently write.

It would be particularly useful for those of us who can't make use of the vtk package in their environment. We have this issue at the moment and can't import cadquery along with openmc due to slightly different vtk packages. It is super useful that vtk is an optional dependency in openmc and not mandated. This use of h5py lets us avoid using the vtk package while still being able to write VTKHDF files

For interested people the VTKHDF roadmap is here, the ability to read these files (ending with hdf) was introduced in Paraview 5.13.0 release notes.

All credit goes to the Kitware developers and particularly @mwestphal who introduced me to this feature

Fixes # (issue)
partly addresses #3113

Checklist

  • I have performed a self-review of my own code
  • I have followed the style guidelines for Python source files (if applicable)
  • I have made corresponding changes to the documentation (if applicable)
  • I have added tests that prove my fix is effective or that my feature works (if applicable)

openmc/mesh.py Outdated Show resolved Hide resolved
@jon-proximafusion jon-proximafusion changed the title Adding hdf option to write vtk data Adding vtkhdf option to write vtk data Jan 9, 2025
@pshriwise pshriwise self-assigned this Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants