discretize.CurvilinearMesh.write_vtk#

CurvilinearMesh.write_vtk(file_name, models=None, directory='')[source]#

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

This method converts a discretize mesh (and associated models) to its corresponding VTK or PyVista data object, then writes to file. The output structure will be one of: vtkUnstructuredGrid, vtkRectilinearGrid or vtkStructuredGrid.

Parameters:
file_namestr or file name

Full path for the output file or just its name if directory is specified

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).

directorystr, optional

output directory

Returns:
str

The output of Python’s write function