mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 05:35:49 -04:00
Avoid instantiating a Mesh during class method
This commit is contained in:
parent
7801761a70
commit
36e2ea6b8a
1 changed files with 4 additions and 4 deletions
|
|
@ -90,12 +90,12 @@ def test_mesh2d(rlat2):
|
|||
shape = np.array(rlat2.shape)
|
||||
width = shape*rlat2.pitch
|
||||
|
||||
mesh1 = openmc.Mesh().from_rect_lattice(rlat2)
|
||||
mesh1 = openmc.Mesh.from_rect_lattice(rlat2)
|
||||
assert np.array_equal(mesh1.dimension, (3, 3))
|
||||
assert np.array_equal(mesh1.lower_left, rlat2.lower_left)
|
||||
assert np.array_equal(mesh1.upper_right, rlat2.lower_left + width)
|
||||
|
||||
mesh2 = openmc.Mesh().from_rect_lattice(rlat2, division=3)
|
||||
mesh2 = openmc.Mesh.from_rect_lattice(rlat2, division=3)
|
||||
assert np.array_equal(mesh2.dimension, (9, 9))
|
||||
assert np.array_equal(mesh2.lower_left, rlat2.lower_left)
|
||||
assert np.array_equal(mesh2.upper_right, rlat2.lower_left + width)
|
||||
|
|
@ -105,12 +105,12 @@ def test_mesh3d(rlat3):
|
|||
shape = np.array(rlat3.shape)
|
||||
width = shape*rlat3.pitch
|
||||
|
||||
mesh1 = openmc.Mesh().from_rect_lattice(rlat3)
|
||||
mesh1 = openmc.Mesh.from_rect_lattice(rlat3)
|
||||
assert np.array_equal(mesh1.dimension, (3, 3, 2))
|
||||
assert np.array_equal(mesh1.lower_left, rlat3.lower_left)
|
||||
assert np.array_equal(mesh1.upper_right, rlat3.lower_left + width)
|
||||
|
||||
mesh2 = openmc.Mesh().from_rect_lattice(rlat3, division=3)
|
||||
mesh2 = openmc.Mesh.from_rect_lattice(rlat3, division=3)
|
||||
assert np.array_equal(mesh2.dimension, (9, 9, 6))
|
||||
assert np.array_equal(mesh2.lower_left, rlat3.lower_left)
|
||||
assert np.array_equal(mesh2.upper_right, rlat3.lower_left + width)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue