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 13 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)

@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
@pshriwise
Copy link
Contributor

Looks really nice @shimwell! It will be a great option to have. I'll review as soon as I am able.

@jon-proximafusion
Copy link
Contributor Author

jon-proximafusion commented Feb 3, 2025

@pshriwise just to mention we are working on adding for more VTK based file formats in addition to this VTKHDF.

We are also looking at adding VTU.

So we are building on this branch with another feature.

We won't make a PR for the VTU work till this VTKHDF PR has been merged or rejected, but I just wanted to let you know so you can take that into account when reviewing.

shimwell and others added 2 commits February 4, 2025 12:13
Co-authored-by: rherrero-pf <156206440+rherrero-pf@users.noreply.github.com>
@rherrero-pf
Copy link
Contributor

Related PR to enable export flexibility #3290

@shimwell

This comment was marked as resolved.

@shimwell
Copy link
Member

@pshriwise I've solved the merge conflicts and i think this one is ready for review when you have time.

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.

5 participants