uxarray.grid.Grid
uxarray.grid.Grid#
- class uxarray.grid.Grid(dataset, **kwargs)#
The Uxarray Grid object class that describes an unstructured grid.
Examples
Open an exodus file with Uxarray Grid object
>>> mesh = ux.Grid("filename.g")
Save as ugrid file
>>> mesh.write("outfile.ug")
- __init__(dataset, **kwargs)#
Initialize grid variables, decide if loading happens via file, verts or gridspec.
- Parameters
dataset (xarray.Dataset, ndarray, list, tuple, required) – Input xarray.Dataset or vertex coordinates that form one face.
islatlon (bool, optional) – Specify if the grid is lat/lon based
concave (bool, optional) – Specify if this grid has concave elements (internal checks for this are possible)
gridspec (bool, optional) – Specifies gridspec
mesh_filetype (str, optional) – Specify the mesh file type, eg. exo, ugrid, shp, etc
- Raises
RuntimeError – If specified file not found
Methods
__init__
(dataset, **kwargs)Initialize grid variables, decide if loading happens via file, verts or gridspec.
calculate_total_face_area
([quadrature_rule, ...])Function to calculate the total surface area of all the faces in a mesh.
compute_face_areas
([quadrature_rule, order])Face areas calculation function for grid class, calculates area of all faces in the grid.
integrate
(var_key[, quadrature_rule, order])Integrates over all the faces of the given mesh.
write
(outfile, grid_type)Writes mesh file as per extension supplied in the outfile string.
Attributes
face_areas
Declare face_areas as a property.