ogs5py.tools.tools.centroid

ogs5py.tools.tools.centroid(typ, *pnt)[source]

Centroid of a OGS5 Meshelement.

Parameters:
  • typ (string) –

    OGS5 Meshelement type. Should be one of the following:

    • “line” : 1D element with 2 nodes

    • “tri” : 2D element with 3 nodes

    • “quad” : 2D element with 4 nodes

    • “tet” : 3D element with 4 nodes

    • “pyra” : 3D element with 5 nodes

    • “pris” : 3D element with 6 nodes

    • “hex” : 3D element with 8 nodes

  • *pnt (Node Choordinates pnt = (x_0, x_1, ...)) – List of points defining the Meshelement. A point is given as an (x,y,z) tuple and for each point, there can be a stack of points, if the volume should be calculated for multiple elements of the same type.

Returns:

centroid – Array containing the Centroids of the give elements.

Return type:

ndarray

Notes

The calculation is performed by geometric decomposition of the elements.

https://en.wikipedia.org/wiki/Centroid#By_geometric_decomposition