Skip to content

Commit

Permalink
#95: Allow tolerance for supermesh_project tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jwallwork23 committed Apr 27, 2024
1 parent 326ce97 commit 880a647
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/test_interpolation.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ def test_transfer_same_mesh_mixed_adjoint(self, transfer_method):
self.assertAlmostEqual(errornorm(expected, target), 0)

@parameterized.expand([(True, True), (True, False), (False, True), (False, False)])
def test_supermesh_project(self, same_mesh, same_degree):
def test_supermesh_project(self, same_mesh, same_degree, tol=1.0e-06):
Vs = FunctionSpace(self.source_mesh, "CG", 1)
target_mesh = self.source_mesh if same_mesh else self.target_mesh
target_degree = 1 if same_degree else 2
Expand All @@ -341,8 +341,8 @@ def test_supermesh_project(self, same_mesh, same_degree):
target = Function(Vt)
_supermesh_project(source, target, lumped=False)
expected = Function(Vt).project(source)
self.assertAlmostEqual(errornorm(target, expected), 0)
self.assertAlmostEqual(assemble(source * dx), assemble(target * dx))
self.assertLess(errornorm(target, expected), tol)
self.assertLess(abs(assemble(source * dx) - assemble(target * dx)), tol)

@parameterized.expand([(True,), (False,)])
def test_mass_lumping(self, same_mesh, eps=1.0e-08):
Expand Down

0 comments on commit 880a647

Please sign in to comment.