pytuflow.GridMesh

pytuflow.GridMesh#

class GridMesh(fpath, grid=None, base_topology=None)#

Bases: Mesh

Class for loading Grid datasets into a mesh structure. This has no notable advantages over using the Grid class, other than providing some additional export functionality inherited from the Mesh class.

It’s possible to convert to a GridMesh from the Grid class by using the Grid.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 fpath parameter. This parameter takes precedence over the fpath parameter.

  • base_topology (Grid, optional) – An optional base topology Grid object to define the mesh structure. The Grid should 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.

Examples

>>> from pytuflow import GridMesh
>>> mesh = GridMesh('/path/to/results/grid/Model_Max_h.tif')
__init__(fpath, grid=None, base_topology=None)#
Parameters:
  • fpath (Path | str)

  • grid (Grid | None)

  • base_topology (Grid | None)

Methods

data_point

Extracts the data value for the given point locations and data types at the specified time.

data_types

Return the available data types for the given filter.

maximum

Returns the maximum values for the given data types.

minimum

Returns the minimum values for the given data types.

section

Extracts section data for the given locations and data types.

surface

Returns the value for every cell/vertex at the specified time.

time_series

Extracts time-series data for the given locations and data types.

times

Returns a list of times for the given filter.

to_alembic

Exports the mesh to an Alembic file for visualisation in compatible software.

to_gltf

Exports the mesh to a glTF 2.0 file for visualisation in compatible software.

Attributes

ATTRIBUTE_TYPES

DOMAIN_TYPES

GEOMETRY_TYPES

ID_COLUMNS

spherical

Returns whether the mesh is in spherical coordinates.

name

The result name

has_reference_time

Does the result have an inherent reference time.

reference_time

The reference time for the output