@@ -66,6 +66,12 @@ def initialize(self, pc):
6666
6767 V = test .function_space ()
6868 mesh = V .mesh ()
69+ try :
70+ from firedrake import MeshSequenceGeometry # noqa: F401
71+
72+ unique_mesh = mesh .unique ()
73+ except ImportError :
74+ unique_mesh = mesh
6975
7076 # Magically determine which spaces are vector and scalar valued
7177 for i , Vi in enumerate (V ):
@@ -96,7 +102,7 @@ def initialize(self, pc):
96102 DG = FiniteElement ("DG" , cell , deg )
97103 CG = FiniteElement ("CG" , interval , 1 )
98104 Vv_tr_element = TensorProductElement (DG , CG )
99- Vv_tr = FunctionSpace (mesh , Vv_tr_element )
105+ Vv_tr = FunctionSpace (unique_mesh , Vv_tr_element )
100106
101107 # Break the spaces
102108 broken_elements = MixedElement ([BrokenElement (Vi .ufl_element ()) for Vi in V ])
@@ -121,7 +127,7 @@ def initialize(self, pc):
121127 trial : TrialFunction (V_d )}
122128 Atilde = Tensor (replace (self .ctx .a , arg_map ))
123129 gammar = TestFunction (Vv_tr )
124- n = FacetNormal (mesh )
130+ n = FacetNormal (unique_mesh )
125131 sigma = TrialFunctions (V_d )[self .vidx ]
126132
127133 # Again, assumes tensor product structure. Why use this if you
@@ -157,7 +163,7 @@ def initialize(self, pc):
157163 trace_subdomains .extend (sorted ({"top" , "bottom" } - extruded_neumann_subdomains ))
158164
159165 measures .extend ((ds (sd ) for sd in sorted (neumann_subdomains )))
160- markers = [int (x ) for x in mesh .exterior_facets .unique_markers ]
166+ markers = [int (x ) for x in unique_mesh .exterior_facets .unique_markers ]
161167 dirichlet_subdomains = set (markers ) - neumann_subdomains
162168 trace_subdomains .extend (sorted (dirichlet_subdomains ))
163169
0 commit comments