centrz

Query.centrz(e)

Return the z coordinate of the element centroid.

Fetches centroid Z-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.

Return type

float

Returns

float – The centroid coordinate.

Examples

Here we construct a line between the coordinates (0, 0, 0) and (1, 2, 3) then find the centroid z-coordinate of this element.

>>> from ansys.mapdl.core.inline_functions import Query
>>> 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)
>>> q = Query(mapdl)
>>> q.centrz(e0)
1.5