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

Unstrucutred mesh to accept vtk file formats when library=moab #3210

Closed
shimwell opened this issue Nov 27, 2024 · 5 comments
Closed

Unstrucutred mesh to accept vtk file formats when library=moab #3210

shimwell opened this issue Nov 27, 2024 · 5 comments

Comments

@shimwell
Copy link
Member

Description

Currently the UnstructuredMesh accepts a damgc h5 file or a libmesh exodus file.

Currently I'm making use of UnstructuredMesh with library='moab' and passing in a mesh in h5 format.

I'm making the mesh in gmsh and writing a vtk file, then I'm using moab to load the vtk file and write out a h5 file. This seams like an inefficient process to me and I would be keen if the UnstructuredMesh class was able to accept the vtk file directly. As PyMoab is able to read a vtk and convert to h5 I suspect that MOAB can also take a vtk file directly.

I think allowing vtk files as a input format for UnstructuredMesh when library=='moab' will be enabling for a few mesh workflows as not many support h5 file writing.

Alternatives

continue to convert the vtk to h5 with pymoab before sending it to openmc. I fear this will slow down for larger meshes. Another alternative is that I make use of the exodus format more and move to libmesh. However this is not currently included in the conda install and compiling with autotools can take a long time.

Compatibility

Will the enhancement compatibility with meshers

@makeclean
Copy link
Contributor

Looking at the C++ code, I think that should just work already. You should be able to provide a VTK file and have it just work? It also looks like the python layer just passes it through without any checks. Does this not 'just' work?

@shimwell
Copy link
Member Author

Just finished checking and you are totally right @makeclean sorry for missing that and thanks for the suggestion.

I shall put in a PR to add something to the docstring just in case others are unaware of this and then close out this non issue.

I was able to save a bit of time and a few lines of code on cad-to-dagmc convertor as a consequence

@pshriwise
Copy link
Contributor

I was about the say the same @makeclean. Thanks!

I, like you, @shimwell confirmed that this does in fact work. I'll keep an eye out for the PR with the documentation update -- thanks for being willing to update that!

@shimwell shimwell changed the title Unstrucutred mesh to accept vtk file formats whne library=moab Unstrucutred mesh to accept vtk file formats when library=moab Nov 28, 2024
@shimwell
Copy link
Member Author

I found out by accident that openmc.UnstructuredMesh also accepts a surface mesh (dagmc.h5m) and runs without error but naturally produces no results in the output vtk.

Perhaps we should check the mesh dimentions when loading a mesh for the mesh tally

@shimwell
Copy link
Member Author

Closing issue as #3211 got merged. Thanks all

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

No branches or pull requests

3 participants