@@ -388,8 +388,7 @@ def reconstruct(self, mesh=None, element=None, name=None, **kwargs):
388388 Any extra kwargs are used to reconstruct the finite element.
389389 For details see :meth:`finat.ufl.finiteelement.FiniteElement.reconstruct`.
390390 """
391- from firedrake .functionspace import RestrictedFunctionSpace as restrict
392- from firedrake .functionspace import MixedFunctionSpace as product
391+ from firedrake .bcs import restricted_function_space
393392 V_parent = self
394393
395394 # Deal with ProxyFunctionSpace
@@ -413,19 +412,13 @@ def reconstruct(self, mesh=None, element=None, name=None, **kwargs):
413412 if len (kwargs ) > 0 or element .cell != cell :
414413 element = element .reconstruct (cell = cell , ** kwargs )
415414
416- # Reconstruct V_parent
415+ # Reconstruct the parent space
417416 V = type (self ).make_function_space (mesh , element , name = name )
418417
419418 # Deal with RestrictedFunctionSpace
420419 boundary_sets = [V_ .boundary_set for V_ in V_parent ]
421420 if any (boundary_sets ):
422- subspaces = [restrict (V_ , boundary_set = boundary_set , name = V_ .name )
423- if boundary_set else V_
424- for V_ , boundary_set in zip (V , boundary_sets )]
425- if len (subspaces ) == 1 :
426- V , = subspaces
427- else :
428- V = product (subspaces , name = V .name )
421+ V = restricted_function_space (V , boundary_sets )
429422
430423 for i in reversed (indices ):
431424 V = V .sub (i )
0 commit comments