From 5f0e3e14fbf131c8bcf0ec0cf60ddf05bb7c8294 Mon Sep 17 00:00:00 2001 From: Ethan Peterson Date: Mon, 31 Oct 2022 12:18:09 -0400 Subject: [PATCH] added default filter shape and mesh filter shape --- openmc/filter.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/openmc/filter.py b/openmc/filter.py index 99b005351..bcd3dbc36 100644 --- a/openmc/filter.py +++ b/openmc/filter.py @@ -102,6 +102,8 @@ class Filter(IDManagerMixin, metaclass=FilterMeta): Unique identifier for the filter num_bins : Integral The number of filter bins + shape : tuple + The shape of the filter """ @@ -205,6 +207,10 @@ class Filter(IDManagerMixin, metaclass=FilterMeta): def num_bins(self): return len(self.bins) + @property + def shape(self): + return (self.num_bins,) + def check_bins(self, bins): """Make sure given bins are valid for this filter. @@ -839,6 +845,10 @@ class MeshFilter(Filter): else: self.bins = list(mesh.indices) + @property + def shape(self): + return self.mesh.dimension + @property def translation(self): return self._translation