pyvista.ExplicitStructuredGrid.compute_connectivity#

ExplicitStructuredGrid.compute_connectivity(
inplace: bool = False,
) ExplicitStructuredGrid[source]#

Compute the faces connectivity flags array.

This method checks the faces connectivity of the cells with their topological neighbors. The result is stored in the array of integers 'ConnectivityFlags'. Each value in this array must be interpreted as a binary number, where the digits shows the faces connectivity of a cell with its topological neighbors -Z, +Z, -Y, +Y, -X and +X respectively. For example, a cell with 'ConnectivityFlags' equal to 27 (011011) indicates that this cell is connected by faces with their neighbors (0, 0, 1), (0, -1, 0), (-1, 0, 0) and (1, 0, 0).

Parameters:
inplacebool, default: False

This method is applied to this grid if True or to a copy otherwise.

Returns:
ExplicitStructuredGrid

A deep copy of this grid if inplace=False, or this DataSet if otherwise.

See also

ExplicitStructuredGrid.compute_connections

Compute an array with the number of connected cell faces.

Examples

>>> from pyvista import examples
>>>
>>> grid = examples.load_explicit_structured()
>>> grid = grid.compute_connectivity()
>>> grid.plot(show_edges=True)
../../../_images/pyvista-ExplicitStructuredGrid-compute_connectivity-1_00_00.png