OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
openswmm_infrastructure.h File Reference

OpenSWMM Engine — Infrastructure (Transects, Streets, Inlets, LIDs) C API. More...

#include "openswmm_engine.h"
Include dependency graph for openswmm_infrastructure.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  SWMM_InletDesign
 Complete description of an inlet design. All dimensions are in the project's display units (ft or m; ft/s or m/s). More...
 
struct  SWMM_InletUsage
 
struct  SWMM_LidNodeLayer
 
struct  SWMM_LidRichardsOptions
 
struct  SWMM_LidRichardsMaterial
 
struct  SWMM_LidLayerTreatment
 
struct  SWMM_LidBottomState
 
struct  SWMM_LidRichardsStatistics
 

Typedefs

typedef struct SWMM_InletDesign SWMM_InletDesign
 Complete description of an inlet design. All dimensions are in the project's display units (ft or m; ft/s or m/s).
 
typedef struct SWMM_InletUsage SWMM_InletUsage
 
typedef struct SWMM_LidNodeLayer SWMM_LidNodeLayer
 
typedef struct SWMM_LidRichardsOptions SWMM_LidRichardsOptions
 
typedef struct SWMM_LidRichardsMaterial SWMM_LidRichardsMaterial
 
typedef struct SWMM_LidLayerTreatment SWMM_LidLayerTreatment
 
typedef struct SWMM_LidBottomState SWMM_LidBottomState
 
typedef struct SWMM_LidRichardsStatistics SWMM_LidRichardsStatistics
 

Enumerations

enum  SWMM_InletType {
  SWMM_INLET_GRATE = 0 ,
  SWMM_INLET_CURB = 1 ,
  SWMM_INLET_COMBO = 2 ,
  SWMM_INLET_SLOTTED = 3 ,
  SWMM_INLET_DROP_GRATE = 4 ,
  SWMM_INLET_DROP_CURB = 5 ,
  SWMM_INLET_CUSTOM = 6
}
 
enum  SWMM_GrateType {
  SWMM_GRATE_P_BAR_50 = 0 ,
  SWMM_GRATE_P_BAR_50x100 = 1 ,
  SWMM_GRATE_P_BAR_30 = 2 ,
  SWMM_GRATE_CURVED_VANE = 3 ,
  SWMM_GRATE_TILT_BAR_45 = 4 ,
  SWMM_GRATE_TILT_BAR_30 = 5 ,
  SWMM_GRATE_RETICULINE = 6 ,
  SWMM_GRATE_GENERIC = 7
}
 
enum  SWMM_ThroatType {
  SWMM_THROAT_HORIZONTAL = 0 ,
  SWMM_THROAT_INCLINED = 1 ,
  SWMM_THROAT_VERTICAL = 2
}
 
enum  SWMM_InletCurveKind {
  SWMM_INLET_CURVE_NONE = 0 ,
  SWMM_INLET_CURVE_DIVERSION = 1 ,
  SWMM_INLET_CURVE_RATING = 2
}
 
enum  SWMM_InletPlacement {
  SWMM_INLET_AUTOMATIC = 0 ,
  SWMM_INLET_ON_GRADE = 1 ,
  SWMM_INLET_ON_SAG = 2
}
 
enum  SWMM_InletHostKind {
  SWMM_INLET_HOST_LINK = 0 ,
  SWMM_INLET_HOST_NODE = 1
}
 
enum  SWMM_LidNodeLayerKind {
  SWMM_LID_NODE_SURFACE = 0 ,
  SWMM_LID_NODE_MEDIA = 1 ,
  SWMM_LID_NODE_AGGREGATE = 2 ,
  SWMM_LID_NODE_BOTTOM = 3
}
 
enum  SWMM_LidNodeBottom {
  SWMM_LID_BOTTOM_CURRENT = 0 ,
  SWMM_LID_BOTTOM_SEALED = 1 ,
  SWMM_LID_BOTTOM_MESH_AQUIFER = 2
}
 

Functions

SWMM_ENGINE_API int swmm_transect_add (SWMM_Engine engine, const char *id)
 Add a new transect for irregular cross-sections.
 
SWMM_ENGINE_API int swmm_transect_set_roughness (SWMM_Engine engine, int idx, double n_left, double n_right, double n_channel)
 Set Manning's roughness for left overbank, right overbank, and channel.
 
SWMM_ENGINE_API int swmm_transect_add_station (SWMM_Engine engine, int idx, double station, double elevation)
 Add a station–elevation data point to a transect.
 
SWMM_ENGINE_API int swmm_transect_count (SWMM_Engine engine)
 Get the total number of transects in the model.
 
SWMM_ENGINE_API int swmm_transect_index (SWMM_Engine engine, const char *id)
 Look up a transect's zero-based index by its string identifier.
 
SWMM_ENGINE_API const char * swmm_transect_id (SWMM_Engine engine, int idx)
 Get the string identifier of a transect by index.
 
SWMM_ENGINE_API int swmm_transect_get_roughness (SWMM_Engine engine, int idx, double *n_left, double *n_right, double *n_channel)
 Get the Manning's roughness values for a transect.
 
SWMM_ENGINE_API int swmm_transect_set_bank_stations (SWMM_Engine engine, int idx, double x_left, double x_right)
 Set the left and right bank stations for a transect.
 
SWMM_ENGINE_API int swmm_transect_get_bank_stations (SWMM_Engine engine, int idx, double *x_left, double *x_right)
 Get the left and right bank stations for a transect.
 
SWMM_ENGINE_API int swmm_transect_set_encroachment_stations (SWMM_Engine engine, int idx, double x_left, double x_right)
 Set the left and right encroachment stations for a transect (BQ-TR-02).
 
SWMM_ENGINE_API int swmm_transect_get_encroachment_stations (SWMM_Engine engine, int idx, double *x_left, double *x_right)
 Get the left and right encroachment stations for a transect (BQ-TR-02).
 
SWMM_ENGINE_API int swmm_transect_set_modifiers (SWMM_Engine engine, int idx, double x_factor, double y_factor, double length_factor)
 Set the station, elevation, and meander modifiers for a transect.
 
SWMM_ENGINE_API int swmm_transect_get_modifiers (SWMM_Engine engine, int idx, double *x_factor, double *y_factor, double *length_factor)
 Get the station, elevation, and meander modifiers for a transect.
 
SWMM_ENGINE_API int swmm_transect_set_comments (SWMM_Engine engine, int idx, const char *text)
 Set the free-form comments / description for a transect.
 
SWMM_ENGINE_API int swmm_transect_get_comments (SWMM_Engine engine, int idx, char *buf, int buflen)
 Get the free-form comments / description for a transect.
 
SWMM_ENGINE_API int swmm_transect_get_station_count (SWMM_Engine engine, int idx)
 Get the number of station–elevation points stored for a transect.
 
SWMM_ENGINE_API int swmm_transect_get_station (SWMM_Engine engine, int idx, int station_idx, double *station, double *elevation)
 Get a single station–elevation pair from a transect.
 
SWMM_ENGINE_API int swmm_transect_clear_stations (SWMM_Engine engine, int idx)
 Remove all station–elevation pairs from a transect.
 
SWMM_ENGINE_API int swmm_transect_rename (SWMM_Engine engine, int idx, const char *new_id)
 Rename an existing transect.
 
SWMM_ENGINE_API int swmm_transect_remove (SWMM_Engine engine, int idx)
 Remove a transect by index.
 
SWMM_ENGINE_API int swmm_street_add (SWMM_Engine engine, const char *id)
 Add a new street cross-section definition.
 
SWMM_ENGINE_API int swmm_street_rename (SWMM_Engine engine, int idx, const char *new_id)
 Rename a street cross-section in place.
 
SWMM_ENGINE_API int swmm_street_set_params (SWMM_Engine engine, int idx, double t_crown, double h_curb, double sx, double n_road, double gutter_depres, double gutter_width, int sides, double back_width, double back_slope, double back_n)
 Set the geometric parameters for a street cross-section.
 
SWMM_ENGINE_API int swmm_street_count (SWMM_Engine engine)
 Get the total number of street definitions in the model.
 
SWMM_ENGINE_API int swmm_street_index (SWMM_Engine engine, const char *id)
 Look up a street's zero-based index by its string identifier.
 
SWMM_ENGINE_API const char * swmm_street_id (SWMM_Engine engine, int idx)
 Get the string identifier of a street by index.
 
SWMM_ENGINE_API int swmm_street_get_params (SWMM_Engine engine, int idx, double *t_crown, double *h_curb, double *sx, double *n_road, double *gutter_depres, double *gutter_width, int *sides, double *back_width, double *back_slope, double *back_n)
 Read back the geometric parameters of a street cross-section.
 
SWMM_ENGINE_API int swmm_inlet_add (SWMM_Engine engine, const char *id, const char *type)
 Add a new inlet definition.
 
SWMM_ENGINE_API int swmm_inlet_rename (SWMM_Engine engine, int idx, const char *new_id)
 Rename an inlet design in place.
 
SWMM_ENGINE_API int swmm_inlet_set_params (SWMM_Engine engine, int idx, double length, double width, const char *grate_type, double open_area, double splash_veloc)
 Set the geometric parameters for an inlet.
 
SWMM_ENGINE_API int swmm_inlet_count (SWMM_Engine engine)
 Get the total number of inlet definitions in the model.
 
SWMM_ENGINE_API int swmm_inlet_index (SWMM_Engine engine, const char *id)
 Look up an inlet's zero-based index by its string identifier.
 
SWMM_ENGINE_API const char * swmm_inlet_id (SWMM_Engine engine, int idx)
 Get the string identifier of an inlet by index.
 
SWMM_ENGINE_API int swmm_inlet_get_params (SWMM_Engine engine, int idx, double *length, double *width, char *grate_type, int grate_buflen, double *open_area, double *splash_veloc)
 Read an inlet's geometric parameters. Inverse of swmm_inlet_set_params.
 
SWMM_ENGINE_API int swmm_inlet_get_type (SWMM_Engine engine, int idx, char *buf, int buflen)
 Read an inlet's type string (the value passed to swmm_inlet_add).
 
SWMM_ENGINE_API int swmm_inlet_get_design (SWMM_Engine engine, int idx, SWMM_InletDesign *out)
 Read every field of an inlet design.
 
SWMM_ENGINE_API int swmm_inlet_set_design (SWMM_Engine engine, int idx, const SWMM_InletDesign *design)
 Validate and replace the type-specific inlet design.
 
SWMM_ENGINE_API int swmm_inlet_get_comment (SWMM_Engine engine, int idx, char *buf, int buflen)
 Copy an inlet design comment.
 
SWMM_ENGINE_API int swmm_inlet_set_comment (SWMM_Engine engine, int idx, const char *text)
 Replace an inlet design comment.
 
SWMM_ENGINE_API int swmm_inlet_usage_count (SWMM_Engine engine)
 Count inlet-usage rows of both host kinds.
 
SWMM_ENGINE_API int swmm_inlet_usage_find_link (SWMM_Engine engine, int link_idx)
 Find the first inlet-usage row hosted by a link.
 
SWMM_ENGINE_API int swmm_inlet_usage_find_node (SWMM_Engine engine, int node_idx)
 Find the first inlet-usage row hosted by a node.
 
SWMM_ENGINE_API int swmm_inlet_usage_get (SWMM_Engine engine, int usage_idx, SWMM_InletUsage *out)
 Read a complete inlet placement row.
 
SWMM_ENGINE_API int swmm_inlet_usage_set (SWMM_Engine engine, const SWMM_InletUsage *usage, int *usage_idx)
 Validate and upsert one inlet placement per host.
 
SWMM_ENGINE_API int swmm_inlet_usage_remove (SWMM_Engine engine, int usage_idx)
 Remove an inlet-usage row and shift later row indices.
 
SWMM_ENGINE_API int swmm_lid_add (SWMM_Engine engine, const char *id, int type)
 Add a new LID (Low Impact Development) control.
 
SWMM_ENGINE_API int swmm_lid_richards_options_get (SWMM_Engine engine, int control, SWMM_LidRichardsOptions *out)
 Read a control's Richards options.
 
SWMM_ENGINE_API int swmm_lid_richards_material_get (SWMM_Engine engine, int control, int row, SWMM_LidRichardsMaterial *out)
 Read a control's Richards material.
 
SWMM_ENGINE_API int swmm_lid_node_treatment_count (SWMM_Engine engine, int control)
 Count per-layer treatment rows flattened top-to-bottom.
 
SWMM_ENGINE_API int swmm_lid_node_treatment_get (SWMM_Engine engine, int control, int row, SWMM_LidLayerTreatment *out)
 Read a flattened per-layer treatment row.
 
SWMM_ENGINE_API int swmm_lid_node_configure (SWMM_Engine engine, int control, const SWMM_LidNodeLayer *layers, int count, const SWMM_LidLayerTreatment *treatment, int treatment_count)
 Atomically configure a NODE control stack and treatment.
 
SWMM_ENGINE_API int swmm_lid_node_configure_flow (SWMM_Engine engine, int control, const SWMM_LidNodeLayer *layers, int count, const SWMM_LidLayerTreatment *treatment, int treatment_count, const SWMM_LidRichardsOptions *options, const SWMM_LidRichardsMaterial *material)
 Atomically configure a NODE control stack, treatment and flow formulation.
 
SWMM_ENGINE_API int swmm_lid_node_layer_count (SWMM_Engine engine, int control)
 Count authored or derived stack layers, including a BOTTOM row when present.
 
SWMM_ENGINE_API int swmm_lid_node_layer_get (SWMM_Engine engine, int control, int row, SWMM_LidNodeLayer *out)
 Read one authored or derived NODE layer.
 
SWMM_ENGINE_API int swmm_lid_node_layers_set (SWMM_Engine engine, int control, const SWMM_LidNodeLayer *rows, int count)
 Replace NODE layers while preserving compatible treatment and flow settings.
 
SWMM_ENGINE_API int swmm_node_get_lid (SWMM_Engine engine, int node, int *control, double *saturation)
 Read a node LID-control assignment and initial saturation.
 
SWMM_ENGINE_API int swmm_node_set_lid (SWMM_Engine engine, int node, int control, double saturation)
 Assign or clear a storage-node LID and synchronize its geometry.
 
SWMM_ENGINE_API int swmm_node_get_lid_bottom (SWMM_Engine engine, int node, int *mode)
 Read a node's bottom exchange ownership mode.
 
SWMM_ENGINE_API int swmm_node_set_lid_bottom (SWMM_Engine engine, int node, int mode)
 Select bottom ownership for one assigned storage LID.
 
SWMM_ENGINE_API int swmm_lid_node_base_area (SWMM_Engine engine, int node, double *area)
 Read the authored geometric area at a storage LID base.
 
SWMM_ENGINE_API int swmm_lid_node_bottom_state_get (SWMM_Engine engine, int node, SWMM_LidBottomState *out)
 Read the last accepted LID-to-mesh exchange diagnostics without advancing time.
 
SWMM_ENGINE_API int swmm_lid_node_outlet_get (SWMM_Engine engine, int link, int *layer, int *top)
 Read a link's LID layer anchor.
 
SWMM_ENGINE_API int swmm_lid_node_outlet_set (SWMM_Engine engine, int link, int layer, int top)
 Set or remove a link's LID layer anchor.
 
SWMM_ENGINE_API int swmm_lid_node_state_count (SWMM_Engine engine, int node)
 Count initialized runtime profile cells.
 
SWMM_ENGINE_API int swmm_lid_node_state_get (SWMM_Engine engine, int node, int row, int *layer, double *bottom, double *top, double *moisture)
 Read one initialized LID profile cell.
 
SWMM_ENGINE_API int swmm_lid_richards_state_get (SWMM_Engine engine, int node, int row, double *pressure, double *head, double *water)
 Read one Richards cell's pressure, total head and complete water volume.
 
SWMM_ENGINE_API int swmm_lid_richards_statistics_get (SWMM_Engine engine, int node, SWMM_LidRichardsStatistics *out)
 Read the last stored Richards adaptive-solver report.
 
SWMM_ENGINE_API int swmm_lid_rename (SWMM_Engine engine, int idx, const char *new_id)
 Rename an LID control in place.
 
SWMM_ENGINE_API int swmm_lid_set_surface (SWMM_Engine engine, int idx, double storage, double roughness, double slope)
 Set the surface layer properties for a LID control.
 
SWMM_ENGINE_API int swmm_lid_set_soil (SWMM_Engine engine, int idx, double thick, double porosity, double fc, double wp, double ksat, double kslope)
 Set the soil layer properties for a LID control.
 
SWMM_ENGINE_API int swmm_lid_set_storage (SWMM_Engine engine, int idx, double thick, double void_frac, double ksat)
 Set the storage layer properties for a LID control.
 
SWMM_ENGINE_API int swmm_lid_set_drain (SWMM_Engine engine, int idx, double coeff, double expon, double offset)
 Set the underdrain properties for a LID control.
 
SWMM_ENGINE_API int swmm_lid_get_removal (SWMM_Engine engine, int idx, int constituent, double *percent)
 Read a constituent underdrain-removal percentage.
 
SWMM_ENGINE_API int swmm_lid_set_removal (SWMM_Engine engine, int idx, int constituent, double percent)
 Assign a constituent underdrain-removal percentage.
 
SWMM_ENGINE_API int swmm_lid_set_pavement (SWMM_Engine engine, int idx, double thick, double void_ratio, double frac_imperv, double ksat, double clog_factor, double regen_days)
 Set the porous-pavement layer properties for a LID control.
 
SWMM_ENGINE_API int swmm_lid_set_drainmat (SWMM_Engine engine, int idx, double thick, double void_frac, double roughness)
 Set the drainage-mat layer properties for a LID control.
 
SWMM_ENGINE_API int swmm_lid_count (SWMM_Engine engine)
 Get the total number of LID controls in the model.
 
SWMM_ENGINE_API int swmm_lid_index (SWMM_Engine engine, const char *id)
 Look up a LID control's zero-based index by its string identifier.
 
SWMM_ENGINE_API const char * swmm_lid_id (SWMM_Engine engine, int idx)
 Get the string identifier of a LID control by index.
 
SWMM_ENGINE_API int swmm_lid_get_type (SWMM_Engine engine, int idx, int *type)
 Read a LID control's type code. Inverse of the type argument to swmm_lid_add.
 
SWMM_ENGINE_API int swmm_lid_get_surface (SWMM_Engine engine, int idx, double *storage, double *roughness, double *slope)
 Read the stored surface layer parameters.
 
SWMM_ENGINE_API int swmm_lid_get_soil (SWMM_Engine engine, int idx, double *thick, double *porosity, double *fc, double *wp, double *ksat, double *kslope)
 Read the stored soil layer parameters.
 
SWMM_ENGINE_API int swmm_lid_get_storage (SWMM_Engine engine, int idx, double *thick, double *void_frac, double *ksat)
 Read the stored storage layer parameters.
 
SWMM_ENGINE_API int swmm_lid_get_drain (SWMM_Engine engine, int idx, double *coeff, double *expon, double *offset)
 Read the stored drain layer parameters.
 
SWMM_ENGINE_API int swmm_lid_get_pavement (SWMM_Engine engine, int idx, double *thick, double *void_ratio, double *frac_imperv, double *ksat, double *clog_factor, double *regen_days)
 Read the stored pavement layer parameters.
 
SWMM_ENGINE_API int swmm_lid_get_drainmat (SWMM_Engine engine, int idx, double *thick, double *void_frac, double *roughness)
 Read the stored drainmat layer parameters.
 
SWMM_ENGINE_API int swmm_lid_usage_add (SWMM_Engine engine, int subcatch_idx, int lid_idx, int number, double area, double width, double init_sat, double from_imperv)
 Assign a LID control to a subcatchment.
 
SWMM_ENGINE_API int swmm_lid_usage_count (SWMM_Engine engine)
 Count LID-usage rows across all subcatchments.
 
SWMM_ENGINE_API int swmm_lid_usage_get (SWMM_Engine engine, int usage_idx, int *subcatch_idx, int *lid_idx, int *number, double *area, double *width, double *init_sat, double *from_imperv, int *to_perv, double *from_perv)
 Read one LID usage row by global index.
 
SWMM_ENGINE_API int swmm_lid_usage_remove (SWMM_Engine engine, int usage_idx)
 Erase a subcatchment LID-usage row and shift later indices.
 

Detailed Description

OpenSWMM Engine — Infrastructure (Transects, Streets, Inlets, LIDs) C API.

Transect creation and station data, street parameters, inlet definitions, LID control layers, and LID usage assignment.

See also
openswmm_engine.h
Author
Caleb Buahin caleb.nosp@m..bua.nosp@m.hin@g.nosp@m.mail.nosp@m..com
License
Apache-2.0

Typedef Documentation

◆ SWMM_InletDesign

typedef struct SWMM_InletDesign SWMM_InletDesign

Complete description of an inlet design. All dimensions are in the project's display units (ft or m; ft/s or m/s).

◆ SWMM_InletUsage

typedef struct SWMM_InletUsage SWMM_InletUsage

◆ SWMM_LidBottomState

typedef struct SWMM_LidBottomState SWMM_LidBottomState

Accepted mesh-bottom diagnostics, always SI. Positive net flow is from LID to aquifer. The sample is the last completed exchange interval; the current aquifer state has its own time. valid_sample=0 before first sampling. Classical flow uses mobile HGL for sampled_lid_head; Richards uses the bottom porous total head. Gross pending transfers cannot cancel each other. Returns BADPARAM without an initialized explicit mesh-bottom connection; failure leaves *out unchanged. This function does not advance either clock.

◆ SWMM_LidLayerTreatment

typedef struct SWMM_LidLayerTreatment SWMM_LidLayerTreatment

Per-layer treatment. Layer is one-based; pollutant is its engine index. Removal percent applies to outgoing mass; decay is first-order per day. Optional R=/C= expression applies after fixed removal at the layer exit.

◆ SWMM_LidNodeLayer

typedef struct SWMM_LidNodeLayer SWMM_LidNodeLayer

◆ SWMM_LidRichardsMaterial

typedef struct SWMM_LidRichardsMaterial SWMM_LidRichardsMaterial

Explicit van Genuchten-Mualem material; alpha and specific storage are inverse metres in BOTH unit systems. n>1, l>=0, specific_storage>0.

◆ SWMM_LidRichardsOptions

typedef struct SWMM_LidRichardsOptions SWMM_LidRichardsOptions

Alternative flow model. model=0 preserves the existing layer formulation with backwater; model=1 is conservative semi-discrete Richards with adaptive stiff BDF1. atol is water-content fraction, rtol dimensionless, max_step seconds.

◆ SWMM_LidRichardsStatistics

typedef struct SWMM_LidRichardsStatistics SWMM_LidRichardsStatistics

Enumeration Type Documentation

◆ SWMM_GrateType

Grate bar patterns (HEC-22).

Enumerator
SWMM_GRATE_P_BAR_50 
SWMM_GRATE_P_BAR_50x100 
SWMM_GRATE_P_BAR_30 
SWMM_GRATE_CURVED_VANE 
SWMM_GRATE_TILT_BAR_45 
SWMM_GRATE_TILT_BAR_30 
SWMM_GRATE_RETICULINE 
SWMM_GRATE_GENERIC 

◆ SWMM_InletCurveKind

Custom-inlet curve kind.

Enumerator
SWMM_INLET_CURVE_NONE 
SWMM_INLET_CURVE_DIVERSION 

captured flow vs approach flow

SWMM_INLET_CURVE_RATING 

captured flow vs water depth

◆ SWMM_InletHostKind

Enumerator
SWMM_INLET_HOST_LINK 
SWMM_INLET_HOST_NODE 

◆ SWMM_InletPlacement

Inlet placement mode.

Enumerator
SWMM_INLET_AUTOMATIC 
SWMM_INLET_ON_GRADE 
SWMM_INLET_ON_SAG 

◆ SWMM_InletType

Inlet design type codes (match legacy InletType ordering).

Enumerator
SWMM_INLET_GRATE 
SWMM_INLET_CURB 
SWMM_INLET_COMBO 
SWMM_INLET_SLOTTED 
SWMM_INLET_DROP_GRATE 
SWMM_INLET_DROP_CURB 
SWMM_INLET_CUSTOM 

◆ SWMM_LidNodeBottom

Per-node bottom owner, independent of a shared control. Old assignments use CURRENT. INP grammar: Node Control InitSat [BOTTOM CURRENT|SEALED|MESH_AQUIFER]. Nondefault modes are written explicitly. MESH_AQUIFER can be authored but execution remains gated on the R5 signed-volume/restart qualification.

Enumerator
SWMM_LID_BOTTOM_CURRENT 
SWMM_LID_BOTTOM_SEALED 
SWMM_LID_BOTTOM_MESH_AQUIFER 

◆ SWMM_LidNodeLayerKind

Arbitrary ordered NODE control layers; thickness/suction in in or mm, conductivity in in/hr or mm/hr. Params: SURFACE=(thickness, vegetation), MEDIA=(thickness, porosity, FC, WP, Ksat, Kslope, suction), with gravity drainage Ksat*exp(-Kslope*(porosity-theta)) above FC. Kslope is dimensionless and nonnegative, not a power exponent. Surface entry into the first MEDIA reuses modified Green-Ampt; accepted backwater wetting reconciles its finite-zone history. AGGREGATE=(thickness, porosity, Ksat), BOTTOM=(seepage, clogging). Unused parameters must be zero. BOTTOM is not a numbered physical layer.

Enumerator
SWMM_LID_NODE_SURFACE 
SWMM_LID_NODE_MEDIA 
SWMM_LID_NODE_AGGREGATE 
SWMM_LID_NODE_BOTTOM 

◆ SWMM_ThroatType

Curb-opening throat orientation (legacy ThroatAngleWords order).

Enumerator
SWMM_THROAT_HORIZONTAL 
SWMM_THROAT_INCLINED 
SWMM_THROAT_VERTICAL 

Function Documentation

◆ swmm_inlet_add()

SWMM_ENGINE_API int swmm_inlet_add ( SWMM_Engine engine,
const char * id,
const char * type )

Add a new inlet definition.

Parameters
[in]engineEngine handle; see this operation's lifecycle note.
[in]idUnique null-terminated identifier.
[in]typeInlet type string (e.g., "GRATE", "CURB", "SLOTTED", "CUSTOM").
Returns
SWMM_OK on success, or an error code.
Note
A null engine returns SWMM_ERR_BADHANDLE. No lifecycle guard in this wrapper; authoring edits do not generally rebuild running hydraulic/geometry caches. Required strings are copied; empty/duplicate IDs and unresolved type tokens are not rejected here.

◆ swmm_inlet_count()

SWMM_ENGINE_API int swmm_inlet_count ( SWMM_Engine engine)

Get the total number of inlet definitions in the model.

Parameters
[in]engineEngine handle.
Returns
Number of inlets, or -1 on error.
Note
Null engine returns -1.

◆ swmm_inlet_get_comment()

SWMM_ENGINE_API int swmm_inlet_get_comment ( SWMM_Engine engine,
int idx,
char * buf,
int buflen )

Copy an inlet design comment.

No lifecycle guard. Does not change inlet geometry or usages.

Parameters
[in]engineNon-null live engine; caller serializes access.
[in]idxZero-based existing object index in this function's table.
[out]bufNon-null caller-owned text buffer; NUL-terminated and silently truncated to buflen-1 bytes.
[in]buflenPositive capacity in bytes including the terminating NUL.
Returns
SWMM_OK; SWMM_ERR_BADHANDLE for null engine, SWMM_ERR_BADINDEX for a failed index check, or SWMM_ERR_BADPARAM for invalid required arguments.

◆ swmm_inlet_get_design()

SWMM_ENGINE_API int swmm_inlet_get_design ( SWMM_Engine engine,
int idx,
SWMM_InletDesign * out )

Read every field of an inlet design.

Parameters
[in]engineEngine handle.
[in]idxZero-based inlet index.
[out]outReceives the design (must not be NULL).
Returns
SWMM_OK on success, or an error code.
Note
A null engine returns SWMM_ERR_BADHANDLE. A failed infrastructure/pollutant index check returns SWMM_ERR_BADINDEX.

◆ swmm_inlet_get_params()

SWMM_ENGINE_API int swmm_inlet_get_params ( SWMM_Engine engine,
int idx,
double * length,
double * width,
char * grate_type,
int grate_buflen,
double * open_area,
double * splash_veloc )

Read an inlet's geometric parameters. Inverse of swmm_inlet_set_params.

Lets the GUI inlet editor load an existing definition instead of only writing one. Any out-param may be null. The inlet type string (set at swmm_inlet_add) is read separately via swmm_inlet_get_type.

Parameters
[in]engineEngine handle.
[in]idxZero-based inlet index.
[out]lengthReceives the inlet length.
[out]widthReceives the inlet width.
[out]grate_typeBuffer for the grate-type string (NUL-terminated, truncated to grate_buflen); may be null to skip.
[in]grate_buflenSize of grate_type in bytes; ignored when grate_type is null.
[out]open_areaReceives the open-area fraction.
[out]splash_velocReceives the splash-over velocity threshold.
Returns
SWMM_OK on success, or an error code.
Note
length may be NULL to suppress that output. width may be NULL to suppress that output. grate_type may be NULL to suppress that output. open_area may be NULL to suppress that output. splash_veloc may be NULL to suppress that output. A null engine returns SWMM_ERR_BADHANDLE. A failed infrastructure/pollutant index check returns SWMM_ERR_BADINDEX. For CURB/DROP_CURB, length/width map to curb length/height. Other kinds use grate/slot fields. A requested grate buffer must have positive capacity; numeric outputs may already be written if that capacity fails.

◆ swmm_inlet_get_type()

SWMM_ENGINE_API int swmm_inlet_get_type ( SWMM_Engine engine,
int idx,
char * buf,
int buflen )

Read an inlet's type string (the value passed to swmm_inlet_add).

Parameters
[in]engineEngine handle.
[in]idxZero-based inlet index.
[out]bufDestination buffer (NUL-terminated, truncated to buflen).
[in]buflenSize of buf in bytes (must be > 0).
Returns
SWMM_OK on success, or an error code.
Note
A null engine returns SWMM_ERR_BADHANDLE. A failed infrastructure/pollutant index check returns SWMM_ERR_BADINDEX. Required output buffer must be non-null with positive capacity. Copies a terminating NUL and silently truncates to capacity-1 bytes.

◆ swmm_inlet_id()

SWMM_ENGINE_API const char * swmm_inlet_id ( SWMM_Engine engine,
int idx )

Get the string identifier of an inlet by index.

Parameters
[in]engineEngine handle.
[in]idxZero-based inlet index.
Returns
Null-terminated string owned by the engine, or NULL on error.
Note
Returned text borrows engine storage: do not free; copy before editing the table or closing/destroying the engine. NULL is returned for a null engine or invalid index.

◆ swmm_inlet_index()

SWMM_ENGINE_API int swmm_inlet_index ( SWMM_Engine engine,
const char * id )

Look up an inlet's zero-based index by its string identifier.

Parameters
[in]engineEngine handle.
[in]idNull-terminated inlet identifier.
Returns
Zero-based index, or -1 if not found.
Note
Name lookup is case-insensitive; null engine/name or no match returns -1.
Here is the call graph for this function:

◆ swmm_inlet_rename()

SWMM_ENGINE_API int swmm_inlet_rename ( SWMM_Engine engine,
int idx,
const char * new_id )

Rename an inlet design in place.

[INLET_USAGE] rows hold an inlet INDEX, not a name, so usages follow automatically.

Parameters
[in]engineEngine handle.
[in]idxInlet index.
[in]new_idNew unique name (non-empty), compared case-insensitively against the other inlets. A pure case-respelling of this same inlet is allowed.
Returns
SWMM_OK, or SWMM_ERR_BADPARAM on an empty or duplicate name.
Note
A null engine returns SWMM_ERR_BADHANDLE. A failed infrastructure/pollutant index check returns SWMM_ERR_BADINDEX. No lifecycle guard in this wrapper; authoring edits do not generally rebuild running hydraulic/geometry caches.
Here is the call graph for this function:

◆ swmm_inlet_set_comment()

SWMM_ENGINE_API int swmm_inlet_set_comment ( SWMM_Engine engine,
int idx,
const char * text )

Replace an inlet design comment.

No lifecycle guard. Does not change inlet geometry or usages.

Parameters
[in]engineNon-null live engine; caller serializes access.
[in]idxZero-based existing object index in this function's table.
[in]textBorrowed NUL-terminated text copied into the model; NULL clears it.
Returns
SWMM_OK; SWMM_ERR_BADHANDLE for null engine, SWMM_ERR_BADINDEX for a failed index check, or SWMM_ERR_BADPARAM for invalid required arguments.

◆ swmm_inlet_set_design()

SWMM_ENGINE_API int swmm_inlet_set_design ( SWMM_Engine engine,
int idx,
const SWMM_InletDesign * design )

Validate and replace the type-specific inlet design.

Requires BUILDING/OPENED. Validates only fields used by type: positive geometric dimensions; valid type/grate/throat codes; GENERIC open_area in (0,1]; nonnegative splash velocity. CUSTOM requires nonempty curve_id and a valid curve_kind; existing curves must be DIVERSION/RATING and match any explicit kind. Unresolved custom names are retained for later resolution. Clears fields unused by the new type. Numeric comparison guards are not independent finite checks; supply finite values.

Parameters
[in]engineNon-null live engine; caller serializes access.
[in]idxZero-based existing object index in this function's table.
[in]designNon-null borrowed design copied on success; embedded curve_id must be NUL-terminated within its 64-byte array. Dimensions use ft/m and velocities ft/s or m/s.
Returns
SWMM_OK; SWMM_ERR_BADHANDLE for null engine, SWMM_ERR_BADINDEX for a failed index check, or SWMM_ERR_BADPARAM for invalid required arguments. SWMM_ERR_LIFECYCLE outside BUILDING/OPENED.

◆ swmm_inlet_set_params()

SWMM_ENGINE_API int swmm_inlet_set_params ( SWMM_Engine engine,
int idx,
double length,
double width,
const char * grate_type,
double open_area,
double splash_veloc )

Set the geometric parameters for an inlet.

Parameters
[in]engineEngine handle.
[in]idxZero-based inlet index.
[in]lengthInlet length.
[in]widthInlet width.
[in]grate_typeGrate type string (e.g., "P-50", "GENERIC").
[in]open_areaOpen area fraction (0–1).
[in]splash_velocSplash-over velocity threshold.
Returns
SWMM_OK on success, or an error code.
Note
A null engine returns SWMM_ERR_BADHANDLE. A failed infrastructure/pollutant index check returns SWMM_ERR_BADINDEX. No lifecycle guard in this wrapper; authoring edits do not generally rebuild running hydraulic/geometry caches. Numeric values are stored verbatim without finite/range validation.

◆ swmm_inlet_usage_count()

SWMM_ENGINE_API int swmm_inlet_usage_count ( SWMM_Engine engine)

Count inlet-usage rows of both host kinds.

Parameters
[in]engineNon-null live engine; caller serializes access.
Returns
Nonnegative row count, or -1 for null engine.

◆ swmm_inlet_usage_find_link()

SWMM_ENGINE_API int swmm_inlet_usage_find_link ( SWMM_Engine engine,
int link_idx )

Find the first inlet-usage row hosted by a link.

Parameters
[in]engineNon-null live engine; caller serializes access.
[in]link_idxZero-based host link index; this lookup does not separately validate the host table.
Returns
Matching usage index, or -1 for no match/null engine.

◆ swmm_inlet_usage_find_node()

SWMM_ENGINE_API int swmm_inlet_usage_find_node ( SWMM_Engine engine,
int node_idx )

Find the first inlet-usage row hosted by a node.

Parameters
[in]engineNon-null live engine; caller serializes access.
[in]node_idxZero-based host node index; this lookup does not separately validate the host table.
Returns
Matching usage index, or -1 for no match/null engine.

◆ swmm_inlet_usage_get()

SWMM_ENGINE_API int swmm_inlet_usage_get ( SWMM_Engine engine,
int usage_idx,
SWMM_InletUsage * out )

Read a complete inlet placement row.

Returns percentage clogged as (1-clog_factor)*100; performs no lifecycle check.

Parameters
[in]engineNon-null live engine; caller serializes access.
[in]usage_idxZero-based existing usage-row index.
[out]outNon-null caller-owned struct receiving host/design/capture indices and display-unit parameters.
Returns
SWMM_OK; SWMM_ERR_BADHANDLE for null engine, SWMM_ERR_BADINDEX for a failed index check, or SWMM_ERR_BADPARAM for invalid required arguments.

◆ swmm_inlet_usage_remove()

SWMM_ENGINE_API int swmm_inlet_usage_remove ( SWMM_Engine engine,
int usage_idx )

Remove an inlet-usage row and shift later row indices.

Requires BUILDING/OPENED. Removing an inlet junction usage does not fuse/delete the host node or clear its inlet-junction flag.

Parameters
[in]engineNon-null live engine; caller serializes access.
[in]usage_idxZero-based existing usage-row index.
Returns
SWMM_OK; SWMM_ERR_BADHANDLE for null engine, SWMM_ERR_BADINDEX for a failed index check, or SWMM_ERR_BADPARAM for invalid required arguments. SWMM_ERR_LIFECYCLE outside BUILDING/OPENED.

◆ swmm_inlet_usage_set()

SWMM_ENGINE_API int swmm_inlet_usage_set ( SWMM_Engine engine,
const SWMM_InletUsage * usage,
int * usage_idx )

Validate and upsert one inlet placement per host.

Requires BUILDING/OPENED. Copies the row and clears deferred design/capture names. Flow and local dimensions are display flow/length units. Supply finite numbers because comparison guards do not independently reject NaN.

Parameters
[in]engineNon-null live engine; caller serializes access.
[in]usageNon-null borrowed struct. Host must be a conduit or already flagged inlet junction, design/capture indices valid; capture must not be virtual or the host node. num_inlets>=1, clogging 0..99 percent, nonnegative flow_limit/local dimensions and valid placement code.
[out]usage_idxOptional row index, written only on success; existing host row is replaced, otherwise appended.
Returns
SWMM_OK; SWMM_ERR_BADHANDLE for null engine, SWMM_ERR_BADINDEX for a failed index check, or SWMM_ERR_BADPARAM for invalid required arguments. SWMM_ERR_LIFECYCLE outside BUILDING/OPENED. Returns ERR_INLET_USAGE_SHAPE for incompatible host/design cross-section.
Here is the call graph for this function:

◆ swmm_lid_add()

SWMM_ENGINE_API int swmm_lid_add ( SWMM_Engine engine,
const char * id,
int type )

Add a new LID (Low Impact Development) control.

LID types: 0=BIO_CELL, 1=RAIN_GARDEN, 2=GREEN_ROOF, 3=INFIL_TRENCH, 4=PERM_PAVEMENT, 5=RAIN_BARREL, 6=ROOFTOP_DISCONN, 7=VEGETATIVE_SWALE, 8=NODE.

Parameters
[in]engineEngine handle; see this operation's lifecycle note.
[in]idUnique null-terminated identifier.
[in]typeLID type code.
Returns
SWMM_OK on success, or an error code.
Note
A null engine returns SWMM_ERR_BADHANDLE. Requires BUILDING/OPENED; other states return SWMM_ERR_LIFECYCLE.

◆ swmm_lid_count()

SWMM_ENGINE_API int swmm_lid_count ( SWMM_Engine engine)

Get the total number of LID controls in the model.

Parameters
[in]engineEngine handle.
Returns
Number of LID controls, or -1 on error.
Note
Null engine returns -1.

◆ swmm_lid_get_drain()

SWMM_ENGINE_API int swmm_lid_get_drain ( SWMM_Engine engine,
int idx,
double * coeff,
double * expon,
double * offset )

Read the stored drain layer parameters.

All outputs may be NULL; returns stored authoring values without runtime conversion or a lifecycle guard.

Parameters
[in]engineNon-null live engine; caller serializes access.
[in]idxZero-based existing object index in this function's table.
[out]coeffOptional output. User coefficient in the input depth/hour drain power law.
[out]exponOptional output. Dimensionless drain power-law exponent.
[out]offsetOptional output. Drain height above storage bottom, inches/mm.
Returns
SWMM_OK; SWMM_ERR_BADHANDLE for null engine, SWMM_ERR_BADINDEX for a failed index check, or SWMM_ERR_BADPARAM for invalid required arguments.

◆ swmm_lid_get_drainmat()

SWMM_ENGINE_API int swmm_lid_get_drainmat ( SWMM_Engine engine,
int idx,
double * thick,
double * void_frac,
double * roughness )

Read the stored drainmat layer parameters.

All outputs may be NULL; returns stored authoring values without runtime conversion or a lifecycle guard.

Parameters
[in]engineNon-null live engine; caller serializes access.
[in]idxZero-based existing object index in this function's table.
[out]thickOptional output. Drainage mat thickness, inches/mm.
[out]void_fracOptional output. Stored drainage-mat void parameter, as passed to its setter.
[out]roughnessOptional output. Manning roughness.
Returns
SWMM_OK; SWMM_ERR_BADHANDLE for null engine, SWMM_ERR_BADINDEX for a failed index check, or SWMM_ERR_BADPARAM for invalid required arguments.

◆ swmm_lid_get_pavement()

SWMM_ENGINE_API int swmm_lid_get_pavement ( SWMM_Engine engine,
int idx,
double * thick,
double * void_ratio,
double * frac_imperv,
double * ksat,
double * clog_factor,
double * regen_days )

Read the stored pavement layer parameters.

All outputs may be NULL; returns stored authoring values without runtime conversion or a lifecycle guard.

Parameters
[in]engineNon-null live engine; caller serializes access.
[in]idxZero-based existing object index in this function's table.
[out]thickOptional output. Pavement thickness, inches/mm.
[out]void_ratioOptional output. Void/solid volume ratio.
[out]frac_impervOptional output. Impervious surface fraction.
[out]ksatOptional output. Permeability, inches/hour or mm/hour.
[out]clog_factorOptional output. Dimensionless clogging factor; zero disables clogging.
[out]regen_daysOptional output. Regeneration interval, days; zero disables it.
Returns
SWMM_OK; SWMM_ERR_BADHANDLE for null engine, SWMM_ERR_BADINDEX for a failed index check, or SWMM_ERR_BADPARAM for invalid required arguments.

◆ swmm_lid_get_removal()

SWMM_ENGINE_API int swmm_lid_get_removal ( SWMM_Engine engine,
int idx,
int constituent,
double * percent )

Read a constituent underdrain-removal percentage.

No lifecycle guard on get.

Parameters
[in]engineNon-null live engine; caller serializes access.
[in]idxZero-based existing object index in this function's table.
[in]constituent0..np-1 selects pollutant; np+m selects reaction species m, included only when reactions are configured. Excludes reserved registry species.
[out]percentNon-null required output; zero if no row exists.
Returns
SWMM_OK; SWMM_ERR_BADHANDLE for null engine, SWMM_ERR_BADINDEX for a failed index check, or SWMM_ERR_BADPARAM for invalid required arguments.
Here is the call graph for this function:

◆ swmm_lid_get_soil()

SWMM_ENGINE_API int swmm_lid_get_soil ( SWMM_Engine engine,
int idx,
double * thick,
double * porosity,
double * fc,
double * wp,
double * ksat,
double * kslope )

Read the stored soil layer parameters.

All outputs may be NULL; returns stored authoring values without runtime conversion or a lifecycle guard.

Parameters
[in]engineNon-null live engine; caller serializes access.
[in]idxZero-based existing object index in this function's table.
[out]thickOptional output. Soil thickness in inches/mm.
[out]porosityOptional output. Volumetric porosity fraction.
[out]fcOptional output. Field-capacity moisture fraction.
[out]wpOptional output. Wilting-point moisture fraction.
[out]ksatOptional output. Saturated conductivity in inches/hour or mm/hour.
[out]kslopeOptional output. Dimensionless exponential conductivity slope.
Returns
SWMM_OK; SWMM_ERR_BADHANDLE for null engine, SWMM_ERR_BADINDEX for a failed index check, or SWMM_ERR_BADPARAM for invalid required arguments.

◆ swmm_lid_get_storage()

SWMM_ENGINE_API int swmm_lid_get_storage ( SWMM_Engine engine,
int idx,
double * thick,
double * void_frac,
double * ksat )

Read the stored storage layer parameters.

All outputs may be NULL; returns stored authoring values without runtime conversion or a lifecycle guard.

Parameters
[in]engineNon-null live engine; caller serializes access.
[in]idxZero-based existing object index in this function's table.
[out]thickOptional output. Storage thickness in inches/mm.
[out]void_fracOptional output. Void ratio e (void/solid volume), converted to porosity e/(1+e) at initialization.
[out]ksatOptional output. Bottom seepage in inches/hour or mm/hour.
Returns
SWMM_OK; SWMM_ERR_BADHANDLE for null engine, SWMM_ERR_BADINDEX for a failed index check, or SWMM_ERR_BADPARAM for invalid required arguments.

◆ swmm_lid_get_surface()

SWMM_ENGINE_API int swmm_lid_get_surface ( SWMM_Engine engine,
int idx,
double * storage,
double * roughness,
double * slope )

Read the stored surface layer parameters.

All outputs may be NULL; returns stored authoring values without runtime conversion or a lifecycle guard.

Parameters
[in]engineNon-null live engine; caller serializes access.
[in]idxZero-based existing object index in this function's table.
[out]storageOptional output. Surface storage depth in inches/mm.
[out]roughnessOptional output. Surface Manning roughness.
[out]slopeOptional output. Surface slope in percent, not fraction.
Returns
SWMM_OK; SWMM_ERR_BADHANDLE for null engine, SWMM_ERR_BADINDEX for a failed index check, or SWMM_ERR_BADPARAM for invalid required arguments.

◆ swmm_lid_get_type()

SWMM_ENGINE_API int swmm_lid_get_type ( SWMM_Engine engine,
int idx,
int * type )

Read a LID control's type code. Inverse of the type argument to swmm_lid_add.

Parameters
[in]engineEngine handle.
[in]idxZero-based LID index.
[out]typeReceives the LID type code (0=BIO_CELL … 7=VEGETATIVE_SWALE, 8=NODE; -1 for unknown stored code).
Returns
SWMM_OK on success, or an error code.
Note
type may be NULL to suppress that output. A null engine returns SWMM_ERR_BADHANDLE. A failed infrastructure/pollutant index check returns SWMM_ERR_BADINDEX.

◆ swmm_lid_id()

SWMM_ENGINE_API const char * swmm_lid_id ( SWMM_Engine engine,
int idx )

Get the string identifier of a LID control by index.

Parameters
[in]engineEngine handle.
[in]idxZero-based LID index.
Returns
Null-terminated string owned by the engine, or NULL on error.
Note
Returned text borrows engine storage: do not free; copy before editing the table or closing/destroying the engine. NULL is returned for a null engine or invalid index.

◆ swmm_lid_index()

SWMM_ENGINE_API int swmm_lid_index ( SWMM_Engine engine,
const char * id )

Look up a LID control's zero-based index by its string identifier.

Parameters
[in]engineEngine handle.
[in]idNull-terminated LID identifier.
Returns
Zero-based index, or -1 if not found.
Note
Name lookup is case-insensitive; null engine/name or no match returns -1.

◆ swmm_lid_node_base_area()

SWMM_ENGINE_API int swmm_lid_node_base_area ( SWMM_Engine engine,
int node,
double * area )

Read the authored geometric area at a storage LID base.

Requires BUILDING/OPENED, assigned storage LID, and no initialized runtime cells. Uses geometry at depth zero without pore/retained-water factors; rejects nonfinite/negative computed area. Zero requires explicit positive area when creating a connection.

Parameters
[in]engineNon-null live engine; caller serializes access.
[in]nodeZero-based existing node index.
[out]areaNon-null contact-area destination in project square-length units, ft2 or m2; may be zero.
Returns
SWMM_OK; SWMM_ERR_BADHANDLE for null engine, SWMM_ERR_BADINDEX for a failed index check, or SWMM_ERR_BADPARAM for invalid required arguments. SWMM_ERR_LIFECYCLE outside BUILDING/OPENED.
Here is the call graph for this function:

◆ swmm_lid_node_bottom_state_get()

SWMM_ENGINE_API int swmm_lid_node_bottom_state_get ( SWMM_Engine engine,
int node,
SWMM_LidBottomState * out )

Read the last accepted LID-to-mesh exchange diagnostics without advancing time.

Requires an initialized explicit MESH_AQUIFER bottom connection with receipts enabled and a 2D-enabled build; otherwise BADPARAM. Current aquifer and sample timestamps can differ. Classical samples use mobile LID head; Richards uses bottom porous total head. Pending gross up/down transfers remain separate.

Parameters
[in]engineNon-null live engine; caller serializes access.
[in]nodeZero-based existing node index.
[out]outNon-null caller-owned SI diagnostics struct; preserved on failure. Positive net volume/rate is LID to aquifer; valid_sample=0 before the first completed sample.
Returns
SWMM_OK; SWMM_ERR_BADHANDLE for null engine, SWMM_ERR_BADINDEX for a failed index check, or SWMM_ERR_BADPARAM for invalid required arguments.

◆ swmm_lid_node_configure()

SWMM_ENGINE_API int swmm_lid_node_configure ( SWMM_Engine engine,
int control,
const SWMM_LidNodeLayer * layers,
int count,
const SWMM_LidLayerTreatment * treatment,
int treatment_count )

Atomically configure a NODE control stack and treatment.

Requires BUILDING/OPENED and a NODE control. Validates stack, treatment expressions and outlet anchors before retaining the edit; rejects edits that orphan an anchored layer. Synchronizes dependent MaxDepths/outlet offsets. Preserves existing flow/retention settings, requiring compatible layer count/kinds when those settings are active.

Parameters
[in]engineNon-null live engine; caller serializes access.
[in]controlZero-based existing LID control index.
[in]layersNon-null borrowed array of count layers, copied synchronously. See SWMM_LidNodeLayerKind for parameter positions/units; unused params must be zero.
[in]countPositive authored layer count, including optional final BOTTOM. SURFACE may occur only first; at least one MEDIA/AGGREGATE is required.
[in]treatmentBorrowed treatment_count rows, required if treatment_count>0; expressions are copied. Layer is one-based, cannot target BOTTOM; each layer/pollutant key must be unique.
[in]treatment_countNonnegative number of treatment rows; zero clears treatment.
Returns
SWMM_OK; SWMM_ERR_BADHANDLE for null engine, SWMM_ERR_BADINDEX for a failed index check, or SWMM_ERR_BADPARAM for invalid required arguments. SWMM_ERR_LIFECYCLE outside BUILDING/OPENED.
Here is the call graph for this function:

◆ swmm_lid_node_configure_flow()

SWMM_ENGINE_API int swmm_lid_node_configure_flow ( SWMM_Engine engine,
int control,
const SWMM_LidNodeLayer * layers,
int count,
const SWMM_LidLayerTreatment * treatment,
int treatment_count,
const SWMM_LidRichardsOptions * options,
const SWMM_LidRichardsMaterial * material )

Atomically configure a NODE control stack, treatment and flow formulation.

Requires BUILDING/OPENED and a NODE control. Validates stack, treatment expressions and outlet anchors before retaining the edit; rejects edits that orphan an anchored layer. Synchronizes dependent MaxDepths/outlet offsets. Richards requires SURFACE first and valid retention on every porous layer; invalid configuration leaves stack and dependent geometry unchanged.

Parameters
[in]engineNon-null live engine; caller serializes access.
[in]controlZero-based existing LID control index.
[in]layersNon-null borrowed array of count layers, copied synchronously. See SWMM_LidNodeLayerKind for parameter positions/units; unused params must be zero.
[in]countPositive authored layer count, including optional final BOTTOM. SURFACE may occur only first; at least one MEDIA/AGGREGATE is required.
[in]treatmentBorrowed treatment_count rows, required if treatment_count>0; expressions are copied. Layer is one-based, cannot target BOTTOM; each layer/pollutant key must be unique.
[in]treatment_countNonnegative number of treatment rows; zero clears treatment.
[in]optionsNon-null flow options: model=0 classical/backwater, model=1 Richards. Richards requires finite positive tolerances/max_step and cells_per_layer in [1,256].
[in]materialBorrowed array with count entries; required for Richards. Porous rows use residual theta, inverse-metre alpha/specific-storage in BOTH unit systems, n>1 and l>=0; SURFACE/BOTTOM rows are ignored.
Returns
SWMM_OK; SWMM_ERR_BADHANDLE for null engine, SWMM_ERR_BADINDEX for a failed index check, or SWMM_ERR_BADPARAM for invalid required arguments. SWMM_ERR_LIFECYCLE outside BUILDING/OPENED.
Here is the call graph for this function:

◆ swmm_lid_node_layer_count()

SWMM_ENGINE_API int swmm_lid_node_layer_count ( SWMM_Engine engine,
int control )

Count authored or derived stack layers, including a BOTTOM row when present.

Parameters
[in]engineNon-null live engine; caller serializes access.
[in]controlZero-based existing LID control index.
Returns
Nonnegative row count; -1 for null engine or invalid control.
Here is the call graph for this function:

◆ swmm_lid_node_layer_get()

SWMM_ENGINE_API int swmm_lid_node_layer_get ( SWMM_Engine engine,
int control,
int row,
SWMM_LidNodeLayer * out )

Read one authored or derived NODE layer.

No lifecycle check. Uses the derived stack for conventional controls as well as explicitly authored NODE stacks.

Parameters
[in]engineNon-null live engine; caller serializes access.
[in]controlZero-based existing LID control index.
[in]rowZero-based row index in the selected profile/table.
[out]outNon-null caller-owned output receiving kind and all seven input-unit parameters.
Returns
SWMM_OK; SWMM_ERR_BADHANDLE for null engine, SWMM_ERR_BADINDEX for a failed index check, or SWMM_ERR_BADPARAM for invalid required arguments.
Here is the call graph for this function:

◆ swmm_lid_node_layers_set()

SWMM_ENGINE_API int swmm_lid_node_layers_set ( SWMM_Engine engine,
int control,
const SWMM_LidNodeLayer * rows,
int count )

Replace NODE layers while preserving compatible treatment and flow settings.

Requires BUILDING/OPENED and NODE type. Validates stack and existing anchor bounds. Existing Richards/retention configuration requires same layer count/kinds; treatment-bearing layers must retain their kind. Refusal preserves the authored stack. Success synchronizes dependent node MaxDepths/outlet offsets.

Parameters
[in]engineNon-null live engine; caller serializes access.
[in]controlZero-based existing LID control index.
[in]rowsNon-null copied array of count layers; unused parameters must be zero.
[in]countPositive authored layer count, including optional final BOTTOM. SURFACE may occur only first; at least one MEDIA/AGGREGATE is required.
Returns
SWMM_OK; SWMM_ERR_BADHANDLE for null engine, SWMM_ERR_BADINDEX for a failed index check, or SWMM_ERR_BADPARAM for invalid required arguments. SWMM_ERR_LIFECYCLE outside BUILDING/OPENED.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ swmm_lid_node_outlet_get()

SWMM_ENGINE_API int swmm_lid_node_outlet_get ( SWMM_Engine engine,
int link,
int * layer,
int * top )

Read a link's LID layer anchor.

No lifecycle check.

Parameters
[in]engineNon-null live engine; caller serializes access.
[in]linkZero-based existing link index.
[out]layerNon-null output; zero when no anchor exists.
[out]topNon-null output: 0=BOTTOM, 1=TOP; zero when absent.
Returns
SWMM_OK; SWMM_ERR_BADHANDLE for null engine, SWMM_ERR_BADINDEX for a failed index check, or SWMM_ERR_BADPARAM for invalid required arguments.

◆ swmm_lid_node_outlet_set()

SWMM_ENGINE_API int swmm_lid_node_outlet_set ( SWMM_Engine engine,
int link,
int layer,
int top )

Set or remove a link's LID layer anchor.

Requires BUILDING/OPENED. Nonzero layer requires exactly one LID endpoint and a valid layer index. Replaces any previous anchor, then synchronizes offsets; removal needs no LID endpoint.

Parameters
[in]engineNon-null live engine; caller serializes access.
[in]linkZero-based existing link index.
[in]layerZero removes the anchor; otherwise one-based physical layer, top-to-bottom excluding BOTTOM.
[in]top0=BOTTOM or 1=TOP, required even when removing.
Returns
SWMM_OK; SWMM_ERR_BADHANDLE for null engine, SWMM_ERR_BADINDEX for a failed index check, or SWMM_ERR_BADPARAM for invalid required arguments. SWMM_ERR_LIFECYCLE outside BUILDING/OPENED.
Here is the call graph for this function:

◆ swmm_lid_node_state_count()

SWMM_ENGINE_API int swmm_lid_node_state_count ( SWMM_Engine engine,
int node )

Count initialized runtime profile cells.

Parameters
[in]engineNon-null live engine; caller serializes access.
[in]nodeZero-based existing node index.
Returns
Nonnegative row count; -1 for null engine or invalid selected node/control. Runtime state count is zero for nonstorage/plain storage and before initialization.

◆ swmm_lid_node_state_get()

SWMM_ENGINE_API int swmm_lid_node_state_get ( SWMM_Engine engine,
int node,
int row,
int * layer,
double * bottom,
double * top,
double * moisture )

Read one initialized LID profile cell.

Runtime rows are top-to-bottom; porous layers may produce several cells. No lifecycle check, but node must be storage with an existing runtime row.

Parameters
[in]engineNon-null live engine; caller serializes access.
[in]nodeZero-based existing node index.
[in]rowZero-based row index in the selected profile/table.
[out]layerNon-null one-based physical layer identifier.
[out]bottomNon-null cell-bottom depth above node invert, ft/m.
[out]topNon-null cell-top depth above node invert, ft/m.
[out]moistureNon-null volumetric water fraction; Richards porous rows use theta, classical rows include mobile-head inundation.
Returns
SWMM_OK; SWMM_ERR_BADHANDLE for null engine, SWMM_ERR_BADINDEX for a failed index check, or SWMM_ERR_BADPARAM for invalid required arguments.
Here is the call graph for this function:

◆ swmm_lid_node_treatment_count()

SWMM_ENGINE_API int swmm_lid_node_treatment_count ( SWMM_Engine engine,
int control )

Count per-layer treatment rows flattened top-to-bottom.

Parameters
[in]engineNon-null live engine; caller serializes access.
[in]controlZero-based existing LID control index.
Returns
Nonnegative row count; -1 for null engine or invalid control.
Here is the call graph for this function:

◆ swmm_lid_node_treatment_get()

SWMM_ENGINE_API int swmm_lid_node_treatment_get ( SWMM_Engine engine,
int control,
int row,
SWMM_LidLayerTreatment * out )

Read a flattened per-layer treatment row.

Reads explicitly authored node_layers storage; a control lacking that storage can return BADINDEX. removal_percent is 0..100; decay_per_day is per day.

Parameters
[in]engineNon-null live engine; caller serializes access.
[in]controlZero-based existing LID control index.
[in]rowZero-based flattened treatment index; negative/out-of-range rows return BADPARAM.
[out]outNon-null struct. expression borrows engine storage; do not free and copy before editing/destroying the control/engine. layer is one-based and pollutant is an engine pollutant index.
Returns
SWMM_OK; SWMM_ERR_BADHANDLE for null engine, SWMM_ERR_BADINDEX for a failed index check, or SWMM_ERR_BADPARAM for invalid required arguments.

◆ swmm_lid_rename()

SWMM_ENGINE_API int swmm_lid_rename ( SWMM_Engine engine,
int idx,
const char * new_id )

Rename an LID control in place.

Updates both the name vector (read by swmm_lid_id() and the [LID_CONTROLS] writer) and the name registry (read by swmm_lid_index() and the [LID_USAGE] writer). Usage rows hold an LID INDEX, so subcatchment deployments follow automatically. Lifecycle: BUILDING or OPENED.

Parameters
[in]engineEngine handle.
[in]idxLID control index.
[in]new_idNew unique name (non-empty). A pure case-respelling of this same control is allowed.
Returns
SWMM_OK, SWMM_ERR_LIFECYCLE outside BUILDING/OPENED, or SWMM_ERR_BADPARAM on an empty or duplicate name.
Note
A null engine returns SWMM_ERR_BADHANDLE. A failed infrastructure/pollutant index check returns SWMM_ERR_BADINDEX. Requires BUILDING/OPENED; other states return SWMM_ERR_LIFECYCLE.

◆ swmm_lid_richards_material_get()

SWMM_ENGINE_API int swmm_lid_richards_material_get ( SWMM_Engine engine,
int control,
int row,
SWMM_LidRichardsMaterial * out )

Read a control's Richards material.

Parameters
[in]engineNon-null live engine; caller serializes access.
[in]controlZero-based existing LID control index.
[in]rowZero-based row index in the selected profile/table.
[out]outNon-null caller-owned output. alpha/specific_storage are inverse metres in both project unit systems; nonporous rows may contain unused defaults.
Returns
SWMM_OK; SWMM_ERR_BADHANDLE for null engine, SWMM_ERR_BADINDEX for a failed index check, or SWMM_ERR_BADPARAM for invalid required arguments.
Here is the call graph for this function:

◆ swmm_lid_richards_options_get()

SWMM_ENGINE_API int swmm_lid_richards_options_get ( SWMM_Engine engine,
int control,
SWMM_LidRichardsOptions * out )

Read a control's Richards options.

Parameters
[in]engineNon-null live engine; caller serializes access.
[in]controlZero-based existing LID control index.
[out]outNon-null caller-owned output. Defaults are returned for an empty stack; model is 0 or 1.
Returns
SWMM_OK; SWMM_ERR_BADHANDLE for null engine, SWMM_ERR_BADINDEX for a failed index check, or SWMM_ERR_BADPARAM for invalid required arguments.
Here is the call graph for this function:

◆ swmm_lid_richards_state_get()

SWMM_ENGINE_API int swmm_lid_richards_state_get ( SWMM_Engine engine,
int node,
int row,
double * pressure,
double * head,
double * water )

Read one Richards cell's pressure, total head and complete water volume.

Requires an initialized Richards storage profile; classical formulation returns BADPARAM. No state is advanced.

Parameters
[in]engineNon-null live engine; caller serializes access.
[in]nodeZero-based existing node index.
[in]rowZero-based row index in the selected profile/table.
[out]pressureNon-null pressure head in project length units, ft/m.
[out]headNon-null total hydraulic head in ft/m, including node invert and cell elevation.
[out]waterNon-null complete cell water in project volume units, ft3/m3; surface row uses node volume.
Returns
SWMM_OK; SWMM_ERR_BADHANDLE for null engine, SWMM_ERR_BADINDEX for a failed index check, or SWMM_ERR_BADPARAM for invalid required arguments.
Here is the call graph for this function:

◆ swmm_lid_richards_statistics_get()

SWMM_ENGINE_API int swmm_lid_richards_statistics_get ( SWMM_Engine engine,
int node,
SWMM_LidRichardsStatistics * out )

Read the last stored Richards adaptive-solver report.

Returns BADPARAM unless the node uses Richards; does not advance/reset statistics.

Parameters
[in]engineNon-null live engine; caller serializes access.
[in]nodeZero-based existing node index.
[out]outNon-null caller-owned statistics: accepted/rejected steps, RHS evaluations, Newton iterations, min_step in seconds and balance_m3 in SI cubic metres.
Returns
SWMM_OK; SWMM_ERR_BADHANDLE for null engine, SWMM_ERR_BADINDEX for a failed index check, or SWMM_ERR_BADPARAM for invalid required arguments.
Here is the call graph for this function:

◆ swmm_lid_set_drain()

SWMM_ENGINE_API int swmm_lid_set_drain ( SWMM_Engine engine,
int idx,
double coeff,
double expon,
double offset )

Set the underdrain properties for a LID control.

Parameters
[in]engineEngine handle.
[in]idxZero-based LID index.
[in]coeffDrain coefficient.
[in]exponDrain exponent.
[in]offsetDrain offset height above the storage layer bottom.
Returns
SWMM_OK on success, or an error code.
Note
A null engine returns SWMM_ERR_BADHANDLE. A failed infrastructure/pollutant index check returns SWMM_ERR_BADINDEX. No lifecycle guard in this wrapper; authoring edits do not generally rebuild running hydraulic/geometry caches. Rejects NODE controls; use the NODE stack configuration API. Supply finite values because scalar comparison guards are not independent finiteness checks. No lifecycle guard; refreshes cached unit drain coefficients for subsequent steps. offset uses inches/mm, expon is dimensionless and coeff follows the input depth/hour power law; all three must be nonnegative.

◆ swmm_lid_set_drainmat()

SWMM_ENGINE_API int swmm_lid_set_drainmat ( SWMM_Engine engine,
int idx,
double thick,
double void_frac,
double roughness )

Set the drainage-mat layer properties for a LID control.

Used by GREEN_ROOF (and any LID with a DRAINMAT line). The three values of the [LID_CONTROLS] ... DRAINMAT line, in input-file units. Pre-start-only (BUILDING/OPENED).

Parameters
[in]engineEngine handle.
[in]idxZero-based LID index.
[in]thickDrainage-mat thickness.
[in]void_fracVoid fraction of the mat (0–1).
[in]roughnessManning's n for flow through the mat.
Returns
SWMM_OK on success, or an error code.
Note
A null engine returns SWMM_ERR_BADHANDLE. A failed infrastructure/pollutant index check returns SWMM_ERR_BADINDEX. Requires BUILDING/OPENED; other states return SWMM_ERR_LIFECYCLE. Rejects NODE controls; use the NODE stack configuration API. Supply finite values because scalar comparison guards are not independent finiteness checks. These are pre-initialization authoring parameters. Layer depths use inches/mm, conductivities inches/hour or mm/hour; surface slope is percent.

◆ swmm_lid_set_pavement()

SWMM_ENGINE_API int swmm_lid_set_pavement ( SWMM_Engine engine,
int idx,
double thick,
double void_ratio,
double frac_imperv,
double ksat,
double clog_factor,
double regen_days )

Set the porous-pavement layer properties for a LID control.

Used by PERM_PAVEMENT (and any LID with a PAVEMENT line). The six values of the [LID_CONTROLS] ... PAVEMENT line, in input-file units. Pre-start-only (BUILDING/OPENED) — the layer seeds per-unit LID state at start().

Parameters
[in]engineEngine handle.
[in]idxZero-based LID index.
[in]thickPavement layer thickness.
[in]void_ratioVoid ratio (volume of voids / volume of solids).
[in]frac_impervImpervious surface fraction (0–1).
[in]ksatPermeability / saturated conductivity.
[in]clog_factorClogging factor (0 = no clogging).
[in]regen_daysDays between clogging regeneration (0 = never).
Returns
SWMM_OK on success, or an error code.
Note
A null engine returns SWMM_ERR_BADHANDLE. A failed infrastructure/pollutant index check returns SWMM_ERR_BADINDEX. Requires BUILDING/OPENED; other states return SWMM_ERR_LIFECYCLE. Rejects NODE controls; use the NODE stack configuration API. Supply finite values because scalar comparison guards are not independent finiteness checks. These are pre-initialization authoring parameters. Layer depths use inches/mm, conductivities inches/hour or mm/hour; surface slope is percent.
Here is the call graph for this function:

◆ swmm_lid_set_removal()

SWMM_ENGINE_API int swmm_lid_set_removal ( SWMM_Engine engine,
int idx,
int constituent,
double percent )

Assign a constituent underdrain-removal percentage.

Requires BUILDING/OPENED and rejects NODE controls. Updates pollutant rows by index or reaction-species rows by name and the aligned runtime removal array when present.

Parameters
[in]engineNon-null live engine; caller serializes access.
[in]idxZero-based existing object index in this function's table.
[in]constituent0..np-1 selects pollutant; np+m selects reaction species m, included only when reactions are configured. Excludes reserved registry species.
[in]percentPercentage in [0,100]; zero removes the stored entry.
Returns
SWMM_OK; SWMM_ERR_BADHANDLE for null engine, SWMM_ERR_BADINDEX for a failed index check, or SWMM_ERR_BADPARAM for invalid required arguments. SWMM_ERR_LIFECYCLE outside BUILDING/OPENED.
Here is the call graph for this function:

◆ swmm_lid_set_soil()

SWMM_ENGINE_API int swmm_lid_set_soil ( SWMM_Engine engine,
int idx,
double thick,
double porosity,
double fc,
double wp,
double ksat,
double kslope )

Set the soil layer properties for a LID control.

Parameters
[in]engineEngine handle.
[in]idxZero-based LID index.
[in]thickSoil thickness.
[in]porositySoil porosity (fraction).
[in]fcField capacity (fraction).
[in]wpWilting point (fraction).
[in]ksatSaturated hydraulic conductivity.
[in]kslopeSlope of the conductivity–moisture curve.
Returns
SWMM_OK on success, or an error code.
Note
A null engine returns SWMM_ERR_BADHANDLE. A failed infrastructure/pollutant index check returns SWMM_ERR_BADINDEX. Requires BUILDING/OPENED; other states return SWMM_ERR_LIFECYCLE. Rejects NODE controls; use the NODE stack configuration API. Supply finite values because scalar comparison guards are not independent finiteness checks. These are pre-initialization authoring parameters. Layer depths use inches/mm, conductivities inches/hour or mm/hour; surface slope is percent.
Here is the call graph for this function:

◆ swmm_lid_set_storage()

SWMM_ENGINE_API int swmm_lid_set_storage ( SWMM_Engine engine,
int idx,
double thick,
double void_frac,
double ksat )

Set the storage layer properties for a LID control.

Parameters
[in]engineEngine handle.
[in]idxZero-based LID index.
[in]thickStorage layer thickness.
[in]void_fracVoid ratio (void volume / solid volume); porosity is e/(1+e).
[in]ksatSeepage rate through the storage layer bottom.
Returns
SWMM_OK on success, or an error code.
Note
A null engine returns SWMM_ERR_BADHANDLE. A failed infrastructure/pollutant index check returns SWMM_ERR_BADINDEX. Requires BUILDING/OPENED; other states return SWMM_ERR_LIFECYCLE. Rejects NODE controls; use the NODE stack configuration API. Supply finite values because scalar comparison guards are not independent finiteness checks. These are pre-initialization authoring parameters. Layer depths use inches/mm, conductivities inches/hour or mm/hour; surface slope is percent.
Here is the call graph for this function:

◆ swmm_lid_set_surface()

SWMM_ENGINE_API int swmm_lid_set_surface ( SWMM_Engine engine,
int idx,
double storage,
double roughness,
double slope )

Set the surface layer properties for a LID control.

Parameters
[in]engineEngine handle.
[in]idxZero-based LID index.
[in]storageSurface storage depth.
[in]roughnessSurface Manning's n.
[in]slopeSurface slope in percent.
Returns
SWMM_OK on success, or an error code.
Note
A null engine returns SWMM_ERR_BADHANDLE. A failed infrastructure/pollutant index check returns SWMM_ERR_BADINDEX. Requires BUILDING/OPENED; other states return SWMM_ERR_LIFECYCLE. Rejects NODE controls; use the NODE stack configuration API. Supply finite values because scalar comparison guards are not independent finiteness checks. These are pre-initialization authoring parameters. Layer depths use inches/mm, conductivities inches/hour or mm/hour; surface slope is percent.
Here is the call graph for this function:

◆ swmm_lid_usage_add()

SWMM_ENGINE_API int swmm_lid_usage_add ( SWMM_Engine engine,
int subcatch_idx,
int lid_idx,
int number,
double area,
double width,
double init_sat,
double from_imperv )

Assign a LID control to a subcatchment.

Multiple LID units of the same or different types can be assigned to a single subcatchment.

Parameters
[in]engineEngine handle.
[in]subcatch_idxZero-based subcatchment index.
[in]lid_idxZero-based LID control index.
[in]numberNumber of replicate LID units.
[in]areaArea of each LID unit in square feet/metres (not acres/hectares).
[in]widthTop width of the overland flow surface per unit.
[in]init_satInitial saturation of the soil layer in percent (0–100).
[in]from_impervPercentage of impervious runoff treated by this LID (0–100).
Returns
SWMM_OK on success, or an error code.
Note
A null engine returns SWMM_ERR_BADHANDLE. A failed infrastructure/pollutant index check returns SWMM_ERR_BADINDEX. No lifecycle guard in this wrapper; authoring edits do not generally rebuild running hydraulic/geometry caches. Stores an appended configuration row without numeric validation or runtime solver rebuild. Area is square feet/metres per unit (not acres/hectares); width is ft/m, init_sat and from_imperv are PERCENT, not fractions. NODE controls are refused.

◆ swmm_lid_usage_count()

SWMM_ENGINE_API int swmm_lid_usage_count ( SWMM_Engine engine)

Count LID-usage rows across all subcatchments.

Parameters
[in]engineNon-null live engine; caller serializes access.
Returns
Nonnegative row count, or -1 for null engine.

◆ swmm_lid_usage_get()

SWMM_ENGINE_API int swmm_lid_usage_get ( SWMM_Engine engine,
int usage_idx,
int * subcatch_idx,
int * lid_idx,
int * number,
double * area,
double * width,
double * init_sat,
double * from_imperv,
int * to_perv,
double * from_perv )

Read one LID usage row by global index.

Parameters
[in]engineEngine handle.
[in]usage_idxZero-based global usage index ([0, count)).
[out]subcatch_idxOwning subcatchment index (nullable).
[out]lid_idxLID control index (nullable).
[out]numberNumber of replicate units (nullable).
[out]areaArea per unit (nullable).
[out]widthOverland flow top width (nullable).
[out]init_satInitial saturation in percent (nullable).
[out]from_impervPercentage of impervious runoff treated (nullable).
[out]to_perv1 = route outflow to pervious area (nullable).
[out]from_pervPercentage of pervious runoff treated (nullable).
Returns
SWMM_OK on success, or an error code.
Note
subcatch_idx may be NULL to suppress that output. lid_idx may be NULL to suppress that output. number may be NULL to suppress that output. area may be NULL to suppress that output. width may be NULL to suppress that output. init_sat may be NULL to suppress that output. from_imperv may be NULL to suppress that output. to_perv may be NULL to suppress that output. from_perv may be NULL to suppress that output. A null engine returns SWMM_ERR_BADHANDLE. A failed infrastructure/pollutant index check returns SWMM_ERR_BADINDEX.

◆ swmm_lid_usage_remove()

SWMM_ENGINE_API int swmm_lid_usage_remove ( SWMM_Engine engine,
int usage_idx )

Erase a subcatchment LID-usage row and shift later indices.

No lifecycle guard. Erases configuration arrays and resizes balance arrays; does not rebuild running LID solver groups.

Parameters
[in]engineNon-null live engine; caller serializes access.
[in]usage_idxZero-based global LID-usage index.
Returns
SWMM_OK; SWMM_ERR_BADHANDLE for null engine, SWMM_ERR_BADINDEX for a failed index check, or SWMM_ERR_BADPARAM for invalid required arguments.

◆ swmm_node_get_lid()

SWMM_ENGINE_API int swmm_node_get_lid ( SWMM_Engine engine,
int node,
int * control,
double * saturation )

Read a node LID-control assignment and initial saturation.

Parameters
[in]engineNon-null live engine; caller serializes access.
[in]nodeZero-based existing node index.
[out]controlNon-null control-index output; -1 for nonstorage/plain storage.
[out]saturationNon-null initial saturation output in percent; zero for nonstorage.
Returns
SWMM_OK; SWMM_ERR_BADHANDLE for null engine, SWMM_ERR_BADINDEX for a failed index check, or SWMM_ERR_BADPARAM for invalid required arguments.

◆ swmm_node_get_lid_bottom()

SWMM_ENGINE_API int swmm_node_get_lid_bottom ( SWMM_Engine engine,
int node,
int * mode )

Read a node's bottom exchange ownership mode.

Parameters
[in]engineNon-null live engine; caller serializes access.
[in]nodeZero-based existing node index.
[out]modeNon-null SWMM_LID_BOTTOM_* destination; CURRENT for nodes without a LID assignment.
Returns
SWMM_OK; SWMM_ERR_BADHANDLE for null engine, SWMM_ERR_BADINDEX for a failed index check, or SWMM_ERR_BADPARAM for invalid required arguments.
Here is the call graph for this function:

◆ swmm_node_set_lid()

SWMM_ENGINE_API int swmm_node_set_lid ( SWMM_Engine engine,
int node,
int control,
double saturation )

Assign or clear a storage-node LID and synchronize its geometry.

Requires BUILDING/OPENED and storage node. Checks existing outlet anchors and refuses a second LID endpoint. Clears node runtime LID state and cached full volume. Assignment preserves bottom mode; clearing resets CURRENT and removes attached outlet anchors.

Parameters
[in]engineNon-null live engine; caller serializes access.
[in]nodeZero-based existing node index.
[in]controlExisting control with a valid derived/authored stack, or -1 to clear the assignment.
[in]saturationFinite initial saturation in percent [0,100]; ignored/reset to zero when clearing.
Returns
SWMM_OK; SWMM_ERR_BADHANDLE for null engine, SWMM_ERR_BADINDEX for a failed index check, or SWMM_ERR_BADPARAM for invalid required arguments. SWMM_ERR_LIFECYCLE outside BUILDING/OPENED.
Here is the call graph for this function:

◆ swmm_node_set_lid_bottom()

SWMM_ENGINE_API int swmm_node_set_lid_bottom ( SWMM_Engine engine,
int node,
int mode )

Select bottom ownership for one assigned storage LID.

Requires BUILDING/OPENED and an assigned storage LID. Authoring MESH_AQUIFER does not by itself establish a qualified executable mesh connection.

Parameters
[in]engineNon-null live engine; caller serializes access.
[in]nodeZero-based existing node index.
[in]modeSWMM_LID_BOTTOM_CURRENT, SEALED or MESH_AQUIFER.
Returns
SWMM_OK; SWMM_ERR_BADHANDLE for null engine, SWMM_ERR_BADINDEX for a failed index check, or SWMM_ERR_BADPARAM for invalid required arguments. SWMM_ERR_LIFECYCLE outside BUILDING/OPENED.

◆ swmm_street_add()

SWMM_ENGINE_API int swmm_street_add ( SWMM_Engine engine,
const char * id )

Add a new street cross-section definition.

Parameters
[in]engineEngine handle; see this operation's lifecycle note.
[in]idUnique null-terminated identifier.
Returns
SWMM_OK on success, or an error code.
Note
A null engine returns SWMM_ERR_BADHANDLE. No lifecycle guard in this wrapper; authoring edits do not generally rebuild running hydraulic/geometry caches. Required strings are copied; empty/duplicate IDs and unresolved type tokens are not rejected here.

◆ swmm_street_count()

SWMM_ENGINE_API int swmm_street_count ( SWMM_Engine engine)

Get the total number of street definitions in the model.

Parameters
[in]engineEngine handle.
Returns
Number of streets, or -1 on error.
Note
Null engine returns -1.

◆ swmm_street_get_params()

SWMM_ENGINE_API int swmm_street_get_params ( SWMM_Engine engine,
int idx,
double * t_crown,
double * h_curb,
double * sx,
double * n_road,
double * gutter_depres,
double * gutter_width,
int * sides,
double * back_width,
double * back_slope,
double * back_n )

Read back the geometric parameters of a street cross-section.

Inverse of swmm_street_set_params. Any out-pointer may be NULL if that field is not needed. Values are returned in the same units they were supplied (display units).

Parameters
[in]engineEngine handle.
[in]idxZero-based street index.
[out]t_crownCrown thickness.
[out]h_curbCurb height.
[out]sxCross slope of the roadway.
[out]n_roadManning's n for the road surface.
[out]gutter_depresGutter depression depth.
[out]gutter_widthGutter width.
[out]sidesNumber of sides (1 or 2).
[out]back_widthBacking (sidewalk) width.
[out]back_slopeBacking slope.
[out]back_nManning's n for the backing area.
Returns
SWMM_OK on success, or an error code.
Note
t_crown may be NULL to suppress that output. h_curb may be NULL to suppress that output. sx may be NULL to suppress that output. n_road may be NULL to suppress that output. gutter_depres may be NULL to suppress that output. gutter_width may be NULL to suppress that output. sides may be NULL to suppress that output. back_width may be NULL to suppress that output. back_slope may be NULL to suppress that output. back_n may be NULL to suppress that output. A null engine returns SWMM_ERR_BADHANDLE. A failed infrastructure/pollutant index check returns SWMM_ERR_BADINDEX.

◆ swmm_street_id()

SWMM_ENGINE_API const char * swmm_street_id ( SWMM_Engine engine,
int idx )

Get the string identifier of a street by index.

Parameters
[in]engineEngine handle.
[in]idxZero-based street index.
Returns
Null-terminated string owned by the engine, or NULL on error.
Note
Returned text borrows engine storage: do not free; copy before editing the table or closing/destroying the engine. NULL is returned for a null engine or invalid index.

◆ swmm_street_index()

SWMM_ENGINE_API int swmm_street_index ( SWMM_Engine engine,
const char * id )

Look up a street's zero-based index by its string identifier.

Parameters
[in]engineEngine handle.
[in]idNull-terminated street identifier.
Returns
Zero-based index, or -1 if not found.
Note
Name lookup is case-insensitive; null engine/name or no match returns -1.
Here is the call graph for this function:

◆ swmm_street_rename()

SWMM_ENGINE_API int swmm_street_rename ( SWMM_Engine engine,
int idx,
const char * new_id )

Rename a street cross-section in place.

Unlike the other named infrastructure objects, a street is referenced BY NAME after parsing: STREET_XSECT links carry it in their named cross-section slot, which swmm_link_get_xsect resolves and the .inp writer emits as [XSECTIONS] Geom1. This call rewrites every such reference, so renaming cannot leave a link pointing at a street that no longer exists.

Parameters
[in]engineEngine handle.
[in]idxStreet index.
[in]new_idNew unique name (non-empty), compared case-insensitively against the other streets. A pure case-respelling of this same street is allowed.
Returns
SWMM_OK, or SWMM_ERR_BADPARAM on an empty or duplicate name.
Note
A null engine returns SWMM_ERR_BADHANDLE. A failed infrastructure/pollutant index check returns SWMM_ERR_BADINDEX. No lifecycle guard in this wrapper; authoring edits do not generally rebuild running hydraulic/geometry caches.
Here is the call graph for this function:

◆ swmm_street_set_params()

SWMM_ENGINE_API int swmm_street_set_params ( SWMM_Engine engine,
int idx,
double t_crown,
double h_curb,
double sx,
double n_road,
double gutter_depres,
double gutter_width,
int sides,
double back_width,
double back_slope,
double back_n )

Set the geometric parameters for a street cross-section.

Parameters
[in]engineEngine handle.
[in]idxZero-based street index.
[in]t_crownCrown thickness (rise of the crown above the gutter).
[in]h_curbCurb height.
[in]sxCross slope of the roadway.
[in]n_roadManning's n for the road surface.
[in]gutter_depresGutter depression depth.
[in]gutter_widthGutter width.
[in]sidesNumber of sides (1 or 2).
[in]back_widthBacking (sidewalk) width.
[in]back_slopeBacking slope.
[in]back_nManning's n for the backing area.
Returns
SWMM_OK on success, or an error code.
Note
A null engine returns SWMM_ERR_BADHANDLE. A failed infrastructure/pollutant index check returns SWMM_ERR_BADINDEX. No lifecycle guard in this wrapper; authoring edits do not generally rebuild running hydraulic/geometry caches. Numeric values are stored verbatim without finite/range validation.

◆ swmm_transect_add()

SWMM_ENGINE_API int swmm_transect_add ( SWMM_Engine engine,
const char * id )

Add a new transect for irregular cross-sections.

Parameters
[in]engineEngine handle; see this operation's lifecycle note.
[in]idUnique null-terminated identifier.
Returns
SWMM_OK on success, or an error code.
Note
A null engine returns SWMM_ERR_BADHANDLE. No lifecycle guard in this wrapper; authoring edits do not generally rebuild running hydraulic/geometry caches. Rejects case-insensitive duplicate IDs; NULL is refused but an empty ID is accepted.
Here is the call graph for this function:

◆ swmm_transect_add_station()

SWMM_ENGINE_API int swmm_transect_add_station ( SWMM_Engine engine,
int idx,
double station,
double elevation )

Add a station–elevation data point to a transect.

Stations must be added in order from left to right across the cross-section.

Parameters
[in]engineEngine handle.
[in]idxZero-based transect index.
[in]stationHorizontal distance (station) from a reference.
[in]elevationElevation at this station.
Returns
SWMM_OK on success, or an error code.
Note
A null engine returns SWMM_ERR_BADHANDLE. A failed infrastructure/pollutant index check returns SWMM_ERR_BADINDEX. Numeric values are stored verbatim without finite/range validation.

◆ swmm_transect_clear_stations()

SWMM_ENGINE_API int swmm_transect_clear_stations ( SWMM_Engine engine,
int idx )

Remove all station–elevation pairs from a transect.

Used by the GUI's snapshot-and-rewrite path: clear then re-add the full station list in one shot.

Parameters
[in]engineEngine handle.
[in]idxZero-based transect index.
Returns
SWMM_OK on success, or an error code.
Note
A null engine returns SWMM_ERR_BADHANDLE. A failed infrastructure/pollutant index check returns SWMM_ERR_BADINDEX. No lifecycle guard in this wrapper; authoring edits do not generally rebuild running hydraulic/geometry caches.

◆ swmm_transect_count()

SWMM_ENGINE_API int swmm_transect_count ( SWMM_Engine engine)

Get the total number of transects in the model.

Parameters
[in]engineEngine handle.
Returns
Number of transects, or -1 on error.
Note
Null engine returns -1.

◆ swmm_transect_get_bank_stations()

SWMM_ENGINE_API int swmm_transect_get_bank_stations ( SWMM_Engine engine,
int idx,
double * x_left,
double * x_right )

Get the left and right bank stations for a transect.

Parameters
[in]engineEngine handle.
[in]idxZero-based transect index.
[out]x_leftStation of the left bank. May be NULL.
[out]x_rightStation of the right bank. May be NULL.
Returns
SWMM_OK on success, or an error code.
Note
x_left may be NULL to suppress that output. x_right may be NULL to suppress that output. A null engine returns SWMM_ERR_BADHANDLE. A failed infrastructure/pollutant index check returns SWMM_ERR_BADINDEX.

◆ swmm_transect_get_comments()

SWMM_ENGINE_API int swmm_transect_get_comments ( SWMM_Engine engine,
int idx,
char * buf,
int buflen )

Get the free-form comments / description for a transect.

Writes the comment into buf with NUL termination; truncates if the buffer is smaller than the comment. Always returns SWMM_OK (an empty comment results in buf[0] == '\0').

Parameters
[in]engineEngine handle.
[in]idxZero-based transect index.
[out]bufDestination buffer.
[in]buflenSize of buf in bytes (must be > 0).
Returns
SWMM_OK on success, or an error code.
Note
A null engine returns SWMM_ERR_BADHANDLE. A failed infrastructure/pollutant index check returns SWMM_ERR_BADINDEX. Required output buffer must be non-null with positive capacity. Copies a terminating NUL and silently truncates to capacity-1 bytes.

◆ swmm_transect_get_encroachment_stations()

SWMM_ENGINE_API int swmm_transect_get_encroachment_stations ( SWMM_Engine engine,
int idx,
double * x_left,
double * x_right )

Get the left and right encroachment stations for a transect (BQ-TR-02).

Parameters
[in]engineEngine handle.
[in]idxZero-based transect index.
[out]x_leftStation of the left encroachment limit. May be NULL.
[out]x_rightStation of the right encroachment limit. May be NULL.
Returns
SWMM_OK on success, or an error code.
Note
x_left may be NULL to suppress that output. x_right may be NULL to suppress that output. A null engine returns SWMM_ERR_BADHANDLE. A failed infrastructure/pollutant index check returns SWMM_ERR_BADINDEX.

◆ swmm_transect_get_modifiers()

SWMM_ENGINE_API int swmm_transect_get_modifiers ( SWMM_Engine engine,
int idx,
double * x_factor,
double * y_factor,
double * length_factor )

Get the station, elevation, and meander modifiers for a transect.

Parameters
[in]engineEngine handle.
[in]idxZero-based transect index.
[out]x_factorStation spacing multiplier. May be NULL.
[out]y_factorElevation offset. May be NULL.
[out]length_factorMeander factor. May be NULL.
Returns
SWMM_OK on success, or an error code.
Note
x_factor may be NULL to suppress that output. y_factor may be NULL to suppress that output. length_factor may be NULL to suppress that output. A null engine returns SWMM_ERR_BADHANDLE. A failed infrastructure/pollutant index check returns SWMM_ERR_BADINDEX.

◆ swmm_transect_get_roughness()

SWMM_ENGINE_API int swmm_transect_get_roughness ( SWMM_Engine engine,
int idx,
double * n_left,
double * n_right,
double * n_channel )

Get the Manning's roughness values for a transect.

Parameters
[in]engineEngine handle.
[in]idxZero-based transect index.
[out]n_leftManning's n for the left overbank. May be NULL.
[out]n_rightManning's n for the right overbank. May be NULL.
[out]n_channelManning's n for the main channel. May be NULL.
Returns
SWMM_OK on success, or an error code.
Note
n_left may be NULL to suppress that output. n_right may be NULL to suppress that output. n_channel may be NULL to suppress that output. A null engine returns SWMM_ERR_BADHANDLE. A failed infrastructure/pollutant index check returns SWMM_ERR_BADINDEX.

◆ swmm_transect_get_station()

SWMM_ENGINE_API int swmm_transect_get_station ( SWMM_Engine engine,
int idx,
int station_idx,
double * station,
double * elevation )

Get a single station–elevation pair from a transect.

Parameters
[in]engineEngine handle.
[in]idxZero-based transect index.
[in]station_idxZero-based station-pair index.
[out]stationHorizontal distance. May be NULL.
[out]elevationElevation at this station. May be NULL.
Returns
SWMM_OK on success, or an error code.
Note
station may be NULL to suppress that output. elevation may be NULL to suppress that output. A null engine returns SWMM_ERR_BADHANDLE. A failed infrastructure/pollutant index check returns SWMM_ERR_BADINDEX.

◆ swmm_transect_get_station_count()

SWMM_ENGINE_API int swmm_transect_get_station_count ( SWMM_Engine engine,
int idx )

Get the number of station–elevation points stored for a transect.

Parameters
[in]engineEngine handle.
[in]idxZero-based transect index.
Returns
Station count, or -1 on error.
Note
Null engine returns -1.

◆ swmm_transect_id()

SWMM_ENGINE_API const char * swmm_transect_id ( SWMM_Engine engine,
int idx )

Get the string identifier of a transect by index.

Parameters
[in]engineEngine handle.
[in]idxZero-based transect index.
Returns
Null-terminated string owned by the engine, or NULL on error.
Note
Returned text borrows engine storage: do not free; copy before editing the table or closing/destroying the engine. NULL is returned for a null engine or invalid index.

◆ swmm_transect_index()

SWMM_ENGINE_API int swmm_transect_index ( SWMM_Engine engine,
const char * id )

Look up a transect's zero-based index by its string identifier.

Parameters
[in]engineEngine handle.
[in]idNull-terminated transect identifier.
Returns
Zero-based index, or -1 if not found.
Note
Name lookup is case-insensitive; null engine/name or no match returns -1.
Here is the call graph for this function:

◆ swmm_transect_remove()

SWMM_ENGINE_API int swmm_transect_remove ( SWMM_Engine engine,
int idx )

Remove a transect by index.

Out-of-range indices are a SWMM_OK no-op (mirrors the pattern mutation API — see test_pattern_mutation_api.cpp). Remaining transects preserve their relative order; their indices shift down by one.

Parameters
[in]engineEngine handle.
[in]idxZero-based transect index.
Returns
SWMM_OK on success, or an error code.
Note
A null engine returns SWMM_ERR_BADHANDLE. No lifecycle guard in this wrapper; authoring edits do not generally rebuild running hydraulic/geometry caches. Out-of-range indices succeed without mutation. Erases only the transect arrays; does not nullify/renumber referring link cross-sections. Use swmm_transect_delete() for cascaded reference repair.

◆ swmm_transect_rename()

SWMM_ENGINE_API int swmm_transect_rename ( SWMM_Engine engine,
int idx,
const char * new_id )

Rename an existing transect.

Refuses on collision with another existing transect name (case insensitive); same-name is a no-op SWMM_OK.

Parameters
[in]engineEngine handle.
[in]idxZero-based transect index.
[in]new_idNew null-terminated identifier.
Returns
SWMM_OK on success, or an error code.
Note
A null engine returns SWMM_ERR_BADHANDLE. A failed infrastructure/pollutant index check returns SWMM_ERR_BADINDEX. No lifecycle guard in this wrapper; authoring edits do not generally rebuild running hydraulic/geometry caches.
Here is the call graph for this function:

◆ swmm_transect_set_bank_stations()

SWMM_ENGINE_API int swmm_transect_set_bank_stations ( SWMM_Engine engine,
int idx,
double x_left,
double x_right )

Set the left and right bank stations for a transect.

Bank stations delimit the main channel from the overbanks; they are independent of the encroachment stations (BQ-TR-02).

Parameters
[in]engineEngine handle.
[in]idxZero-based transect index.
[in]x_leftStation of the left bank.
[in]x_rightStation of the right bank.
Returns
SWMM_OK on success, or an error code.
Note
A null engine returns SWMM_ERR_BADHANDLE. A failed infrastructure/pollutant index check returns SWMM_ERR_BADINDEX. No lifecycle guard in this wrapper; authoring edits do not generally rebuild running hydraulic/geometry caches. Numeric values are stored verbatim without finite/range validation.

◆ swmm_transect_set_comments()

SWMM_ENGINE_API int swmm_transect_set_comments ( SWMM_Engine engine,
int idx,
const char * text )

Set the free-form comments / description for a transect.

Parameters
[in]engineEngine handle.
[in]idxZero-based transect index.
[in]textNull-terminated comment string. NULL clears the comment.
Returns
SWMM_OK on success, or an error code.
Note
A null engine returns SWMM_ERR_BADHANDLE. A failed infrastructure/pollutant index check returns SWMM_ERR_BADINDEX. No lifecycle guard in this wrapper; authoring edits do not generally rebuild running hydraulic/geometry caches. Numeric values are stored verbatim without finite/range validation.

◆ swmm_transect_set_encroachment_stations()

SWMM_ENGINE_API int swmm_transect_set_encroachment_stations ( SWMM_Engine engine,
int idx,
double x_left,
double x_right )

Set the left and right encroachment stations for a transect (BQ-TR-02).

Encroachment stations are distinct from bank stations and identify floodplain encroachment limits (HEC-RAS convention). On legacy [TRANSECTS] X1 records that omit the trailing encroachment columns, the INP parser may default these to the bank stations to preserve backward compatibility; callers writing programmatic values via this API are setting them explicitly.

Parameters
[in]engineEngine handle.
[in]idxZero-based transect index.
[in]x_leftStation of the left encroachment limit.
[in]x_rightStation of the right encroachment limit.
Returns
SWMM_OK on success, or an error code.
Note
A null engine returns SWMM_ERR_BADHANDLE. A failed infrastructure/pollutant index check returns SWMM_ERR_BADINDEX. No lifecycle guard in this wrapper; authoring edits do not generally rebuild running hydraulic/geometry caches. Numeric values are stored verbatim without finite/range validation.

◆ swmm_transect_set_modifiers()

SWMM_ENGINE_API int swmm_transect_set_modifiers ( SWMM_Engine engine,
int idx,
double x_factor,
double y_factor,
double length_factor )

Set the station, elevation, and meander modifiers for a transect.

Maps to the xFactor, yFactor, and lengthFactor parameters on the [TRANSECTS] X1 record:

  • x_factor = station-spacing multiplier (default 1.0).
  • y_factor = elevation offset added to every station elevation (default 0.0 — engine stores 1.0 as a no-op marker at swmm_transect_add time).
  • length_factor = meander factor = channel / floodplain length ratio (default 1.0).
Parameters
[in]engineEngine handle.
[in]idxZero-based transect index.
[in]x_factorStation spacing multiplier.
[in]y_factorElevation offset.
[in]length_factorMeander factor (channel/floodplain length ratio).
Returns
SWMM_OK on success, or an error code.
Note
A null engine returns SWMM_ERR_BADHANDLE. A failed infrastructure/pollutant index check returns SWMM_ERR_BADINDEX. No lifecycle guard in this wrapper; authoring edits do not generally rebuild running hydraulic/geometry caches. Numeric values are stored verbatim without finite/range validation.

◆ swmm_transect_set_roughness()

SWMM_ENGINE_API int swmm_transect_set_roughness ( SWMM_Engine engine,
int idx,
double n_left,
double n_right,
double n_channel )

Set Manning's roughness for left overbank, right overbank, and channel.

Parameters
[in]engineEngine handle.
[in]idxZero-based transect index.
[in]n_leftManning's n for the left overbank.
[in]n_rightManning's n for the right overbank.
[in]n_channelManning's n for the main channel.
Returns
SWMM_OK on success, or an error code.
Note
A null engine returns SWMM_ERR_BADHANDLE. A failed infrastructure/pollutant index check returns SWMM_ERR_BADINDEX. No lifecycle guard in this wrapper; authoring edits do not generally rebuild running hydraulic/geometry caches. Numeric values are stored verbatim without finite/range validation.