Skip to content

Commit

Permalink
#58: Fix spring tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jwallwork23 committed Apr 4, 2024
1 parent 3a026a8 commit fde3356
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions test/test_spring.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ def test_facet_areas():
triangle are computed correctly.
"""
mesh = firedrake.UnitTriangleMesh()
mover = SpringMover(mesh)
timestep = 1.0
mover = SpringMover(mesh, timestep)
facet_areas = mover.facet_areas.dat.data
expected = [1, np.sqrt(2), 1]
assert np.allclose(facet_areas, expected)
Expand All @@ -32,7 +33,8 @@ def test_tangents():
triangle are computed correctly.
"""
mesh = firedrake.UnitTriangleMesh()
mover = SpringMover(mesh)
timestep = 1.0
mover = SpringMover(mesh, timestep)
tangents = mover.tangents.dat.data
expected = [[1, 0], [np.sqrt(2) / 2, np.sqrt(2) / 2], [0, 1]]
assert np.allclose(np.abs(tangents), expected)
Expand All @@ -45,7 +47,8 @@ def test_angles():
computed correctly.
"""
mesh = firedrake.UnitTriangleMesh()
mover = SpringMover(mesh)
timestep = 1.0
mover = SpringMover(mesh, timestep)
angles = 180 * mover.angles.dat.data / np.pi
expected = [0, 135, 90]
assert np.allclose(angles, expected)

0 comments on commit fde3356

Please sign in to comment.