discretize.SimplexMesh.read_vtk#

classmethod SimplexMesh.read_vtk(file_name, directory='')[source]#

Read VTK unstructured file (vtu or xml) and return a discretize simplex mesh (and models).

This method reads a VTK unstructured file (vtu or xml format) and returns the SimplexMesh as well as a dictionary containing any models. The keys in the model dictionary correspond to the file names of the models.

Parameters:
file_namestr

full path to the VTK unstructured file (vtr or xml) containing the mesh (and models) or just the file name if the directory is specified.

directorystr, optional

directory where the file lives

Returns:
meshdiscretize.SimplexMesh

The tensor mesh object.

model_dictdict of [str, (n_cells) numpy.ndarray]

A dictionary containing the models. The keys correspond to the names of the models.