The connectivity.py
module#
Summary#
Get faces that make up the tetrahedrons. |
|
Compute the tetra-face connectivity tables. |
|
Establish the face type, which indicates whether it is a boundary or an interior face. |
|
Generate an array of edges from an array of triangles. |
|
Get the boundary edges that are only referenced once. |
|
Group edges by connectivity. |
|
Remove boundary triangles. |
Description#
Module containing methods for mesh connectivity.
Module detail#
- connectivity.get_faces_tetra(tetra: numpy.ndarray) numpy.ndarray #
Get faces that make up the tetrahedrons.
- connectivity.face_tetra_connectivity(tetra: numpy.ndarray) Tuple[numpy.ndarray, numpy.ndarray, numpy.ndarray] #
Compute the tetra-face connectivity tables.
- connectivity.get_face_type(faces: numpy.ndarray, face_cell_connectivity: numpy.ndarray) numpy.ndarray #
Establish the face type, which indicates whether it is a boundary or an interior face.
- Parameters:
- faces
np.ndarray
Array with face definitions.
- face_cell_connectivity
np.ndarray
Array describing the cells that each of the faces is connected to. For example,
np.array([c0, c1])
.
- faces
- Returns:
np.ndarray
Type of face, which is either interior
(face_type = 1)
or boundary(face_type = 2)
.
- connectivity.get_edges_from_triangles(triangles: numpy.ndarray) numpy.ndarray #
Generate an array of edges from an array of triangles.
- connectivity.get_free_edges(triangles: numpy.ndarray, return_free_triangles: bool = False) numpy.ndarray | Tuple[numpy.ndarray, numpy.ndarray] #
Get the boundary edges that are only referenced once.
- connectivity.edge_connectivity(edges: numpy.ndarray, return_type: bool = False, sort_closed: bool = False) numpy.ndarray #
Group edges by connectivity.
- Parameters:
- edges
np.array
NumEdges x 2 NumPy arrays with edge definitions.
- return_typebool, default:
False
Whether to return the edge group type. If
True
, the function returns a list of strings with these types:open
: Edge group is open-ended.closed
: Edge group forms a closed edge loop.
- sort_closedbool, default:
False
Whether to sort closed edge loops.
- edges
- Returns:
Notes
This method uses an implementation of a depth-first search. For more information, seeDepth-first search <https://en.wikipedia.org/wiki/Depth-first_search>`_ on the Wikipedia site.
Performance of this method is not tested. It might not be suitable for large arrays of edges.