pysdic.Mesh.get_used_vertices_mask#

Mesh.get_used_vertices_mask()[source]#

Get a boolean mask indicating which vertices are used in the connectivity of the mesh.

Returns:

A boolean array of shape (\(N_v\),) where \(N_v\) is the number of vertices in the mesh, indicating which vertices are used (True) or unused (False) in the connectivity.

Return type:

numpy.ndarray

Examples

Create a simple Mesh instance.

1import numpy as np
2from pysdic import Mesh, PointCloud
3
4points = np.array([[0, 0, 0], [1, 0, 0], [0, 1, 0], [0, 0, 1], [1, 1, 1]])
5connectivity = np.array([[0, 1, 2], [0, 1, 3], [0, 2, 3], [1, 2, 3]])
6mesh3d = Mesh(points, connectivity, element_type="triangle_3")

Get the mask of used vertices in the connectivity.

1used_vertices_mask = mesh3d.get_used_vertices_mask()
2print(used_vertices_mask)
3# Output: [ True  True  True  True False]