UnstructuredGrid.celltypes#
- property UnstructuredGrid.celltypes: NumpyArray[np.uint8][source]#
Return the cell types array.
The array contains integer values corresponding to the
pyvista.Cell.typeof each cell in the dataset. See thepyvista.CellTypeenum for more information about cell type.- Returns:
numpy.ndarrayArray of cell types.
Examples#
Download Python source code | Download Jupyter notebook
This mesh contains only linear hexahedral cells, type
pyvista.CellType.HEXAHEDRON, which evaluates to 12.
>>> from pyvista import examples
>>> hex_beam = examples.load_hexbeam()
>>> hex_beam.celltypes
array([12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
12, 12, 12, 12, 12, 12], dtype=uint8)
Compare this to distinct_cell_types.
>>> hex_beam.distinct_cell_types
{<CellType.HEXAHEDRON: 12>}