pyvista.examples.cells.LagrangeTetrahedron

pyvista.examples.cells.LagrangeTetrahedron#

LagrangeTetrahedron(*, cell_order: int = 3) UnstructuredGrid[source]#

Create a pyvista.UnstructuredGrid containing a single Lagrange tetrahedron.

This cell corresponds to the pyvista.CellType.LAGRANGE_TETRAHEDRON cell type.

Parameters:
cell_orderint, default: 3

Order of interpolation to use.

Returns:
pyvista.UnstructuredGrid

UnstructuredGrid containing a single Lagrange tetrahedron.

Examples

Create and plot a single Lagrange tetrahedron.

>>> from pyvista import examples
>>> grid = examples.cells.LagrangeTetrahedron()
>>> examples.plot_cell(grid)
../../../_images/pyvista-examples-cells-LagrangeTetrahedron-e083572940b6f306_00_00.png

List the grid’s cells.

>>> grid.cells
array([20,  0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15,
       16, 17, 18, 19])

List the grid’s points.

>>> grid.points
pyvista_ndarray([[0.        , 0.        , 0.        ],
                 [1.        , 0.        , 0.        ],
                 [1.        , 1.        , 0.        ],
                 [0.5       , 0.5       , 0.5       ],
                 [0.33333334, 0.        , 0.        ],
                 [0.66666669, 0.        , 0.        ],
                 [1.        , 0.33333334, 0.        ],
                 [1.        , 0.66666669, 0.        ],
                 [0.66666669, 0.66666669, 0.        ],
                 [0.33333334, 0.33333334, 0.        ],
                 [0.16666667, 0.16666667, 0.16666667],
                 [0.33333334, 0.33333334, 0.33333334],
                 [0.83333331, 0.16666667, 0.16666667],
                 [0.66666669, 0.33333334, 0.33333334],
                 [0.83333331, 0.83333331, 0.16666667],
                 [0.66666669, 0.66666669, 0.33333334],
                 [0.5       , 0.16666667, 0.16666667],
                 [0.83333331, 0.5       , 0.16666667],
                 [0.5       , 0.5       , 0.16666667],
                 [0.66666669, 0.33333334, 0.        ]])
>>> grid.celltypes  # same as pyvista.CellType.LAGRANGE_TETRAHEDRON
array([71], dtype=uint8)