mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-26 05:05:30 -04:00
Check that distances are all positive
Co-authored-by: Ethan Peterson <ethan.peterson@mit.edu>
This commit is contained in:
parent
da24021119
commit
01cd2cc8dd
1 changed files with 3 additions and 0 deletions
|
|
@ -1144,6 +1144,9 @@ class CruciformPrism(CompositeSurface):
|
|||
@distances.setter
|
||||
def distances(self, values):
|
||||
values = np.array(values, dtype=float)
|
||||
# check for positive values
|
||||
if not (values > 0).all():
|
||||
raise ValueError("distances must be positive")
|
||||
# Check for monotonicity
|
||||
if (values[1:] > values[:-1]).all() or (values[1:] < values[:-1]).all():
|
||||
self._distances = values
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue