pysdic.Mesh.connectivity#
- property Mesh.connectivity: Connectivity#
[Get or Set] The connectivity of the mesh in a
Connectivityinstance.The connectivity is represented as a Connectivity instance with shape (\(N_e\), \(N_{vpe}\)) where \(N_e\) is the number of elements and \(N_{vpe}\) is the number of vertices per element.
Note
This property is settable.
Warning
If the connectivity is changed, the vertices and properties may become invalid. Please ensure to recompute or update them accordingly.
To change the number of elements, it is recommended to create a new Mesh instance with the updated vertices and connectivity rather than modifying the connectivity in place. For memory considerations, you can also modify the connectivity in place, but please ensure that all necessary checks are performed before using this mode.
- Parameters:
value (Union[
Connectivity, ArrayLike]) – The new connectivity for the mesh with shape (\(N_e\), \(N_{vpe}\)).- Returns:
The connectivity of the mesh as a Connectivity instance of shape (\(N_e\), \(N_{vpe}\)).
- 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")
Access the connectivity of the mesh.
1print(mesh3d.connectivity) 2# Output: Connectivity with 4 elements [[0, 1, 2], [0, 1, 3], [0, 2, 3], [1, 2, 3]]