set_default_active_vectors

set_default_active_vectors#

set_default_active_vectors(mesh: DataSet) _ActiveArrayExistsInfoTuple[source]#

Set a default vectors array on mesh, if not already set.

If an active vector already exists, no changes are made.

If an active vectors does not exist, it checks for possibly cell or point arrays with shape (n, 3). If only one exists, then it is set as the active vectors. Otherwise, an error is raised.

Changed in version 0.45: The field and name of the active array is now returned. Previously, None was returned.

Parameters:
meshpyvista.DataSet

Dataset to set default active vectors.

Returns:
tuple[FieldAssociation, str]

The field and name of the active array.

Raises:
pyvista.core.errors.MissingDataError

If no vector-like arrays exist.

pyvista.core.errors.AmbiguousDataError

If more than one vector-like arrays exist.