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

Add VTU export for Unstructured meshes #3290

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

Conversation

rherrero-pf
Copy link

@rherrero-pf rherrero-pf commented Feb 4, 2025

Description

Added method to export an unstructured mesh in .vtu format, and removed the dependency on the VTK module, which clashes with CadQuery.

Fixes # (issue)
Fixes issue #3289

Checklist

  • I have performed a self-review of my own code
  • I have run clang-format (version 15) on any C++ source files (if applicable)
  • 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)

@rherrero-pf rherrero-pf changed the title Rherrero add vtu export umesh Add VTU export for Unstructured meshes, and remove dependency on VTK Feb 4, 2025
@rherrero-pf rherrero-pf changed the title Add VTU export for Unstructured meshes, and remove dependency on VTK Add VTU export for Unstructured meshes Feb 4, 2025
@rherrero-pf
Copy link
Author

@shimwell With this PR one should be able to mesh CadQuery shapes, and export legacy VTK, or VTU, without running into module conflicts

openmc/mesh.py Outdated Show resolved Hide resolved
Copy link
Contributor

@pshriwise pshriwise left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @rherrero-pf for the contribution! The additional format support will be nice to have. And thank you for updating the VTK imports.

Mostly comments on the new test here.

tests/unit_tests/test_mesh.py Outdated Show resolved Hide resolved
tests/unit_tests/test_mesh.py Outdated Show resolved Hide resolved
tests/unit_tests/test_mesh.py Outdated Show resolved Hide resolved
openmc/mesh.py Outdated Show resolved Hide resolved
@pshriwise pshriwise added this to the v0.15.1 milestone Feb 6, 2025
@pshriwise pshriwise removed the v0.15.1 label Feb 6, 2025
Copy link
Contributor

@paulromano paulromano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @rherrero-pf for this PR!

@pshriwise I went ahead and made the necessary updates based on your review. If you're satisfied, please approve so we can merge this in.

@paulromano paulromano enabled auto-merge (squash) February 11, 2025 19:40
Copy link
Contributor

@pshriwise pshriwise left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thanks @rherrero-pf, @paulromano!

@shimwell
Copy link
Member

I see auto merge was enabled but one of the CI runners failed. Rerunning that runner just in case it was a temporary bug

@shimwell
Copy link
Member

shimwell commented Feb 13, 2025

This failing test is strange, if it helps I am also changing the same vtk function on this other PR
Mine is also failing in CI with the same error message
I have also added a very small unstructured mesh to my PR (so yet another different UM geometry)

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