pysdic.Mesh.to_vtk#

Mesh.to_vtk(*, save_properties=True)[source]#

Convert the mesh to a vtkUnstructuredGrid (only for \(E = 3\)).

The element type must be set and the mesh must not be empty. The vertex properties are saved as point data arrays and the element properties as cell data arrays (named after the properties).

Note

VTK arrays have at most 2 dimensions: a property of shape \((N, A, B)\) raises a ValueError. Boolean properties are stored as uint8 arrays.

Parameters:

save_properties (bool, optional (default: True)) – If False, the properties are not saved.

Returns:

The VTK representation of the mesh (with copies of the arrays).

Return type:

vtkUnstructuredGrid

Raises:

ValueError – If \(E \neq 3\), if the mesh is empty or has no element type, or if a property has more than 2 dimensions.