mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 06:05:58 -04:00
Allow Mesh.volumes property for 1D and 2D RegularMesh (#3914)
This commit is contained in:
parent
368ea069ca
commit
e542b2f035
1 changed files with 5 additions and 4 deletions
|
|
@ -268,10 +268,11 @@ class MeshBase(IDManagerMixin, ABC):
|
|||
return string
|
||||
|
||||
def _volume_dim_check(self):
|
||||
if self.n_dimension != 3 or \
|
||||
any([d == 0 for d in self.dimension]):
|
||||
raise RuntimeError(f'Mesh {self.id} is not 3D. '
|
||||
'Volumes cannot be provided.')
|
||||
if any(d == 0 for d in self.dimension):
|
||||
raise RuntimeError(
|
||||
f'Mesh {self.id} has a zero-size dimension. '
|
||||
'Volumes cannot be provided.'
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def from_hdf5(cls, group: h5py.Group):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue