Description
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.