Skip to main content

API reference

Generate, refine and check

Everything public is available from the top-level package refined_quads.

generate Generate a refined quad mesh over a domain.
refine Refine an existing mesh locally with new refinement areas.
check Check a mesh for hanging nodes, 2:1 balance, FM orthogonality and orientation.
MeshReport Result of :func:check.

Meshes

Mesh An immutable refined quad mesh.
Lattice The fixed grid of points on which every square of a refined quad mesh has its corners.
RefineResult The result of :func:refine.
ReplacementMap What a refine did to the cells of the existing mesh.

GIS input

read_domain Read the domain from a GIS layer; its polygons are merged into one.
read_refinement_areas Read refinement areas from a GIS layer.
read_water_areas Read water areas from a GIS layer.
Areas Polygons with their coordinate reference system.

UGRID net files

read_ugrid Read the 2D mesh of a UGRID netCDF file.
write_ugrid Write a mesh as a UGRID-1.0 netCDF file that D-HYDRO and D-Flow FM read.

Runs from a TOML file

MeshSpec Everything refined-quads generate needs; one-to-one with the TOML file.
RefineSpec Everything refined-quads refine needs besides the mesh; one-to-one with the TOML.
LayerSource A layer of a GeoPackage or shapefile.
RefinementSource A layer with refinement areas.

Errors

InputError Invalid input: the package raises this instead of silently adjusting the input.
Cancelled The run was cancelled through the progress callback.
MeshRecognitionError An existing mesh is not a refined quad mesh this package can refine.
OrthogonalityRepairError The orthogonality repair could not make every internal edge FM-orthogonal.

Command line

Exit codes 0 success, 1 the run failed, 2 invalid input or arguments.

main Run the command-line interface.
build_parser Build the argument parser of the refined-quads command.