centry#
- Query.centry(e)#
Return the y coordinate of the element centroid.
Fetches centroid Y-coordinate of element
e
in global Cartesian coordinate system. Centroid is determined from the selected nodes on the element.- Parameters:
- e
int
The element number of the element to be considered.
- e
- Returns:
float
The centroid coordinate.
- Return type:
Examples
Here we construct a line between the coordinates (0, 0, 0) and (1, 2, 3) then find the centroid y-coordinate of this element.
>>> from ansys.mapdl.core import launch_mapdl >>> mapdl = launch_mapdl() >>> mapdl.prep7() >>> n0 = mapdl.n(1, 0, 0, 0) >>> n1 = mapdl.n(2, 1, 2, 3) >>> mapdl.et(1, 'LINK11') >>> e0 = mapdl.e(n0, n1) >>> mapdl.queries.centry(e0) 1.0