Skip to content

Commit

Permalink
#79: Minor test rename
Browse files Browse the repository at this point in the history
  • Loading branch information
jwallwork23 committed Jun 12, 2024
1 parent bef830d commit cce2718
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/test_monge_ampere.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ class TestBCs(BaseClasses.TestMongeAmpere):
Unit tests for boundary conditions of Monge-Ampere movers.
"""

def _boundary_preservation_test(self, mesh, method, fix_boundary):
def _test_boundary_preservation(self, mesh, method, fix_boundary):
bnd = assemble(Constant(1.0) * ds(domain=mesh))
bnodes = DirichletBC(mesh.coordinates.function_space(), 0, "on_boundary").nodes
bnd_coords = mesh.coordinates.dat.data.copy()[bnodes]
Expand Down Expand Up @@ -226,7 +226,7 @@ def test_periodic(self, dim, method):
"""
mesh = self.mesh(dim=dim, periodic=True)
volume = assemble(Constant(1.0) * dx(domain=mesh))
mover = self._boundary_preservation_test(mesh, method, False)
mover = self._test_boundary_preservation(mesh, method, False)

# Check the volume of the domain is conserved
self.assertAlmostEqual(assemble(Constant(1.0) * dx(domain=mover.mesh)), volume)
Expand Down Expand Up @@ -256,7 +256,7 @@ def test_boundary_preservation_axis_aligned(self, dim, method, fix_boundary):
"""
mesh = self.mesh(dim=dim)
volume = assemble(Constant(1.0) * dx(domain=mesh))
mover = self._boundary_preservation_test(mesh, method, fix_boundary)
mover = self._test_boundary_preservation(mesh, method, fix_boundary)

# Check the volume of the domain is conserved
self.assertAlmostEqual(assemble(Constant(1.0) * dx(domain=mover.mesh)), volume)
Expand Down Expand Up @@ -297,7 +297,7 @@ def test_boundary_preservation_non_axis_aligned(self, dim, method, fix_boundary)
raise ValueError(f"Dimension {dim} not supported.")
coords = Function(mesh.coordinates.function_space())
coords.interpolate(ufl.dot(rotation_matrix, mesh.coordinates))
mover = self._boundary_preservation_test(Mesh(coords), method, fix_boundary)
mover = self._test_boundary_preservation(Mesh(coords), method, fix_boundary)

# Check the volume of the domain is conserved
self.assertAlmostEqual(assemble(Constant(1.0) * dx(domain=mover.mesh)), volume)
Expand Down

0 comments on commit cce2718

Please sign in to comment.