Skip to content

Commit

Permalink
k
Browse files Browse the repository at this point in the history
  • Loading branch information
ksagiyam committed Dec 5, 2024
1 parent 9df277c commit c0ad144
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 23 deletions.
18 changes: 1 addition & 17 deletions firedrake/functionspaceimpl.py
Original file line number Diff line number Diff line change
Expand Up @@ -889,23 +889,7 @@ def __init__(self, function_space, name=None, boundary_set=frozenset()):
[str(i) for i in self.boundary_set])))

def set_shared_data(self):
if False:#self._mesh.cell_set._extruded:
sdata = get_shared_data(self._mesh, self.ufl_element(), None)
finat_element = create_element(self.ufl_element())
real_tensorproduct = eutils.is_real_tensor_product_element(finat_element)
entity_dofs = finat_element.entity_dofs()
nodes_per_entity = tuple(self._mesh.make_dofs_per_plex_entity(entity_dofs))
key = (nodes_per_entity, real_tensorproduct, self.boundary_set)
node_set = get_node_set(self._mesh, key)
# Get constrained global section.
gsec = node_set.halo.dm.getGlobalSection()
# Set unconstrained local section.
node_set.halo.dm.setLocalSection(sdata.node_set.halo.dm.getLocalSection())
# Set constrained global section before anyone calls dm.getGlobalSection().
node_set.halo.dm.setGlobalSection(gsec)
sdata.node_set = node_set
else:
sdata = get_shared_data(self._mesh, self.ufl_element(), self.boundary_set)
sdata = get_shared_data(self._mesh, self.ufl_element(), self.boundary_set)
self._shared_data = sdata
self.node_set = sdata.node_set
r"""A :class:`pyop2.types.set.Set` representing the function space nodes."""
Expand Down
7 changes: 1 addition & 6 deletions tests/firedrake/regression/test_restricted_function_space.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,11 +249,6 @@ def test_restricted_function_space_extrusion():
extm = ExtrudedMesh(mesh, 1)
V = FunctionSpace(extm, "CG", 2)
V_res = RestrictedFunctionSpace(V, boundary_set=["bottom"])
#mesh._dm_renumbering.view()
#mesh.topology_dm.viewFromOptions("-dm_view")
#V_res._shared_data.node_set.halo.dm.getLocalSection().view()
#V_res._shared_data.node_set.halo.dm.getGlobalSection().view()
#V._shared_data.node_set.halo.dm.getGlobalSection().view()
lgmap = V_res.topological.local_to_global_map(None)
if mesh.comm.rank == 0:
lgmap_expected = [-1, 0, 1, -1, 2, 3, -1, 8, 9, -1, 4, 5, -1, 6, 7]
Expand Down Expand Up @@ -282,4 +277,4 @@ def test_restricted_function_space_extrusion():
bc = DirichletBC(V_res, 0., "bottom")
sol = Function(V_res)
solve(a == L, sol, bcs=[bc])
assert assemble(inner(sol - exact, sol - exact) * dx) ** 0.5 < 1.e-14
assert assemble(inner(sol - exact, sol - exact) * dx) ** 0.5 < 1.e-15

0 comments on commit c0ad144

Please sign in to comment.