Append Cell Centers

This example will demonstrate how to append a dataset’s cell centers as a length 3 tuple array.

This example demonstrates PVGeo.filters.AppendCellCenters

from pyvista import examples

from PVGeo.filters import AppendCellCenters

Use an example mesh from pyvista

mesh = examples.load_rectilinear()
mesh
HeaderData Arrays
RectilinearGridInformation
N Cells16146
N Points18144
X Bounds-3.500e+02, 1.350e+03
Y Bounds-4.000e+02, 1.350e+03
Z Bounds-8.500e+02, 0.000e+00
Dimensions27, 28, 24
N Arrays1
NameFieldTypeN CompMinMax
Random DataCellsfloat6417.096e-051.000e+00


Run the PVGeo algorithm

centers = AppendCellCenters().apply(mesh)
centers
HeaderData Arrays
RectilinearGridInformation
N Cells16146
N Points18144
X Bounds-3.500e+02, 1.350e+03
Y Bounds-4.000e+02, 1.350e+03
Z Bounds-8.500e+02, 0.000e+00
Dimensions27, 28, 24
N Arrays2
NameFieldTypeN CompMinMax
Random DataCellsfloat6417.096e-051.000e+00
Cell CentersCellsfloat643-7.500e+021.250e+03


centers.plot()
append cell centers

Total running time of the script: ( 0 minutes 0.861 seconds)

Gallery generated by Sphinx-Gallery