mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 06:05:58 -04:00
cylindrical mesh lower left Z value corrected (#2684)
This commit is contained in:
parent
a125f81500
commit
be7a9c375a
2 changed files with 10 additions and 5 deletions
|
|
@ -1320,7 +1320,7 @@ class CylindricalMesh(StructuredMesh):
|
|||
return np.array((
|
||||
self.origin[0] - self.r_grid[-1],
|
||||
self.origin[1] - self.r_grid[-1],
|
||||
self.origin[2] - self.z_grid[-1]
|
||||
self.origin[2] + self.z_grid[0]
|
||||
))
|
||||
|
||||
@property
|
||||
|
|
|
|||
|
|
@ -56,21 +56,26 @@ def test_cylindrical_mesh_bounding_box():
|
|||
origin=(0, 0, 0)
|
||||
)
|
||||
np.testing.assert_array_equal(mesh.upper_right, (1, 1, 1))
|
||||
np.testing.assert_array_equal(mesh.lower_left, (-1, -1, -1))
|
||||
np.testing.assert_array_equal(mesh.lower_left, (-1, -1, 0.1))
|
||||
bb = mesh.bounding_box
|
||||
assert isinstance(bb, openmc.BoundingBox)
|
||||
np.testing.assert_array_equal(bb.lower_left, (-1, -1, -1))
|
||||
np.testing.assert_array_equal(bb.lower_left, (-1, -1, 0.1))
|
||||
np.testing.assert_array_equal(bb.upper_right, (1, 1, 1))
|
||||
|
||||
# test with mesh at origin (3, 5, 7)
|
||||
mesh.origin = (3, 5, 7)
|
||||
np.testing.assert_array_equal(mesh.upper_right, (4, 6, 8))
|
||||
np.testing.assert_array_equal(mesh.lower_left, (2, 4, 6))
|
||||
np.testing.assert_array_equal(mesh.lower_left, (2, 4, 7.1))
|
||||
bb = mesh.bounding_box
|
||||
assert isinstance(bb, openmc.BoundingBox)
|
||||
np.testing.assert_array_equal(bb.lower_left, (2, 4, 6))
|
||||
np.testing.assert_array_equal(bb.lower_left, (2, 4, 7.1))
|
||||
np.testing.assert_array_equal(bb.upper_right, (4, 6, 8))
|
||||
|
||||
# changing z grid to contain negative numbers
|
||||
mesh.z_grid = [-10, 0, 10]
|
||||
np.testing.assert_array_equal(mesh.lower_left, (2, 4, -3))
|
||||
np.testing.assert_array_equal(mesh.upper_right, (4, 6, 17))
|
||||
|
||||
|
||||
def test_spherical_mesh_bounding_box():
|
||||
# test with mesh at origin (0, 0, 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue