spatial#
hydromodpy.spatial carries the spatial-support stack: catchment
delineation, geographic context, domain definition, mesh generation,
and the field abstractions that bridge geology to solver inputs.
Sub-modules#
spatial/delineation/– backend-agnostic delineation. Default backends:WhiteboxWorkflowsBackend(D8 on a DEM raster) andSyntheticBackend. Other backends register throughregister_backend().spatial/geographic/– pre-simulation pipeline:flow_products(D8 correction and accumulation rasters),catchment_from_pointandcatchment_from_polygon,river_network(Strahler order, pruning),hydrographic_network(canonical concept shared with comparison and display layers),domain_geographic_pipeline(high-level orchestration).spatial/domain/–Domainaggregatessurface_topo,substratum(via depth model), andzones. Two depth models ship:ConstantThicknessDepthModel(homogeneous offset),FlatSubstratumDepthModel(fixed elevation).spatial/mesh/cartesian_grid/– DIS / structured path. PydanticSGridConfig,StructuredGridBuilder, FloPyStructuredGridoutput.spatial/mesh/gmsh_grid/– DISV / unstructured path. Conformal Gmsh meshing from polygons (geology, river network),catchment_mesh_bundlefor self-contained export,extruded_prism_meshfor vertical extrusion to 3D.spatial/field/–FieldSpatial(geometric zones),FieldParam(homogeneous or per-zone values with vertical profile), and theHydroMeshpivot that unifies every mesh representation.
Key public symbols#
hydromodpy.spatial.delineation.WhiteboxWorkflowsBackendhydromodpy.spatial.geographic.flow_productshydromodpy.spatial.geographic.river_networkhydromodpy.spatial.geographic.hydrographic_network.HydrographicNetworkhydromodpy.spatial.domain.Domainhydromodpy.spatial.mesh.cartesian_grid.{SGridConfig, StructuredGridBuilder}hydromodpy.spatial.mesh.gmsh_grid.GmshPlanarMesh2Dhydromodpy.spatial.mesh.gmsh_grid.ExtrudedPrismMesh3Dhydromodpy.spatial.mesh.HydroMeshhydromodpy.spatial.field.core.{FieldSpatial, FieldParam}
HydroMesh pivot#
HydroMesh is a frozen dataclass that represents any 2D or 3D
mesh in a uniform way:
mesh = HydroMesh(
vertices=points_xy,
cell_blocks=(CellBlock(CellType.TRIANGLE, conn),),
cell_data={"K": conductivity_array},
point_data={},
structured_shape=(nrow, ncol), # optional hint
)
Every concrete mesh class exposes .to_hydro_mesh(). The pivot
unifies plotting, VTU I/O, and conversions toward FloPy’s
StructuredGrid (DIS) and DISV. See Mesh Architecture Pivot
for the full reference.
Recommended reading path#
hydromodpy/spatial/geographic/README.mdhydromodpy/spatial/geographic/domain_geographic_pipeline.pyhydromodpy/spatial/domain/domain.pyhydromodpy/spatial/field/README.mdfor the FieldSpatial / FieldParam contract.hydromodpy/spatial/mesh/README.mdfor the meshing routes.hydromodpy/spatial/mesh/cartesian_grid/README.mdfor DIS path.hydromodpy/spatial/mesh/gmsh_grid/README.mdfor DISV path.
Layer-matrix neighbours#
Allowed targets:
core,schema,spatial.Allowed sources:
simulation,solver,calibration,results(tolerance),physics(tolerance forFieldSection),data(tolerance for geology field).New cross-edges into
spatialare not added without a clear rationale; the layer is intentionally narrow.
See also#
Mesh Architecture Pivot –
HydroMeshpivot reference.Conformal Gmsh Meshing – conformal Gmsh pipeline.
Catchment-Mesh Architecture – catchment-mesh workflow.
Structured Grid Architecture – StructuredGrid path.
Spatial Support and Hydrography – spatial-support selection guide.
Field Architecture – field abstractions.