The VTK library supports parallel file formats. Reading meshes broken up into several files is natively supported by VTK and PyVista.
import os import pyvista as pv from pyvista import examples
Let’s go ahead and download the sample dataset containing an
pyvista.UnstructuredGrid broken up into several files.
Let’s inspect where this downloaded our dataset by setting
looking at the directory containing the file we downloaded.
['000.vtu', '002.vtu', '003.vtu', '001.vtu']
Note that a
.pvtu file is available alongside a directory. This
directory contains all the parallel files or pieces that make the whole mesh.
We can simply read the
.pvtu file and VTK will handle putting the mesh
mesh = pv.read(filename) mesh
Plot the pieced together mesh
Total running time of the script: ( 0 minutes 4.590 seconds)