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

Mesh name not appearing in mesh from statepoint file #3213

Open
shimwell opened this issue Nov 29, 2024 · 0 comments
Open

Mesh name not appearing in mesh from statepoint file #3213

shimwell opened this issue Nov 29, 2024 · 0 comments
Labels

Comments

@shimwell
Copy link
Member

While working on #3212 I noticed that the mesh name was not found in the returned mesh from the statepoint file.

Digging a little deeper I noticed the mesh name is not in the hdf5 groups for a mesh in the statepoint file

>>> import openmc
>>>sp = openmc.StatePoint('statepoint.100.h5')
>>> sp.get_mesh()
<HDF5 group "/tallies/meshes/mesh 1" (7 members)>
connectivity <HDF5 dataset "connectivity": shape (69691, 8), type "<i4">
element_types <HDF5 dataset "element_types": shape (69691, 1), type "<i4">
filename <HDF5 dataset "filename": shape (), type "|S21">
library <HDF5 dataset "library": shape (), type "|S4">
type <HDF5 dataset "type": shape (), type "|S12">
vertices <HDF5 dataset "vertices": shape (17161, 3), type "<f8">
volumes <HDF5 dataset "volumes": shape (69691,), type "<f8">
UnstructuredMesh
	ID             =	1
	Name           =	
	Filename       =	/home/jon/openmc_fork/unstructured_mesh.vtk
	Mesh Library   =	moab

Looking at the cpp code for mesh.cpp and state_point.cpp it appears that the name is not written to the statepoint file and that name is also not a member variable of the mesh class.

working from the other direction mesh name is written to the model.xml file.

So I guess somewhere when the openmc cpp codes reads in the xml file it doesn't read in the mesh name part.

Might be nice to add this missing link so that the mesh can be found in the statepoint file.

This is particularity useful for unstructured meshes as in that case the mesh from a statepoint file contains centroids, vertices and other properties. The unstrucutred mesh doesn't have all that information when being originally made on the python side as it just points to a mesh file.

Usecase, I would like to make unstructred meshes, name them and then be able to get them by name from the statepoint file. Currently this is not supported by the python API and one has to loop through the available meshes to find the right one.

@shimwell shimwell added the Bugs label Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant