mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-26 21:25:36 -04:00
add abs_tol to prevent cones with infinite or 0 slope
This commit is contained in:
parent
2adbe97194
commit
2283e08fdc
1 changed files with 2 additions and 2 deletions
|
|
@ -849,7 +849,7 @@ class Polygon(CompositeSurface):
|
|||
facet_eq = np.array([dx, dy, c])
|
||||
on_boundary = any([np.allclose(facet_eq, eq) for eq in boundary_eqns])
|
||||
# Check if the facet is horizontal
|
||||
if isclose(dx, 0):
|
||||
if isclose(dx, 0, abs_tol=1e-8):
|
||||
if basis in ('xz', 'yz', 'rz'):
|
||||
surf = openmc.ZPlane(z0=-c/dy)
|
||||
else:
|
||||
|
|
@ -857,7 +857,7 @@ class Polygon(CompositeSurface):
|
|||
# if (0, 1).(dx, dy) < 0 we want positive halfspace instead
|
||||
op = operator.pos if dy < 0 else operator.neg
|
||||
# Check if the facet is vertical
|
||||
elif isclose(dy, 0):
|
||||
elif isclose(dy, 0, abs_tol=1e-8):
|
||||
if basis in ('xy', 'xz'):
|
||||
surf = openmc.XPlane(x0=-c/dx)
|
||||
elif basis == 'yz':
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue