Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docstrings to submesh creation in Python interface #3112

Merged
merged 13 commits into from
May 22, 2024
14 changes: 13 additions & 1 deletion python/dolfinx/mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"locate_entities_boundary",
"refine",
"create_mesh",
"create_submesh",
"Mesh",
"MeshTags",
"meshtags",
Expand Down Expand Up @@ -439,7 +440,18 @@ def create_mesh(
return Mesh(mesh, domain)


def create_submesh(msh, dim, entities):
def create_submesh(msh: Mesh, dim: int, entities: npt.NDArray[np.int32]):
jorgensd marked this conversation as resolved.
Show resolved Hide resolved
"""Create a mesh based on a subset of entities from an existing mesh.
jorgensd marked this conversation as resolved.
Show resolved Hide resolved

Args:
mesh: Input mesh
jorgensd marked this conversation as resolved.
Show resolved Hide resolved
dim: Topological dimension of the entities to extract
jorgensd marked this conversation as resolved.
Show resolved Hide resolved
entities: Indices of entities in ``msh`` to extract
jorgensd marked this conversation as resolved.
Show resolved Hide resolved
Returns:
A quadruplet containing the submesh and three maps from the submesh to
jorgensd marked this conversation as resolved.
Show resolved Hide resolved
the parent mesh. The first map is the entity map, the second map the
vertex map (topology), and the third map is the node map (geometry).
"""
submsh, entity_map, vertex_map, geom_map = _cpp.mesh.create_submesh(
msh._cpp_object, dim, entities
)
Expand Down
Loading