gstools.tools.to_vtk
- gstools.tools.to_vtk(pos, fields, mesh_type='unstructured')[source]
Create a VTK/PyVista grid.
- Parameters
pos (
list
) – the position tuple, containing main direction and transversal directionsfields (
dict
ornumpy.ndarray
) – [Un]structured fields to be saved. Either a single numpy array as returned by SRF, or a dictionary of fields with theirs names as keys.mesh_type (
str
, optional) – ‘structured’ / ‘unstructured’. Default: structured
- Returns
This will return a PyVista object for the given field data in its appropriate type. Structured meshes will return a
pyvista.RectilinearGrid
and unstructured meshes will return anpyvista.UnstructuredGrid
object.- Return type
pyvista.RectilinearGrid
orpyvista.UnstructuredGrid