Skip to content

Commit

Permalink
Add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jpdean committed Jan 8, 2025
1 parent 7561d41 commit 34f055e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,16 @@ def one_sided_int_entities(msh, facets):


def markers_to_meshtags(msh, tags, markers, dim):
"""
Create meshtags from a given set of tags and markers. Tag[i] is is the tag for
the part of the domain marked by markers[i].\
Parameters:
msh: The mesh
tags: A list of tags
markers: A list of markers
dim: The dimension of the entities
"""
entities = [mesh.locate_entities_boundary(msh, dim, marker) for marker in markers]
values = [np.full_like(entities, tag) for (tag, entities) in zip(tags, entities)]
entities = np.hstack(entities, dtype=np.int32)
Expand Down

0 comments on commit 34f055e

Please sign in to comment.