discretize.SimplexMesh.to_vtk#

SimplexMesh.to_vtk(models=None)[source]#

Convert mesh (and models) to corresponding VTK or PyVista data object.

This method converts a discretize mesh (and associated models) to its corresponding VTK or PyVista data object.

Parameters:
modelsdict of [str, (n_cells) numpy.ndarray], optional

Models are supplied as a dictionary where the keys are the model names. Each model is a 1D numpy.ndarray of size (n_cells).

Returns:
pyvista.UnstructuredGrid, pyvista.RectilinearGrid or pyvista.StructuredGrid

The corresponding VTK or PyVista data object for the mesh and its models