From 43a4bd4ac74003abfb505fe1caa77770ac459b3b Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Sun, 16 Feb 2020 09:16:07 -0600 Subject: [PATCH] Initializing internal volume parameter and using len() to size bins (so we aren't assuming use of a numpy array) --- openmc/filter.py | 2 +- openmc/mesh.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/openmc/filter.py b/openmc/filter.py index 6e389ba2d7..f9d93d91a2 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 = [ (n, 1, 1) for n in range(1, mesh.volumes.size + 1) ] + self.bins = [(n, 1, 1) for n in range(1, len(mesh.volumes) + 1)] else: self.bins = list(mesh.indices) diff --git a/openmc/mesh.py b/openmc/mesh.py index 8b199fa25f..1117116e1d 100644 --- a/openmc/mesh.py +++ b/openmc/mesh.py @@ -616,6 +616,7 @@ class UnstructuredMesh(MeshBase): def __init__(self, mesh_id=None, name='', filename=''): super().__init__(mesh_id, name) self._filename = filename + self._volumes = [] @property def filename(self):