mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-26 13:15:39 -04:00
added default filter shape and mesh filter shape
This commit is contained in:
parent
6218becb17
commit
5f0e3e14fb
1 changed files with 10 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue