mesh.Mesh.centroids#
- Mesh.centroids()#
Return the centroids of all elements of the Mesh.
The centroid of an element is the point with coordinates equal to the average of those of all nodes of the element.
Returns#
- Coords
A Coords object with shape (
n_elems(), 3), holding the centroids of all the elements in the Mesh.
Examples#
>>> M = Mesh(eltype='quad4').subdivide(2) >>> print(M.centroids()) [[0.25 0.25 0. ] [0.75 0.25 0. ] [0.25 0.75 0. ] [0.75 0.75 0. ]]