magnet.io.extract_boundary#
- magnet.io.extract_boundary(mesh: Mesh, dim: int, b_tags: ndarray | None = None, b_tag_name: str | None = None) Boundary #
Get boundary elements of the mesh.
Extract boundary faces (or boundary edges, in 2D), and saves them in a separate data structure.
- Parameters:
mesh (meshio.Mesh) – The mesh in question
dim (int) – Spatial dimensions.
b_tags (Array_like of int, optional.) – The tags of the elements to insert in the boundary. By default, insert in the boundary all elements of suitable dimension (i.e. all lines in 2D, all triangles, quads, etc. in 3D), and assign them tag 1. If the mesh does not have tag data, the function will behave as in the default case.
b_tag_name (str, optional) – Field name of the tags to be used in ‘mesh.cell_data’ dictionary. If no name is provided, it is implied that only a single field exists and thus used. If multiple fields exist, always provide this argument.
- Returns:
boundary (list of list of int) – Connectivity data of the boundary: every term corresponds to a face (or edge, in 2D), described by the ids of its vertices.
boundary_tags (np.ndarray of int) – The tags of the boundary elements.