From 3dc614268c16ba20a5d04234a53e61d672593ead Mon Sep 17 00:00:00 2001 From: Joe Wallwork Date: Tue, 3 Sep 2024 07:42:02 +0100 Subject: [PATCH] Periodic boundaries aren't tagged --- movement/monge_ampere.py | 13 ------------- test/test_monge_ampere.py | 10 ---------- 2 files changed, 23 deletions(-) diff --git a/movement/monge_ampere.py b/movement/monge_ampere.py index 43a5b0d..03725cf 100644 --- a/movement/monge_ampere.py +++ b/movement/monge_ampere.py @@ -329,19 +329,6 @@ def l2_projector(self): for dirichlet_bc in self._l2_projector_bcs(boundary_tag) ] - # Check for an attempt to fix periodic boundary segments - subdomains = set() - for bc in bcs: - if not hasattr(bc, "sub_domain"): - subdomain = bc._F.sub_domain # EquationBC doesn't have sub_domain attr - else: - subdomain = bc.sub_domain - if not isinstance(subdomain, Iterable): - subdomain = [subdomain] - subdomains = subdomains.union(subdomain) - if set(self.fixed_boundary_segments).difference(subdomains): - raise ValueError("Cannot fix boundary nodes for periodic segments.") - # Create solver problem = firedrake.LinearVariationalProblem(a, L, self._grad_phi, bcs=bcs) self._l2_projector = firedrake.LinearVariationalSolver( diff --git a/test/test_monge_ampere.py b/test/test_monge_ampere.py index c619210..db0b025 100644 --- a/test/test_monge_ampere.py +++ b/test/test_monge_ampere.py @@ -109,16 +109,6 @@ def test_invalid_plane_valuerror(self): msg = "Could not determine a plane for the provided points." self.assertEqual(str(cm.exception), msg) - def test_periodic_fixed_boundaries_valueerror(self): - mesh = self.mesh(n=3, periodic=True) - mover = MongeAmpereMover_Relaxation( - mesh, ring_monitor, fixed_boundary_segments=["on_boundary"] - ) - with self.assertRaises(ValueError) as cm: - mover.move() - msg = "Cannot fix boundary nodes for periodic segments." - self.assertEqual(str(cm.exception), msg) - def test_curved_notimplementederror(self): coords = Function(VectorFunctionSpace(UnitTriangleMesh(), "CG", 2)) coords.interpolate(coords.function_space().mesh().coordinates)