pysdic.Mesh.n_vertices#
- property Mesh.n_vertices: int#
[Get] The number of vertices \(N_v\) in the mesh - alias for
self.vertices.n_pointsproperty. This method is equivalent to callingself.n_pointsproperty of the vertices, but is provided for convenience and readability when working with meshes.- Returns:
The number of vertices in the mesh.
- Return type:
Examples
Create a simple
Meshinstance.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]]) 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 number of vertices in the mesh.
1print(mesh3d.n_vertices) 2# Output: 4