Skip to content

Commit

Permalink
functionspace: boundary_node on WithGeometry
Browse files Browse the repository at this point in the history
The magic method forwarding doesn't work in this case because we
really want to pass "self" into the shared data boundary_node
extraction (not self.topological).
  • Loading branch information
wence- committed May 5, 2021
1 parent d707967 commit 641fdf3
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions firedrake/functionspaceimpl.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,19 @@ def __dir__(self):
current = super(WithGeometry, self).__dir__()
return list(OrderedDict.fromkeys(dir(self.topological) + current))

def boundary_nodes(self, sub_domain):
r"""Return the boundary nodes for this :class:`~.WithGeometry`.
:arg sub_domain: the mesh marker selecting which subset of facets to consider.
:returns: A numpy array of the unique function space nodes on
the selected portion of the boundary.
See also :class:`~.DirichletBC` for details of the arguments.
"""
# Have to replicate the definition from FunctionSpace because
# we want to access the DM on the WithGeometry object.
return self._shared_data.boundary_nodes(self, sub_domain)

def collapse(self):
return type(self)(self.topological.collapse(), self.mesh())

Expand Down

0 comments on commit 641fdf3

Please sign in to comment.