diff --git a/openmc/filter.py b/openmc/filter.py index 0b4929a8be..6e389ba2d7 100644 --- a/openmc/filter.py +++ b/openmc/filter.py @@ -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) diff --git a/openmc/mesh.py b/openmc/mesh.py index 41d6beae4e..8b199fa25f 100644 --- a/openmc/mesh.py +++ b/openmc/mesh.py @@ -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