mymesh.utils.CleanupDegenerateElements#
- mymesh.utils.CleanupDegenerateElements(NodeCoords, NodeConn, Type='auto', return_idx=False)[source]#
Checks for elements with degenerate edges and either changes the element type or removes the element depending on how degenerate it is. Elements with less than 3 (for surface meshes) or 4 (for volume meshes) unique nodes will be deleted, others will be reduced (ex. a quad with 3 unique nodes will be converted to a triangle). The ordering of nodes will be kept.
This function only changes the mesh of an element in NodeConn has the same node number more than once. For meshes that have two differently numbered nodes at the same location, first use utils.DeleteDuplicateNodes.
- Parameters:
NodeCoords (array_like) – Node coordinates
NodeConn (list, array_like) – Node connectivity
Type (str, optional) – Specifies whether the mesh contains surface elements (tris, quads) or volume elements (tets, hexs, etc.). Must be either “auto”, “surf” or “vol”. If “auto”, Type will be inferred using
identify_type()
. By default “auto”.
- Returns:
NodeCoords (array_like) – Node coordinates (these are simply passed through from the input)
NewConn (list, array_like) – Updated node connectivity idx : np.ndarray Array of indices that convert from the original list of elements IDs to the new list of element IDs