16#ifndef OPENSWMM_NODES_H
17#define OPENSWMM_NODES_H
307 int pollutant_idx,
double mass_rate);
335 int pollutant_idx,
double* conc);
447 double p1,
double p2,
double p3);
459 double* p1,
double* p2,
double* p3);
837 double* buf,
int count);
957 double volume,
double* depth);
972 char* buf,
int buflen);
#define SWMM_ENGINE_API
Definition openswmm_2d.h:37
void * SWMM_Engine
Opaque handle to an OpenSWMM Engine instance.
Definition openswmm_callbacks.h:35
OpenSWMM Engine — primary transparent C API (master header).
SWMM_ENGINE_API int swmm_node_get_depth_from_volume(SWMM_Engine engine, int idx, double volume, double *depth)
Compute depth from volume for a node (inverse of volume-depth curve).
Definition openswmm_nodes_impl.cpp:1008
SWMM_ENGINE_API int swmm_node_get_stat_max_overflow(SWMM_Engine engine, int idx, double *val)
Get the maximum overflow rate recorded at a node.
Definition openswmm_nodes_impl.cpp:957
SWMM_ENGINE_API int swmm_node_set_lat_inflows_bulk(SWMM_Engine engine, const double *buf, int count)
Set lateral inflows for all nodes in a single call (runtime override).
Definition openswmm_nodes_impl.cpp:391
SWMM_ENGINE_API int swmm_node_get_quality(SWMM_Engine engine, int node_idx, int pollutant_idx, double *conc)
Get the pollutant concentration at a node.
Definition openswmm_nodes_impl.cpp:323
SWMM_ENGINE_API int swmm_node_get_depths_bulk(SWMM_Engine engine, double *buf, int count)
Get depths for all nodes in a single call.
Definition openswmm_nodes_impl.cpp:340
SWMM_ENGINE_API int swmm_node_get_type(SWMM_Engine engine, int idx, int *type)
Get the type of a node.
Definition openswmm_nodes_impl.cpp:179
SWMM_ENGINE_API int swmm_node_set_storage_curve(SWMM_Engine engine, int idx, int curve_idx)
Assign a storage curve (depth vs. area) to a storage node.
Definition openswmm_nodes_impl.cpp:502
SWMM_ENGINE_API int swmm_node_set_exfil_params(SWMM_Engine engine, int idx, double suction, double ksat, double imd)
Set Green–Ampt exfiltration parameters for a storage node.
Definition openswmm_nodes_impl.cpp:675
SWMM_ENGINE_API int swmm_node_get_inflow(SWMM_Engine engine, int idx, double *inflow)
Get the total inflow to a node (lateral + upstream links).
Definition openswmm_nodes_impl.cpp:256
SWMM_ENGINE_API int swmm_node_set_depth(SWMM_Engine engine, int idx, double depth)
Set the water depth at a node (runtime override).
Definition openswmm_nodes_impl.cpp:215
SWMM_ENGINE_API int swmm_node_set_outfall_route_to(SWMM_Engine engine, int idx, int subcatch_idx)
Set outfall route-to subcatchment index (-1 = none).
Definition openswmm_nodes_impl.cpp:985
SWMM_ENGINE_API int swmm_node_get_lateral_inflows_bulk(SWMM_Engine engine, double *buf, int count)
Get current lateral inflows for all nodes in a single call.
Definition openswmm_nodes_impl.cpp:445
SWMM_ENGINE_API int swmm_node_set_outfall_stage(SWMM_Engine engine, int idx, double stage)
Set a fixed outfall stage (for FIXED type outfalls).
Definition openswmm_nodes_impl.cpp:734
SWMM_ENGINE_API int swmm_node_get_degree(SWMM_Engine engine, int idx, int *degree)
Get the degree (number of connected links) of a node.
Definition openswmm_nodes_impl.cpp:937
SWMM_ENGINE_API int swmm_node_set_max_depth(SWMM_Engine engine, int idx, double depth)
Set a node's maximum depth (distance from invert to crown).
Definition openswmm_nodes_impl.cpp:137
SWMM_ENGINE_API int swmm_node_get_outflows_bulk(SWMM_Engine engine, double *buf, int count)
Get current outflows for all nodes in a single call.
Definition openswmm_nodes_impl.cpp:425
SWMM_ENGINE_API int swmm_node_set_pond_area(SWMM_Engine engine, int idx, double area)
Set the ponded surface area when depth exceeds the maximum.
Definition openswmm_nodes_impl.cpp:155
SWMM_ENGINE_API int swmm_node_set_outfall_type(SWMM_Engine engine, int idx, int type)
Set the outfall boundary condition type.
Definition openswmm_nodes_impl.cpp:712
SWMM_ENGINE_API int swmm_node_get_crown_elev(SWMM_Engine engine, int idx, double *elev)
Get the crown elevation (invert + max depth) at a node.
Definition openswmm_nodes_impl.cpp:905
SWMM_ENGINE_API int swmm_node_get_exfil_params(SWMM_Engine engine, int idx, double *suction, double *ksat, double *imd)
Get Green–Ampt exfiltration parameters for a storage node.
Definition openswmm_nodes_impl.cpp:690
SWMM_ENGINE_API int swmm_node_get_storage_curve(SWMM_Engine engine, int idx, int *curve_idx)
Get the storage curve index assigned to a storage node.
Definition openswmm_nodes_impl.cpp:520
SWMM_ENGINE_API int swmm_node_rename(SWMM_Engine engine, int idx, const char *newId)
Rename the node at idx to newId. Returns SWMM_ERR_BADPARAM if newId is null, empty,...
Definition openswmm_nodes_impl.cpp:1028
SWMM_ENGINE_API int swmm_node_get_storage_shape(SWMM_Engine engine, int idx, int *shape)
Get a storage node's surface-area relation.
Definition openswmm_nodes_impl.cpp:599
SWMM_NodeType
Node type classification.
Definition openswmm_nodes.h:32
@ SWMM_NODE_JUNCTION
Definition openswmm_nodes.h:33
@ SWMM_NODE_OUTFALL
Definition openswmm_nodes.h:34
@ SWMM_NODE_DIVIDER
Definition openswmm_nodes.h:36
@ SWMM_NODE_STORAGE
Definition openswmm_nodes.h:35
SWMM_ENGINE_API int swmm_node_get_full_volume(SWMM_Engine engine, int idx, double *vol)
Get the full (maximum) stored volume at a node.
Definition openswmm_nodes_impl.cpp:913
SWMM_ENGINE_API int swmm_node_get_tag(SWMM_Engine engine, int idx, char *buf, int buflen)
Read the tag string into buf (NUL-terminated, truncated to buflen-1 chars if necessary)....
Definition openswmm_nodes_impl.cpp:1037
SWMM_ENGINE_API int swmm_node_set_storage_geometry(SWMM_Engine engine, int idx, double p1, double p2, double p3)
Set the raw dimensions of a geometric storage shape.
Definition openswmm_nodes_impl.cpp:612
SWMM_ENGINE_API int swmm_node_set_storage_functional(SWMM_Engine engine, int idx, double a, double b, double c)
Set functional storage parameters: Area = a * Depth^b + c.
Definition openswmm_nodes_impl.cpp:531
SWMM_ENGINE_API int swmm_node_get_outflow(SWMM_Engine engine, int idx, double *outflow)
Get the total outflow from a node through downstream links.
Definition openswmm_nodes_impl.cpp:929
SWMM_ENGINE_API int swmm_node_get_volume(SWMM_Engine engine, int idx, double *volume)
Get the current stored water volume at a node.
Definition openswmm_nodes_impl.cpp:232
SWMM_ENGINE_API int swmm_node_pop_last(SWMM_Engine engine, const char *id)
Remove the most recently added node (undo-of-add).
Definition openswmm_nodes_impl.cpp:92
SWMM_ENGINE_API int swmm_node_get_stat_max_depth(SWMM_Engine engine, int idx, double *val)
Get the maximum depth recorded at a node during the simulation.
Definition openswmm_nodes_impl.cpp:949
SWMM_ENGINE_API int swmm_node_get_quality_bulk(SWMM_Engine engine, int pollutant_idx, double *buf, int count)
Get pollutant concentrations at all nodes for one pollutant.
Definition openswmm_nodes_impl.cpp:482
SWMM_ENGINE_API int swmm_node_get_storage_functional(SWMM_Engine engine, int idx, double *a, double *b, double *c)
Get functional storage parameters.
Definition openswmm_nodes_impl.cpp:551
SWMM_ENGINE_API int swmm_node_get_max_depth(SWMM_Engine engine, int idx, double *depth)
Get a node's maximum depth.
Definition openswmm_nodes_impl.cpp:195
SWMM_DividerType
Flow divider method.
Definition openswmm_nodes.h:629
@ SWMM_DIVIDER_CUTOFF
Definition openswmm_nodes.h:630
@ SWMM_DIVIDER_TABULAR
Definition openswmm_nodes.h:632
@ SWMM_DIVIDER_WEIR
Definition openswmm_nodes.h:633
@ SWMM_DIVIDER_OVERFLOW
Definition openswmm_nodes.h:631
SWMM_ENGINE_API int swmm_node_get_storage_seep_rate(SWMM_Engine engine, int idx, double *rate)
Get the seepage rate for a storage node.
Definition openswmm_nodes_impl.cpp:665
SWMM_ENGINE_API const char * swmm_node_id(SWMM_Engine engine, int idx)
Get the string identifier of a node by index.
Definition openswmm_nodes_impl.cpp:46
SWMM_ENGINE_API int swmm_node_set_depths_bulk(SWMM_Engine engine, const double *buf, int count)
Set depths for all nodes in a single call (runtime override).
Definition openswmm_nodes_impl.cpp:380
SWMM_ENGINE_API int swmm_node_get_volumes_bulk(SWMM_Engine engine, double *buf, int count)
Get current stored volumes for all nodes in a single call.
Definition openswmm_nodes_impl.cpp:415
SWMM_ENGINE_API int swmm_node_get_divider_type(SWMM_Engine engine, int idx, int *type)
Get the divider method for a flow-divider node.
Definition openswmm_nodes_impl.cpp:862
SWMM_ENGINE_API int swmm_node_get_depth(SWMM_Engine engine, int idx, double *depth)
Get the current water depth at a node.
Definition openswmm_nodes_impl.cpp:207
SWMM_ENGINE_API int swmm_node_set_storage_shape(SWMM_Engine engine, int idx, int shape)
Set a storage node's surface-area relation.
Definition openswmm_nodes_impl.cpp:569
SWMM_ENGINE_API int swmm_node_get_initial_depth(SWMM_Engine engine, int idx, double *depth)
Get the initial depth at a node.
Definition openswmm_nodes_impl.cpp:897
SWMM_ENGINE_API int swmm_node_set_outfall_timeseries(SWMM_Engine engine, int idx, int ts_idx)
Assign a time series to an outfall (for TIMESERIES type outfalls).
Definition openswmm_nodes_impl.cpp:763
SWMM_ENGINE_API int swmm_node_index(SWMM_Engine engine, const char *id)
Look up a node's zero-based index by its string identifier.
Definition openswmm_nodes_impl.cpp:41
SWMM_ENGINE_API int swmm_node_set_surcharge_depth(SWMM_Engine engine, int idx, double depth)
Set the allowed surcharge depth above the node's crown.
Definition openswmm_nodes_impl.cpp:146
SWMM_ENGINE_API int swmm_node_get_surcharge_depth(SWMM_Engine engine, int idx, double *depth)
Get the surcharge depth above the node's crown.
Definition openswmm_nodes_impl.cpp:877
SWMM_ENGINE_API int swmm_node_get_stat_vol_flooded(SWMM_Engine engine, int idx, double *val)
Get the total flood volume at a node over the simulation.
Definition openswmm_nodes_impl.cpp:965
SWMM_ENGINE_API int swmm_node_get_losses(SWMM_Engine engine, int idx, double *losses)
Get the cumulative water losses at a node (evaporation + exfiltration).
Definition openswmm_nodes_impl.cpp:921
SWMM_ENGINE_API int swmm_node_set_lateral_inflow(SWMM_Engine engine, int idx, double flow)
Override the lateral inflow at a node for the current timestep.
Definition openswmm_nodes_impl.cpp:269
SWMM_ENGINE_API int swmm_node_get_overflow(SWMM_Engine engine, int idx, double *overflow)
Get the current overflow (flooding) rate at a node.
Definition openswmm_nodes_impl.cpp:248
SWMM_ENGINE_API int swmm_node_get_lateral_inflow(SWMM_Engine engine, int idx, double *inflow)
Get the current lateral inflow at a node.
Definition openswmm_nodes_impl.cpp:240
SWMM_ENGINE_API int swmm_node_get_ponded_area(SWMM_Engine engine, int idx, double *area)
Get the ponded area at a node.
Definition openswmm_nodes_impl.cpp:885
SWMM_ENGINE_API int swmm_node_get_heads_bulk(SWMM_Engine engine, double *buf, int count)
Get hydraulic heads for all nodes in a single call.
Definition openswmm_nodes_impl.cpp:350
SWMM_ENGINE_API int swmm_node_set_quality_mass_flux(SWMM_Engine engine, int node_idx, int pollutant_idx, double mass_rate)
Set a persistent quality mass flux at a node (mass/sec).
Definition openswmm_nodes_impl.cpp:283
SWMM_ENGINE_API int swmm_node_get_outfall_type(SWMM_Engine engine, int idx, int *type)
Get the outfall boundary condition type.
Definition openswmm_nodes_impl.cpp:723
SWMM_ENGINE_API int swmm_node_get_invert_elev(SWMM_Engine engine, int idx, double *elev)
Get a node's invert elevation.
Definition openswmm_nodes_impl.cpp:187
SWMM_ENGINE_API int swmm_node_get_overflows_bulk(SWMM_Engine engine, double *buf, int count)
Get overflow rates for all nodes in a single call.
Definition openswmm_nodes_impl.cpp:370
SWMM_ENGINE_API int swmm_node_get_ids_bulk(SWMM_Engine engine, char *buf, int stride, int count)
Get node IDs for all nodes in a single call (stride-packed UTF-8).
Definition openswmm_nodes_impl.cpp:455
SWMM_ENGINE_API int swmm_node_set_initial_depth(SWMM_Engine engine, int idx, double depth)
Set a node's initial water depth at simulation start.
Definition openswmm_nodes_impl.cpp:166
SWMM_ENGINE_API int swmm_node_get_outfall_param(SWMM_Engine engine, int idx, double *param)
Get the outfall stage parameter (fixed stage, or current computed stage).
Definition openswmm_nodes_impl.cpp:777
SWMM_ENGINE_API int swmm_node_get_storage_geometry(SWMM_Engine engine, int idx, double *p1, double *p2, double *p3)
Get the raw dimensions of a geometric storage shape.
Definition openswmm_nodes_impl.cpp:635
SWMM_ENGINE_API int swmm_node_set_outfall_tidal(SWMM_Engine engine, int idx, int curve_idx)
Assign a tidal curve to an outfall (for TIDAL type outfalls).
Definition openswmm_nodes_impl.cpp:749
SWMM_ENGINE_API int swmm_node_get_outfall_route_to(SWMM_Engine engine, int idx, int *subcatch_idx)
Get outfall route-to subcatchment index (-1 = none).
Definition openswmm_nodes_impl.cpp:994
SWMM_ENGINE_API int swmm_node_get_outfall_timeseries(SWMM_Engine engine, int idx, int *ts_idx)
Get the time-series index assigned to a TIMESERIES outfall.
Definition openswmm_nodes_impl.cpp:811
SWMM_ENGINE_API int swmm_node_get_head(SWMM_Engine engine, int idx, double *head)
Get the current hydraulic head at a node (invert + depth).
Definition openswmm_nodes_impl.cpp:224
SWMM_StorageShape
Storage-unit surface-area relation codes.
Definition openswmm_nodes.h:393
@ SWMM_STORAGE_CONICAL
Definition openswmm_nodes.h:397
@ SWMM_STORAGE_PARABOLOID
Definition openswmm_nodes.h:398
@ SWMM_STORAGE_FUNCTIONAL
Definition openswmm_nodes.h:395
@ SWMM_STORAGE_PYRAMIDAL
Definition openswmm_nodes.h:399
@ SWMM_STORAGE_TABULAR
Definition openswmm_nodes.h:394
@ SWMM_STORAGE_CYLINDRICAL
Definition openswmm_nodes.h:396
SWMM_ENGINE_API int swmm_node_set_head_boundary(SWMM_Engine engine, int idx, double head)
Set a fixed head boundary condition at a node.
Definition openswmm_nodes_impl.cpp:302
SWMM_ENGINE_API int swmm_node_get_outfall_flap_gate(SWMM_Engine engine, int idx, int *has_gate)
Get whether a flap gate exists at the outfall.
Definition openswmm_nodes_impl.cpp:835
SWMM_ENGINE_API int swmm_node_set_tag(SWMM_Engine engine, int idx, const char *tag)
Set or clear the node's tag. Pass null or empty string to clear. Tag persists across swmm_node_rename...
Definition openswmm_nodes_impl.cpp:1052
SWMM_ENGINE_API int swmm_node_set_outfall_flap_gate(SWMM_Engine engine, int idx, int has_gate)
Set whether a flap gate exists at the outfall.
Definition openswmm_nodes_impl.cpp:825
SWMM_ENGINE_API int swmm_node_get_outfall_tidal(SWMM_Engine engine, int idx, int *curve_idx)
Get the tidal curve index assigned to a TIDAL outfall.
Definition openswmm_nodes_impl.cpp:797
SWMM_ENGINE_API int swmm_node_set_divider_type(SWMM_Engine engine, int idx, int type)
Set the divider method for a flow-divider node.
Definition openswmm_nodes_impl.cpp:849
SWMM_ENGINE_API int swmm_node_count(SWMM_Engine engine)
Get the total number of nodes in the model.
Definition openswmm_nodes_impl.cpp:36
SWMM_ENGINE_API int swmm_node_add(SWMM_Engine engine, const char *id, int type)
Add a new node to the model.
Definition openswmm_nodes_impl.cpp:61
SWMM_ENGINE_API int swmm_node_set_invert_elev(SWMM_Engine engine, int idx, double elev)
Set a node's invert elevation.
Definition openswmm_nodes_impl.cpp:128
SWMM_ENGINE_API int swmm_node_get_stat_time_flooded(SWMM_Engine engine, int idx, double *val)
Get the total time a node was flooded during the simulation.
Definition openswmm_nodes_impl.cpp:973
SWMM_ENGINE_API int swmm_node_set_storage_seep_rate(SWMM_Engine engine, int idx, double rate)
Set the seepage rate for a storage node.
Definition openswmm_nodes_impl.cpp:655
SWMM_ENGINE_API int swmm_node_get_inflows_bulk(SWMM_Engine engine, double *buf, int count)
Get total inflows for all nodes in a single call.
Definition openswmm_nodes_impl.cpp:360
SWMM_ENGINE_API int swmm_node_get_losses_bulk(SWMM_Engine engine, double *buf, int count)
Get accumulated node losses (exfil + evap) for all nodes in one call.
Definition openswmm_nodes_impl.cpp:435