discretize.TensorMesh.write_vtk#
- TensorMesh.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
discretizemesh (and associated models) to its corresponding VTK or PyVista data object, then writes to file. The output structure will be one of:vtkUnstructuredGrid,vtkRectilinearGridorvtkStructuredGrid.- Parameters:
- file_name
strorfilename Full path for the output file or just its name if directory is specified
- models
dictof[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.ndarrayof size (n_cells).- directory
str,optional output directory
- file_name
- Returns:
strThe output of Python’s write function