pysdic.Mesh.compute_elements_centers#
- Mesh.compute_elements_centers()[source]#
Compute the center of each element of the mesh, the image of the center of the reference element.
Shortcut for
pysdic.fem.compute_elements_centers()with the coordinates, connectivity and element type of the mesh (any element type).- Returns:
An array of shape \((N_e, E)\) with the center of each element.
- Return type:
Examples
1from pysdic import Mesh 2 3mesh = Mesh([[0, 0, 0], [3, 0, 0], [0, 3, 0]], [[0, 1, 2]], element_type="triangle_3") 4print(mesh.compute_elements_centers()) # [[1. 1. 0.]]