From 3d14ec587c79c3f6c060c0bec4cf49240f52f176 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Schartum=20Dokken?= Date: Thu, 12 Sep 2024 11:15:09 +0200 Subject: [PATCH] Resolve #3167 (#3389) --- python/dolfinx/fem/bcs.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/python/dolfinx/fem/bcs.py b/python/dolfinx/fem/bcs.py index 1972740bfcb..737ca62d1e4 100644 --- a/python/dolfinx/fem/bcs.py +++ b/python/dolfinx/fem/bcs.py @@ -132,6 +132,21 @@ def function_space(self) -> dolfinx.fem.FunctionSpace: """The function space on which the boundary condition is defined""" return self._cpp_object.function_space + def dof_indices(self) -> tuple[np.ndarray, int]: + """Access dof indices `(local indices, unrolled)`, including ghosts, to + which a Dirichlet condition is applied, and the index to the first + non-owned (ghost) index. The array of indices is sorted. + + Note: + The returned array is read-only. + + Returns: + Sorted array of dof indices (unrolled) and index to the + first entry in the dof index array that is not owned. Entries + `dofs[:pos]` are owned and entries `dofs[pos:]` are ghosts. + """ + return self._cpp_object.dof_indices() + def dirichletbc( value: typing.Union[Function, Constant, np.ndarray],