pyvista.DataSetFilters.compute_cell_quality

pyvista.DataSetFilters.compute_cell_quality#

DataSetFilters.compute_cell_quality(
quality_measure: str = 'scaled_jacobian',
null_value: float = -1.0,
progress_bar: bool = False,
)[source]#

Compute a function of (geometric) quality for each cell of a mesh.

The per-cell quality is added to the mesh’s cell data, in an array named "CellQuality". Cell types not supported by this filter or undefined quality of supported cell types will have an entry of -1.

Defaults to computing the scaled Jacobian.

Options for cell quality measure:

  • 'area'

  • 'aspect_beta'

  • 'aspect_frobenius'

  • 'aspect_gamma'

  • 'aspect_ratio'

  • 'collapse_ratio'

  • 'condition'

  • 'diagonal'

  • 'dimension'

  • 'distortion'

  • 'jacobian'

  • 'max_angle'

  • 'max_aspect_frobenius'

  • 'max_edge_ratio'

  • 'med_aspect_frobenius'

  • 'min_angle'

  • 'oddy'

  • 'radius_ratio'

  • 'relative_size_squared'

  • 'scaled_jacobian'

  • 'shape'

  • 'shape_and_size'

  • 'shear'

  • 'shear_and_size'

  • 'skew'

  • 'stretch'

  • 'taper'

  • 'volume'

  • 'warpage'

Note

Refer to the Verdict Library Reference Manual for low-level technical information about how each metric is computed, which CellType it applies to as well as the metric’s full, normal, and acceptable range of values.

Deprecated since version 0.45: Use cell_quality() instead. Note that this new filter does not include an array named 'CellQuality'.

Parameters:
quality_measurestr, default: ‘scaled_jacobian’

The cell quality measure to use.

null_valuefloat, default: -1.0

Float value for undefined quality. Undefined quality are qualities that could be addressed by this filter but is not well defined for the particular geometry of cell in question, e.g. a volume query for a triangle. Undefined quality will always be undefined. The default value is -1.

progress_barbool, default: False

Display a progress bar to indicate progress.

Returns:
pyvista.DataSet

Dataset with the computed mesh quality in the cell_data as the "CellQuality" array.

Examples

Compute and plot the minimum angle of a sample sphere mesh.

>>> import pyvista as pv
>>> sphere = pv.Sphere(theta_resolution=20, phi_resolution=20)
>>> cqual = sphere.compute_cell_quality('min_angle')
>>> cqual.plot(show_edges=True)

See the Computing Mesh Quality for more examples using this filter.