Use mesh from weight window hdf5 file #3588
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Currently, OpenMC cannot use the mesh that is on the weight windows HDF5 file.
This creates all number of frustrations. The handling of the weight window mesh in general is super awkward.
OpenMC tries to find any mesh matching the ww.h5 mesh ID already existing in the problem, but some methods strip out tallies (deplete.get_microxs_and_flux) and suddenly the mesh filter that might be useful is gone.
One way that worked for me was bootstrapping in an entropy mesh.
settings.weight_windows.mesh doesn't seem to work with ww.h5s
This change enables OpenMC to get the mesh from the ww.h5 directly during execution and use it for the weight window.
To me, this also just feels cleaner, less error prone and more straightforward.
This is vibe coded with Claude. I have shepherded it and verified that it works.
Right now only compatible with rectilinear mesh (verified) and ostensibly with a regular mesh (not verified).
Fixes (in a way) #3549
An Alternative:
Have the Python API get the mesh from the ww.h5 and export that as a mesh to settings.
Checklist