OpenSWMM Engine  6.0.0-alpha.1
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.1)
Loading...
Searching...
No Matches
2D Surface Routing API
Collaboration diagram for 2D Surface Routing API:

Files

file  Api2D.cpp
 C API implementation for the 2D surface routing module.
 
file  Api2D.hpp
 C API implementation bridge for the 2D surface routing module.
 
file  NodeCoupling.cpp
 Implementation of 2D↔1D node coupling via orifice exchange.
 
file  NodeCoupling.hpp
 Orifice-equation exchange between 2D surface and SWMM nodes.
 
file  BoundaryData.hpp
 Structure-of-Arrays (SoA) storage for 2D mesh boundary conditions.
 
file  MeshData.hpp
 Structure-of-Arrays (SoA) storage for 2D triangular mesh geometry.
 
file  SolverOptions2D.hpp
 Configuration options for the 2D surface routing solver.
 
file  SurfaceStateData.hpp
 Structure-of-Arrays (SoA) storage for 2D surface routing state.
 
file  SectionHandlers2D.cpp
 Implementation of 2D input section parsers.
 
file  SectionHandlers2D.hpp
 Input section parsers for the 2D surface routing module.
 
file  MeshBuilder.cpp
 Implementation of mesh topology construction and geometry computation.
 
file  MeshBuilder.hpp
 Topology construction and geometry precomputation for the 2D mesh.
 
file  VertexReconstruction.cpp
 Implementation of pseudo-Laplacian vertex stencil construction and head reconstruction.
 
file  VertexReconstruction.hpp
 Pseudo-Laplacian vertex reconstruction stencil computation.
 
file  Default2DOutputPlugin.cpp
 HDF5 output plugin for 2D surface routing results (CF/UGRID).
 
file  Default2DOutputPlugin.hpp
 Built-in HDF5 output plugin for 2D surface routing results.
 
file  CvodeSurfaceSolver.cpp
 Implementation of CVODE wrapper for 2D surface routing.
 
file  CvodeSurfaceSolver.hpp
 CVODE (SUNDIALS) wrapper for the 2D surface routing ODE system.
 
file  SurfaceFluxCalculator.cpp
 Implementation of gradient computation, slope limiting, and edge fluxes.
 
file  SurfaceFluxCalculator.hpp
 Edge flux computation, gradient calculation, and slope limiting.
 
file  SurfaceRouter2D.cpp
 Implementation of the 2D surface routing orchestrator.
 
file  SurfaceRouter2D.hpp
 Top-level orchestrator for the optional 2D surface routing module.
 

Functions

SWMM_ENGINE_API int swmm_2d_is_active (SWMM_Engine engine, int *active)
 Check whether the 2D module is active for this simulation.
 
SWMM_ENGINE_API int swmm_2d_vertex_count (SWMM_Engine engine, int *count)
 Get the number of mesh vertices.
 
SWMM_ENGINE_API int swmm_2d_triangle_count (SWMM_Engine engine, int *count)
 Get the number of mesh triangles.
 
SWMM_ENGINE_API int swmm_2d_vertex_get_xyz (SWMM_Engine engine, int idx, double *x, double *y, double *z)
 Get vertex coordinates.
 
SWMM_ENGINE_API int swmm_2d_vertex_get_xyz_bulk (SWMM_Engine engine, double *x, double *y, double *z)
 Bulk get vertex coordinates.
 
SWMM_ENGINE_API int swmm_2d_set_vertex_z (SWMM_Engine engine, int idx, double z)
 Set vertex Z (ground elevation).
 
SWMM_ENGINE_API int swmm_2d_triangle_get_vertices (SWMM_Engine engine, int idx, int *v0, int *v1, int *v2)
 Get triangle connectivity (3 vertex indices).
 
SWMM_ENGINE_API int swmm_2d_triangle_get_area (SWMM_Engine engine, int idx, double *area)
 Get triangle area.
 
SWMM_ENGINE_API int swmm_2d_triangle_get_centroid (SWMM_Engine engine, int idx, double *cx, double *cy, double *cz)
 Get triangle centroid coordinates.
 
SWMM_ENGINE_API int swmm_2d_triangle_get_mannings (SWMM_Engine engine, int idx, double *n)
 Get triangle Manning's roughness.
 
SWMM_ENGINE_API int swmm_2d_triangle_get_neighbours (SWMM_Engine engine, int idx, int *n0, int *n1, int *n2)
 Get triangle neighbour indices (-1 = boundary edge).
 
SWMM_ENGINE_API int swmm_2d_edge_get_geometry_bulk (SWMM_Engine engine, double *length, double *nx, double *ny)
 Bulk get edge geometry — time-invariant edge length and outward unit normal components, indexed [tri*3 + localEdge].
 
SWMM_ENGINE_API int swmm_2d_vertex_coupling_count (SWMM_Engine engine, int *count)
 Get the number of vertex-to-node coupling points.
 
SWMM_ENGINE_API int swmm_2d_triangle_coupling_count (SWMM_Engine engine, int *count)
 Get the number of triangle-to-node coupling points.
 
SWMM_ENGINE_API int swmm_2d_vertex_get_coupled_node (SWMM_Engine engine, int vertex_idx, int *node_idx)
 Get vertex coupling: which SWMM node is coupled to this vertex.
 
SWMM_ENGINE_API int swmm_2d_triangle_get_coupled_node (SWMM_Engine engine, int tri_idx, int *node_idx)
 Get triangle coupling: which SWMM node is coupled to this triangle.
 
SWMM_ENGINE_API int swmm_2d_get_depth (SWMM_Engine engine, int idx, double *depth)
 Get water depth at a triangle.
 
SWMM_ENGINE_API int swmm_2d_get_head (SWMM_Engine engine, int idx, double *head)
 Get total head at a triangle (z + depth).
 
SWMM_ENGINE_API int swmm_2d_get_coupling_flux (SWMM_Engine engine, int idx, double *flux)
 Get coupling exchange flux at a triangle (m/s, + = into 2D).
 
SWMM_ENGINE_API int swmm_2d_get_rainfall (SWMM_Engine engine, int idx, double *rainfall)
 Get rainfall intensity at a triangle (m/s).
 
SWMM_ENGINE_API int swmm_2d_get_net_source (SWMM_Engine engine, int idx, double *net_source)
 Get net source/sink rate at a triangle (m/s).
 
SWMM_ENGINE_API int swmm_2d_get_depths_bulk (SWMM_Engine engine, double *depths)
 Bulk get depths for all triangles.
 
SWMM_ENGINE_API int swmm_2d_get_heads_bulk (SWMM_Engine engine, double *heads)
 Bulk get heads for all triangles.
 
SWMM_ENGINE_API int swmm_2d_get_coupling_fluxes_bulk (SWMM_Engine engine, double *fluxes)
 Bulk get coupling fluxes for all triangles.
 
SWMM_ENGINE_API int swmm_2d_get_edge_flux_bulk (SWMM_Engine engine, double *flux)
 Bulk get normal edge flux at every edge of every triangle.
 
SWMM_ENGINE_API int swmm_2d_vertex_get_head (SWMM_Engine engine, int idx, double *head)
 Get reconstructed head at a vertex.
 
SWMM_ENGINE_API int swmm_2d_vertex_get_heads_bulk (SWMM_Engine engine, double *heads)
 Bulk get reconstructed heads at all vertices.
 
SWMM_ENGINE_API int swmm_2d_get_max_depth (SWMM_Engine engine, double *max_depth)
 Get the maximum depth across all triangles.
 
SWMM_ENGINE_API int swmm_2d_get_total_volume (SWMM_Engine engine, double *volume)
 Get total 2D surface volume (sum of depth * area).
 
SWMM_ENGINE_API int swmm_2d_get_total_exchange_flow (SWMM_Engine engine, double *flow)
 Get total exchange flow rate (sum of all coupling flows, m³/s). Positive = net flow from 2D into 1D network.
 
SWMM_ENGINE_API int swmm_2d_get_cvode_steps (SWMM_Engine engine, long *steps)
 Get number of CVODE internal steps taken in the last advance.
 
SWMM_ENGINE_API int swmm_2d_get_cvode_last_step (SWMM_Engine engine, double *h_last)
 Get CVODE last internal step size.
 
SWMM_ENGINE_API int swmm_2d_get_stat_max_depths (SWMM_Engine engine, double *max_depths)
 Get per-triangle max depth statistics (cumulative).
 
SWMM_ENGINE_API int swmm_2d_force_rainfall (SWMM_Engine engine, int idx, double value, int mode, int persist)
 Force rainfall on a specific triangle.
 
SWMM_ENGINE_API int swmm_2d_force_rainfall_uniform (SWMM_Engine engine, double value, int mode, int persist)
 Force rainfall on all triangles (uniform).
 
SWMM_ENGINE_API int swmm_2d_force_coupling_flux (SWMM_Engine engine, int idx, double value, int mode, int persist)
 Force coupling flux on a specific triangle (override computed exchange).
 
SWMM_ENGINE_API int swmm_2d_force_clear_all (SWMM_Engine engine)
 Clear all 2D forcings.
 
SWMM_ENGINE_API int swmm_2d_get_dry_depth (SWMM_Engine engine, double *dry_depth)
 Get the dry depth threshold (m).
 
SWMM_ENGINE_API int swmm_2d_set_dry_depth (SWMM_Engine engine, double dry_depth)
 Set the dry depth threshold (m).
 
SWMM_ENGINE_API int swmm_2d_get_rel_tolerance (SWMM_Engine engine, double *rtol)
 Get CVODE relative tolerance.
 
SWMM_ENGINE_API int swmm_2d_set_rel_tolerance (SWMM_Engine engine, double rtol)
 Set CVODE relative tolerance.
 
SWMM_ENGINE_API int swmm_2d_get_abs_tolerance (SWMM_Engine engine, double *atol)
 Get CVODE absolute tolerance.
 
SWMM_ENGINE_API int swmm_2d_set_abs_tolerance (SWMM_Engine engine, double atol)
 Set CVODE absolute tolerance.
 
SWMM_ENGINE_API int swmm_2d_boundary_edge_count (SWMM_Engine engine, int *count)
 Get the number of boundary edges (edges with no neighbour).
 
SWMM_ENGINE_API int swmm_2d_get_edge_bc_type (SWMM_Engine engine, int tri_idx, int edge, int *bc_type)
 Get boundary condition type for an edge.
 
SWMM_ENGINE_API int swmm_2d_set_edge_bc_type (SWMM_Engine engine, int tri_idx, int edge, int bc_type)
 Set boundary condition type for an edge.
 
SWMM_ENGINE_API int swmm_2d_get_edge_bc_head (SWMM_Engine engine, int tri_idx, int edge, double *head)
 Get specified stage boundary head for an edge.
 
SWMM_ENGINE_API int swmm_2d_set_edge_bc_head (SWMM_Engine engine, int tri_idx, int edge, double head)
 Set specified stage boundary head for an edge.
 
SWMM_ENGINE_API int swmm_2d_get_edge_bc_slope (SWMM_Engine engine, int tri_idx, int edge, double *slope)
 Get normal flow boundary slope for an edge.
 
SWMM_ENGINE_API int swmm_2d_set_edge_bc_slope (SWMM_Engine engine, int tri_idx, int edge, double slope)
 Set normal flow boundary slope for an edge.
 
SWMM_ENGINE_API int swmm_2d_set_edge_bc_tseries_name (SWMM_Engine engine, int tri_idx, int edge, const char *name)
 Set the timeseries NAME to drive a SPECIFIED_STAGE edge.
 
SWMM_ENGINE_API int swmm_2d_get_edge_bc_flow (SWMM_Engine engine, int tri_idx, int edge, double *flow)
 Get prescribed flow per metre of edge (m³/s/m) for a SPECIFIED_FLOW edge. V-E4.
 
SWMM_ENGINE_API int swmm_2d_get_edge_bc_cum_flux (SWMM_Engine engine, int tri_idx, int edge, double *cum_flux)
 Get cumulative boundary flux at an edge (m³, + = outflow).
 

Detailed Description

Author
Caleb Buahin caleb.nosp@m..bua.nosp@m.hin@g.nosp@m.mail.nosp@m..com
License\n MIT License

Function Documentation

◆ swmm_2d_boundary_edge_count()

SWMM_ENGINE_API int swmm_2d_boundary_edge_count ( SWMM_Engine  engine,
int *  count 
)

Get the number of boundary edges (edges with no neighbour).

◆ swmm_2d_edge_get_geometry_bulk()

SWMM_ENGINE_API int swmm_2d_edge_get_geometry_bulk ( SWMM_Engine  engine,
double *  length,
double *  nx,
double *  ny 
)

Bulk get edge geometry — time-invariant edge length and outward unit normal components, indexed [tri*3 + localEdge].

Output arrays must be pre-allocated to triangle_count * 3 doubles each. Local edge e is the edge opposite vertex e (matching the neighbour convention of swmm_2d_triangle_get_neighbours). Outward normals point away from the triangle interior. Provided so client-side velocity reconstruction from swmm_2d_get_edge_flux_bulk can run without re-deriving geometry from the vertex coordinates.

◆ swmm_2d_force_clear_all()

SWMM_ENGINE_API int swmm_2d_force_clear_all ( SWMM_Engine  engine)

Clear all 2D forcings.

◆ swmm_2d_force_coupling_flux()

SWMM_ENGINE_API int swmm_2d_force_coupling_flux ( SWMM_Engine  engine,
int  idx,
double  value,
int  mode,
int  persist 
)

Force coupling flux on a specific triangle (override computed exchange).

Parameters
valueFlux rate (m/s, + = into 2D).

◆ swmm_2d_force_rainfall()

SWMM_ENGINE_API int swmm_2d_force_rainfall ( SWMM_Engine  engine,
int  idx,
double  value,
int  mode,
int  persist 
)

Force rainfall on a specific triangle.

Parameters
idxTriangle index.
valueRainfall rate (m/s).
modeSWMM_FORCING_OVERRIDE or SWMM_FORCING_ADD.
persistSWMM_FORCING_RESET or SWMM_FORCING_PERSIST.

◆ swmm_2d_force_rainfall_uniform()

SWMM_ENGINE_API int swmm_2d_force_rainfall_uniform ( SWMM_Engine  engine,
double  value,
int  mode,
int  persist 
)

Force rainfall on all triangles (uniform).

◆ swmm_2d_get_abs_tolerance()

SWMM_ENGINE_API int swmm_2d_get_abs_tolerance ( SWMM_Engine  engine,
double *  atol 
)

Get CVODE absolute tolerance.

◆ swmm_2d_get_coupling_flux()

SWMM_ENGINE_API int swmm_2d_get_coupling_flux ( SWMM_Engine  engine,
int  idx,
double *  flux 
)

Get coupling exchange flux at a triangle (m/s, + = into 2D).

◆ swmm_2d_get_coupling_fluxes_bulk()

SWMM_ENGINE_API int swmm_2d_get_coupling_fluxes_bulk ( SWMM_Engine  engine,
double *  fluxes 
)

Bulk get coupling fluxes for all triangles.

◆ swmm_2d_get_cvode_last_step()

SWMM_ENGINE_API int swmm_2d_get_cvode_last_step ( SWMM_Engine  engine,
double *  h_last 
)

Get CVODE last internal step size.

◆ swmm_2d_get_cvode_steps()

SWMM_ENGINE_API int swmm_2d_get_cvode_steps ( SWMM_Engine  engine,
long *  steps 
)

Get number of CVODE internal steps taken in the last advance.

◆ swmm_2d_get_depth()

SWMM_ENGINE_API int swmm_2d_get_depth ( SWMM_Engine  engine,
int  idx,
double *  depth 
)

Get water depth at a triangle.

Parameters
idxTriangle index.
depthOutput depth (m or ft).

◆ swmm_2d_get_depths_bulk()

SWMM_ENGINE_API int swmm_2d_get_depths_bulk ( SWMM_Engine  engine,
double *  depths 
)

Bulk get depths for all triangles.

Parameters
depthsOutput array (pre-allocated to triangle_count).

◆ swmm_2d_get_dry_depth()

SWMM_ENGINE_API int swmm_2d_get_dry_depth ( SWMM_Engine  engine,
double *  dry_depth 
)

Get the dry depth threshold (m).

◆ swmm_2d_get_edge_bc_cum_flux()

SWMM_ENGINE_API int swmm_2d_get_edge_bc_cum_flux ( SWMM_Engine  engine,
int  tri_idx,
int  edge,
double *  cum_flux 
)

Get cumulative boundary flux at an edge (m³, + = outflow).

◆ swmm_2d_get_edge_bc_flow()

SWMM_ENGINE_API int swmm_2d_get_edge_bc_flow ( SWMM_Engine  engine,
int  tri_idx,
int  edge,
double *  flow 
)

Get prescribed flow per metre of edge (m³/s/m) for a SPECIFIED_FLOW edge. V-E4.

◆ swmm_2d_get_edge_bc_head()

SWMM_ENGINE_API int swmm_2d_get_edge_bc_head ( SWMM_Engine  engine,
int  tri_idx,
int  edge,
double *  head 
)

Get specified stage boundary head for an edge.

◆ swmm_2d_get_edge_bc_slope()

SWMM_ENGINE_API int swmm_2d_get_edge_bc_slope ( SWMM_Engine  engine,
int  tri_idx,
int  edge,
double *  slope 
)

Get normal flow boundary slope for an edge.

◆ swmm_2d_get_edge_bc_type()

SWMM_ENGINE_API int swmm_2d_get_edge_bc_type ( SWMM_Engine  engine,
int  tri_idx,
int  edge,
int *  bc_type 
)

Get boundary condition type for an edge.

Parameters
tri_idxTriangle index (0-based).
edgeLocal edge index (0, 1, or 2).
bc_typeOutput: SWMM_2D_BC_WALL, SWMM_2D_BC_NORMAL_FLOW, or SWMM_2D_BC_SPECIFIED_STAGE.

◆ swmm_2d_get_edge_flux_bulk()

SWMM_ENGINE_API int swmm_2d_get_edge_flux_bulk ( SWMM_Engine  engine,
double *  flux 
)

Bulk get normal edge flux at every edge of every triangle.

Output array must be pre-allocated to triangle_count * 3 doubles, indexed [tri*3 + localEdge]. Sign convention: positive flux flows outward through the edge's outward normal. Units m^2 s^-1 (depth- integrated normal speed). Combine with swmm_2d_edge_get_geometry_bulk to reconstruct cell-centred velocity (RT0): for each triangle, solve (NᵀN) v = Nᵀ q where rows of N are the outward unit normals and q[e] = flux[e] / length[e].

◆ swmm_2d_get_head()

SWMM_ENGINE_API int swmm_2d_get_head ( SWMM_Engine  engine,
int  idx,
double *  head 
)

Get total head at a triangle (z + depth).

◆ swmm_2d_get_heads_bulk()

SWMM_ENGINE_API int swmm_2d_get_heads_bulk ( SWMM_Engine  engine,
double *  heads 
)

Bulk get heads for all triangles.

◆ swmm_2d_get_max_depth()

SWMM_ENGINE_API int swmm_2d_get_max_depth ( SWMM_Engine  engine,
double *  max_depth 
)

Get the maximum depth across all triangles.

◆ swmm_2d_get_net_source()

SWMM_ENGINE_API int swmm_2d_get_net_source ( SWMM_Engine  engine,
int  idx,
double *  net_source 
)

Get net source/sink rate at a triangle (m/s).

◆ swmm_2d_get_rainfall()

SWMM_ENGINE_API int swmm_2d_get_rainfall ( SWMM_Engine  engine,
int  idx,
double *  rainfall 
)

Get rainfall intensity at a triangle (m/s).

◆ swmm_2d_get_rel_tolerance()

SWMM_ENGINE_API int swmm_2d_get_rel_tolerance ( SWMM_Engine  engine,
double *  rtol 
)

Get CVODE relative tolerance.

◆ swmm_2d_get_stat_max_depths()

SWMM_ENGINE_API int swmm_2d_get_stat_max_depths ( SWMM_Engine  engine,
double *  max_depths 
)

Get per-triangle max depth statistics (cumulative).

Parameters
max_depthsOutput array (pre-allocated to triangle_count).

◆ swmm_2d_get_total_exchange_flow()

SWMM_ENGINE_API int swmm_2d_get_total_exchange_flow ( SWMM_Engine  engine,
double *  flow 
)

Get total exchange flow rate (sum of all coupling flows, m³/s). Positive = net flow from 2D into 1D network.

◆ swmm_2d_get_total_volume()

SWMM_ENGINE_API int swmm_2d_get_total_volume ( SWMM_Engine  engine,
double *  volume 
)

Get total 2D surface volume (sum of depth * area).

◆ swmm_2d_is_active()

SWMM_ENGINE_API int swmm_2d_is_active ( SWMM_Engine  engine,
int *  active 
)

Check whether the 2D module is active for this simulation.

Parameters
engineEngine handle.
activeOutput: 1 if 2D is active, 0 otherwise.
Returns
SWMM_OK or error code.
Note
Valid after SWMM_STATE_INITIALIZED.

◆ swmm_2d_set_abs_tolerance()

SWMM_ENGINE_API int swmm_2d_set_abs_tolerance ( SWMM_Engine  engine,
double  atol 
)

Set CVODE absolute tolerance.

◆ swmm_2d_set_dry_depth()

SWMM_ENGINE_API int swmm_2d_set_dry_depth ( SWMM_Engine  engine,
double  dry_depth 
)

Set the dry depth threshold (m).

◆ swmm_2d_set_edge_bc_head()

SWMM_ENGINE_API int swmm_2d_set_edge_bc_head ( SWMM_Engine  engine,
int  tri_idx,
int  edge,
double  head 
)

Set specified stage boundary head for an edge.

◆ swmm_2d_set_edge_bc_slope()

SWMM_ENGINE_API int swmm_2d_set_edge_bc_slope ( SWMM_Engine  engine,
int  tri_idx,
int  edge,
double  slope 
)

Set normal flow boundary slope for an edge.

◆ swmm_2d_set_edge_bc_tseries_name()

SWMM_ENGINE_API int swmm_2d_set_edge_bc_tseries_name ( SWMM_Engine  engine,
int  tri_idx,
int  edge,
const char *  name 
)

Set the timeseries NAME to drive a SPECIFIED_STAGE edge.

V-E2. Stores the name verbatim; the engine resolves it into a table index from SimulationContext::tables on the next forcing-step lookup (until then edge_bc_tseries[idx] is -2). Empty name clears the slot (back to constant edge_bc_head).

◆ swmm_2d_set_edge_bc_type()

SWMM_ENGINE_API int swmm_2d_set_edge_bc_type ( SWMM_Engine  engine,
int  tri_idx,
int  edge,
int  bc_type 
)

Set boundary condition type for an edge.

◆ swmm_2d_set_rel_tolerance()

SWMM_ENGINE_API int swmm_2d_set_rel_tolerance ( SWMM_Engine  engine,
double  rtol 
)

Set CVODE relative tolerance.

◆ swmm_2d_set_vertex_z()

SWMM_ENGINE_API int swmm_2d_set_vertex_z ( SWMM_Engine  engine,
int  idx,
double  z 
)

Set vertex Z (ground elevation).

Updates vz[idx] and recomputes the dependent geometry for every triangle incident to this vertex: tri_cz (centroid Z = mean of vertex Zs) and edge_mz (per-edge midpoint Z) so the solver's bed-elevation references stay consistent on the next step. XY-derived fields (tri_area, tri_cx, tri_cy, edge_length, edge_nx, edge_ny, edge_mx, edge_my) are unaffected.

When called while the engine is RUNNING, the solver state (head, depth) is intentionally not rewritten — head remains the value CVODE is integrating; the implied depth = head - bed therefore changes by the same amount as bed. This is the expected physical semantics ("raising the bed under water reduces water depth there").

Parameters
idxVertex index (0-based).
zNew ground elevation (project vertical units).
Here is the call graph for this function:

◆ swmm_2d_triangle_count()

SWMM_ENGINE_API int swmm_2d_triangle_count ( SWMM_Engine  engine,
int *  count 
)

Get the number of mesh triangles.

◆ swmm_2d_triangle_coupling_count()

SWMM_ENGINE_API int swmm_2d_triangle_coupling_count ( SWMM_Engine  engine,
int *  count 
)

Get the number of triangle-to-node coupling points.

◆ swmm_2d_triangle_get_area()

SWMM_ENGINE_API int swmm_2d_triangle_get_area ( SWMM_Engine  engine,
int  idx,
double *  area 
)

Get triangle area.

Parameters
idxTriangle index.
areaOutput area (m² or ft²).

◆ swmm_2d_triangle_get_centroid()

SWMM_ENGINE_API int swmm_2d_triangle_get_centroid ( SWMM_Engine  engine,
int  idx,
double *  cx,
double *  cy,
double *  cz 
)

Get triangle centroid coordinates.

◆ swmm_2d_triangle_get_coupled_node()

SWMM_ENGINE_API int swmm_2d_triangle_get_coupled_node ( SWMM_Engine  engine,
int  tri_idx,
int *  node_idx 
)

Get triangle coupling: which SWMM node is coupled to this triangle.

Parameters
tri_idxTriangle index.
node_idxOutput: SWMM node index, or -1 if uncoupled.

◆ swmm_2d_triangle_get_mannings()

SWMM_ENGINE_API int swmm_2d_triangle_get_mannings ( SWMM_Engine  engine,
int  idx,
double *  n 
)

Get triangle Manning's roughness.

◆ swmm_2d_triangle_get_neighbours()

SWMM_ENGINE_API int swmm_2d_triangle_get_neighbours ( SWMM_Engine  engine,
int  idx,
int *  n0,
int *  n1,
int *  n2 
)

Get triangle neighbour indices (-1 = boundary edge).

Parameters
n0,n1,n2Adjacent triangle indices across edges opposite v0,v1,v2.

◆ swmm_2d_triangle_get_vertices()

SWMM_ENGINE_API int swmm_2d_triangle_get_vertices ( SWMM_Engine  engine,
int  idx,
int *  v0,
int *  v1,
int *  v2 
)

Get triangle connectivity (3 vertex indices).

Parameters
idxTriangle index (0-based).
v0,v1,v2Output vertex indices.

◆ swmm_2d_vertex_count()

SWMM_ENGINE_API int swmm_2d_vertex_count ( SWMM_Engine  engine,
int *  count 
)

Get the number of mesh vertices.

◆ swmm_2d_vertex_coupling_count()

SWMM_ENGINE_API int swmm_2d_vertex_coupling_count ( SWMM_Engine  engine,
int *  count 
)

Get the number of vertex-to-node coupling points.

◆ swmm_2d_vertex_get_coupled_node()

SWMM_ENGINE_API int swmm_2d_vertex_get_coupled_node ( SWMM_Engine  engine,
int  vertex_idx,
int *  node_idx 
)

Get vertex coupling: which SWMM node is coupled to this vertex.

Parameters
vertex_idxVertex index.
node_idxOutput: SWMM node index, or -1 if uncoupled.

◆ swmm_2d_vertex_get_head()

SWMM_ENGINE_API int swmm_2d_vertex_get_head ( SWMM_Engine  engine,
int  idx,
double *  head 
)

Get reconstructed head at a vertex.

◆ swmm_2d_vertex_get_heads_bulk()

SWMM_ENGINE_API int swmm_2d_vertex_get_heads_bulk ( SWMM_Engine  engine,
double *  heads 
)

Bulk get reconstructed heads at all vertices.

◆ swmm_2d_vertex_get_xyz()

SWMM_ENGINE_API int swmm_2d_vertex_get_xyz ( SWMM_Engine  engine,
int  idx,
double *  x,
double *  y,
double *  z 
)

Get vertex coordinates.

Parameters
idxVertex index (0-based).
x,y,zOutput coordinates.

◆ swmm_2d_vertex_get_xyz_bulk()

SWMM_ENGINE_API int swmm_2d_vertex_get_xyz_bulk ( SWMM_Engine  engine,
double *  x,
double *  y,
double *  z 
)

Bulk get vertex coordinates.

Parameters
x,y,zOutput arrays (must be pre-allocated to vertex_count).