Some (temporary) changes to make unstructured mesh copacetic with the other mesh bin structures.

This commit is contained in:
Patrick Shriwise 2019-12-17 15:38:12 -06:00
parent 8cdbedf674
commit 44083412f0
2 changed files with 3 additions and 2 deletions

View file

@ -750,7 +750,7 @@ class MeshFilter(Filter):
cv.check_type('filter mesh', mesh, openmc.MeshBase)
self._mesh = mesh
if isinstance(mesh, openmc.UnstructuredMesh):
self.bins = []
self.bins = [ (n, 1, 1) for n in range(1, mesh.volumes.size + 1) ]
else:
self.bins = list(mesh.indices)

View file

@ -654,7 +654,8 @@ class UnstructuredMesh(MeshBase):
mesh = cls(mesh_id)
mesh.filename = group['filename'][()].decode()
mesh.volumes = group['volumes'][()]
vol_data = group['volumes'][()]
mesh.volumes = np.reshape(vol_data, (vol_data.shape[0], 1))
return mesh