pytuflow.GridMesh#
- class GridMesh(fpath, grid=None, base_topology=None, direction_convention='arithmetic')#
Bases:
MeshClass for loading Grid datasets into a mesh structure. This has no notable advantages over using the
Gridclass, other than providing some additional export functionality inherited from theMeshclass.It’s possible to convert to a
GridMeshfrom theGridclass by using theGrid.to_mesh()method.- Parameters:
fpath (PathLike) – Path to the Grid dataset file.
grid (Grid, optional) – An existing Grid object. If not provided, a new Grid object will be created from the
fpathparameter. This parameter takes precedence over thefpathparameter.base_topology (Grid, optional) – An optional base topology Grid object to define the mesh structure. The
Gridshould match the dimensions and extent of the dataset being loaded. Typically only required when working with datasets that are temporal or contain multiple data types.direction_convention (str, optional) –
The convention used for direction data. Only required converting direction to vector or interpolating direction to vertices. Options are:
"arithmetic"(default) - direction is measured anticlockwise from the positive x-axis (east)"nautical"- direction is measured clockwise from the positive y-axis (north)
Examples
>>> from pytuflow import GridMesh >>> mesh = GridMesh('/path/to/results/grid/Model_Max_h.tif')
- __init__(fpath, grid=None, base_topology=None, direction_convention='arithmetic')#
Methods
Adds an additional dataset to the mesh class.
Extracts the data value for the given point locations and data types at the specified time.
Return the available data types for the given filter.
Returns the flux across a line.
A convenience function that integrates the curve returned from the
flux()method.Load the given data types into memory.
Returns the maximum values for the given data types.
Returns the mesh dataset as a pyvista.PolyData instance.
Returns the minimum values for the given data types.
Extracts section data for the given locations and data types.
Returns the value for every cell/vertex at the specified time.
Extracts time-series data for the given locations and data types.
Returns a list of times for the given filter.
Exports the mesh to an Alembic file for visualisation in compatible software.
Exports the mesh to a glTF 2.0 file for visualisation in compatible software.
Attributes
Returns whether the mesh is in spherical coordinates.
The result name
Does the result have an inherent reference time.
The reference time for the output