From 44083412f0f0987b759711962271ea6b5fc47b4d Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Tue, 17 Dec 2019 15:38:12 -0600 Subject: [PATCH] Some (temporary) changes to make unstructured mesh copacetic with the other mesh bin structures. --- openmc/filter.py | 2 +- openmc/mesh.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) 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