OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
openswmm_nodes.h
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
2//
3// Copyright 2026 Caleb Buahin
4//
5// Licensed under the Apache License, Version 2.0 (the "License");
6// you may not use this file except in compliance with the License.
7// You may obtain a copy of the License at
8//
9// http://www.apache.org/licenses/LICENSE-2.0
10//
11// Unless required by applicable law or agreed to in writing, software
12// distributed under the License is distributed on an "AS IS" BASIS,
13// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14// See the License for the specific language governing permissions and
15// limitations under the License.
16
31
32#ifndef OPENSWMM_NODES_H
33#define OPENSWMM_NODES_H
34
35#include "openswmm_engine.h"
36
37#ifdef __cplusplus
38extern "C" {
39#endif
40
54
55/* =========================================================================
56 * Identity
57 * ========================================================================= */
58
65
72SWMM_ENGINE_API int swmm_node_index(SWMM_Engine engine, const char* id);
73
80SWMM_ENGINE_API const char* swmm_node_id(SWMM_Engine engine, int idx);
81
82/* =========================================================================
83 * Creation (BUILDING or OPENED — "editable" states)
84 * ========================================================================= */
85
105SWMM_ENGINE_API int swmm_node_add(SWMM_Engine engine, const char* id, int type);
106
128SWMM_ENGINE_API int swmm_node_pop_last(SWMM_Engine engine, const char* id);
129
130/* =========================================================================
131 * Geometry setters (BUILDING or OPENED)
132 * ========================================================================= */
133
141SWMM_ENGINE_API int swmm_node_set_invert_elev(SWMM_Engine engine, int idx, double elev);
142
150SWMM_ENGINE_API int swmm_node_set_max_depth(SWMM_Engine engine, int idx, double depth);
151
159SWMM_ENGINE_API int swmm_node_set_surcharge_depth(SWMM_Engine engine, int idx, double depth);
160
172SWMM_ENGINE_API int swmm_node_set_pond_area(SWMM_Engine engine, int idx, double area);
173
181SWMM_ENGINE_API int swmm_node_set_initial_depth(SWMM_Engine engine, int idx, double depth);
182
202SWMM_ENGINE_API int swmm_node_set_rim_depth(SWMM_Engine engine, int idx, double depth);
203
204/* =========================================================================
205 * Geometry getters
206 * ========================================================================= */
207
215SWMM_ENGINE_API int swmm_node_get_type(SWMM_Engine engine, int idx, int* type);
216
230SWMM_ENGINE_API int swmm_node_is_virtual(SWMM_Engine engine, int idx, int* is_virtual);
231
252SWMM_ENGINE_API int swmm_node_set_virtual(SWMM_Engine engine, int idx, int make_virtual);
253
271SWMM_ENGINE_API int swmm_node_virtual_eligible(SWMM_Engine engine, int idx, int* rule_code);
272
273/* -------------------------------------------------------------------------
274 * Inlet junctions (2026-09-05). An inlet junction is a virtual junction
275 * (is_virtual = 1) that additionally carries is_inlet = 1, sits between two
276 * STREET conduits (or RECT_OPEN/TRAPEZOIDAL for drop-inlet designs), owns one
277 * inlet-usage row (swmm_inlet_usage_set with SWMM_INLET_HOST_NODE) naming the
278 * inlet design and the capture node, and — unlike a plain virtual junction —
279 * is NOT sealed: it floods above the street section's full depth (or the
280 * [INLET_JUNCTIONS] MaxDepth when supplied) and receives the capture node's
281 * overflow back as street flow.
282 * ------------------------------------------------------------------------- */
283
285SWMM_ENGINE_API int swmm_node_is_inlet(SWMM_Engine engine, int idx, int* is_inlet);
286
293SWMM_ENGINE_API int swmm_node_inlet_eligible(SWMM_Engine engine, int idx, int for_drop_inlet, int* rule_code);
294
303SWMM_ENGINE_API int swmm_node_set_inlet(SWMM_Engine engine, int idx, int make_inlet);
304
312SWMM_ENGINE_API int swmm_node_get_invert_elev(SWMM_Engine engine, int idx, double* elev);
313
321SWMM_ENGINE_API int swmm_node_get_max_depth(SWMM_Engine engine, int idx, double* depth);
322
335SWMM_ENGINE_API int swmm_node_get_rim_depth(SWMM_Engine engine, int idx, double* depth);
336
337/* =========================================================================
338 * Hydraulic state getters/setters
339 * ========================================================================= */
340
348SWMM_ENGINE_API int swmm_node_get_depth(SWMM_Engine engine, int idx, double* depth);
349
357SWMM_ENGINE_API int swmm_node_set_depth(SWMM_Engine engine, int idx, double depth);
358
366SWMM_ENGINE_API int swmm_node_get_head(SWMM_Engine engine, int idx, double* head);
367
375SWMM_ENGINE_API int swmm_node_get_volume(SWMM_Engine engine, int idx, double* volume);
376
389SWMM_ENGINE_API int swmm_node_get_lateral_inflow(SWMM_Engine engine, int idx, double* inflow);
390
402SWMM_ENGINE_API int swmm_node_get_overflow(SWMM_Engine engine, int idx, double* overflow);
403
411SWMM_ENGINE_API int swmm_node_get_inflow(SWMM_Engine engine, int idx, double* inflow);
412
413/* =========================================================================
414 * Runtime forcing (RUNNING state only)
415 * ========================================================================= */
416
429SWMM_ENGINE_API int swmm_node_set_lateral_inflow(SWMM_Engine engine, int idx, double flow);
430
446 int pollutant_idx, double mass_rate);
447
459SWMM_ENGINE_API int swmm_node_set_head_boundary(SWMM_Engine engine, int idx, double head);
460
461/* =========================================================================
462 * Water quality
463 * ========================================================================= */
464
473SWMM_ENGINE_API int swmm_node_get_quality(SWMM_Engine engine, int node_idx,
474 int pollutant_idx, double* conc);
475
476/* =========================================================================
477 * Storage Node API
478 * ========================================================================= */
479
487SWMM_ENGINE_API int swmm_node_set_storage_curve(SWMM_Engine engine, int idx, int curve_idx);
488
496SWMM_ENGINE_API int swmm_node_get_storage_curve(SWMM_Engine engine, int idx, int* curve_idx);
497
511SWMM_ENGINE_API int swmm_node_set_storage_functional(SWMM_Engine engine, int idx, double a, double b, double c);
512
522SWMM_ENGINE_API int swmm_node_get_storage_functional(SWMM_Engine engine, int idx, double* a, double* b, double* c);
523
540
555SWMM_ENGINE_API int swmm_node_set_storage_shape(SWMM_Engine engine, int idx, int shape);
556
564SWMM_ENGINE_API int swmm_node_get_storage_shape(SWMM_Engine engine, int idx, int* shape);
565
586 double p1, double p2, double p3);
587
598 double* p1, double* p2, double* p3);
599
607SWMM_ENGINE_API int swmm_node_set_storage_seep_rate(SWMM_Engine engine, int idx, double rate);
608
616SWMM_ENGINE_API int swmm_node_get_storage_seep_rate(SWMM_Engine engine, int idx, double* rate);
617
631SWMM_ENGINE_API int swmm_node_set_exfil_params(SWMM_Engine engine, int idx, double suction, double ksat, double imd);
632
642SWMM_ENGINE_API int swmm_node_get_exfil_params(SWMM_Engine engine, int idx, double* suction, double* ksat, double* imd);
643
644/* =========================================================================
645 * Outfall Node API
646 * ========================================================================= */
647
658SWMM_ENGINE_API int swmm_node_set_outfall_type(SWMM_Engine engine, int idx, int type);
659
667SWMM_ENGINE_API int swmm_node_get_outfall_type(SWMM_Engine engine, int idx, int* type);
668
676SWMM_ENGINE_API int swmm_node_set_outfall_stage(SWMM_Engine engine, int idx, double stage);
677
685SWMM_ENGINE_API int swmm_node_set_outfall_tidal(SWMM_Engine engine, int idx, int curve_idx);
686
694SWMM_ENGINE_API int swmm_node_set_outfall_timeseries(SWMM_Engine engine, int idx, int ts_idx);
695
703SWMM_ENGINE_API int swmm_node_get_outfall_param(SWMM_Engine engine, int idx, double* param);
704
719SWMM_ENGINE_API int swmm_node_get_outfall_tidal(SWMM_Engine engine, int idx, int* curve_idx);
720
733SWMM_ENGINE_API int swmm_node_get_outfall_timeseries(SWMM_Engine engine, int idx, int* ts_idx);
734
745SWMM_ENGINE_API int swmm_node_set_outfall_flap_gate(SWMM_Engine engine, int idx, int has_gate);
746
754SWMM_ENGINE_API int swmm_node_get_outfall_flap_gate(SWMM_Engine engine, int idx, int* has_gate);
755
756/* =========================================================================
757 * Divider Node API
758 * ========================================================================= */
759
774
782SWMM_ENGINE_API int swmm_node_set_divider_type(SWMM_Engine engine, int idx, int type);
783
791SWMM_ENGINE_API int swmm_node_get_divider_type(SWMM_Engine engine, int idx, int* type);
792
793/* =========================================================================
794 * Additional Geometry / State Getters
795 * ========================================================================= */
796
804SWMM_ENGINE_API int swmm_node_get_surcharge_depth(SWMM_Engine engine, int idx, double* depth);
805
813SWMM_ENGINE_API int swmm_node_get_ponded_area(SWMM_Engine engine, int idx, double* area);
814
822SWMM_ENGINE_API int swmm_node_get_initial_depth(SWMM_Engine engine, int idx, double* depth);
823
831SWMM_ENGINE_API int swmm_node_get_crown_elev(SWMM_Engine engine, int idx, double* elev);
832
840SWMM_ENGINE_API int swmm_node_get_full_volume(SWMM_Engine engine, int idx, double* vol);
841
849SWMM_ENGINE_API int swmm_node_get_losses(SWMM_Engine engine, int idx, double* losses);
850
858SWMM_ENGINE_API int swmm_node_get_outflow(SWMM_Engine engine, int idx, double* outflow);
859
867SWMM_ENGINE_API int swmm_node_get_degree(SWMM_Engine engine, int idx, int* degree);
868
869/* =========================================================================
870 * Node Statistics
871 * ========================================================================= */
872
880SWMM_ENGINE_API int swmm_node_get_stat_max_depth(SWMM_Engine engine, int idx, double* val);
881
889SWMM_ENGINE_API int swmm_node_get_stat_max_overflow(SWMM_Engine engine, int idx, double* val);
890
898SWMM_ENGINE_API int swmm_node_get_stat_vol_flooded(SWMM_Engine engine, int idx, double* val);
899
907SWMM_ENGINE_API int swmm_node_get_stat_time_flooded(SWMM_Engine engine, int idx, double* val);
908
909/* =========================================================================
910 * Bulk access
911 * ========================================================================= */
912
920SWMM_ENGINE_API int swmm_node_get_depths_bulk(SWMM_Engine engine, double* buf, int count);
921
929SWMM_ENGINE_API int swmm_node_get_heads_bulk(SWMM_Engine engine, double* buf, int count);
930
938SWMM_ENGINE_API int swmm_node_get_inflows_bulk(SWMM_Engine engine, double* buf, int count);
939
947SWMM_ENGINE_API int swmm_node_get_overflows_bulk(SWMM_Engine engine, double* buf, int count);
948
956SWMM_ENGINE_API int swmm_node_set_depths_bulk(SWMM_Engine engine, const double* buf, int count);
957
965SWMM_ENGINE_API int swmm_node_set_lat_inflows_bulk(SWMM_Engine engine, const double* buf, int count);
966
975SWMM_ENGINE_API int swmm_node_get_quality_bulk(SWMM_Engine engine, int pollutant_idx,
976 double* buf, int count);
977
994SWMM_ENGINE_API int swmm_node_get_volumes_bulk(SWMM_Engine engine, double* buf, int count);
995
1007SWMM_ENGINE_API int swmm_node_get_outflows_bulk(SWMM_Engine engine, double* buf, int count);
1008
1020SWMM_ENGINE_API int swmm_node_get_losses_bulk(SWMM_Engine engine, double* buf, int count);
1021
1034SWMM_ENGINE_API int swmm_node_get_lateral_inflows_bulk(SWMM_Engine engine, double* buf, int count);
1035
1076 char* buf,
1077 int stride,
1078 int count);
1079
1080/* =========================================================================
1081 * Outfall-to-subcatchment routing
1082 * ========================================================================= */
1083
1085SWMM_ENGINE_API int swmm_node_set_outfall_route_to(SWMM_Engine engine, int idx, int subcatch_idx);
1086
1088SWMM_ENGINE_API int swmm_node_get_outfall_route_to(SWMM_Engine engine, int idx, int* subcatch_idx);
1089
1090/* =========================================================================
1091 * Depth from volume (inverse of getVolume)
1092 * ========================================================================= */
1093
1096 double volume, double* depth);
1097
1101SWMM_ENGINE_API int swmm_node_rename(SWMM_Engine engine, int idx, const char* newId);
1102
1103/* =========================================================================
1104 * Tag — free-form string label from the INP `[TAGS]` section
1105 * ========================================================================= */
1106
1111 char* buf, int buflen);
1112
1117 const char* tag);
1118
1119#ifdef __cplusplus
1120} /* extern "C" */
1121#endif
1122
1123#endif /* OPENSWMM_NODES_H */
#define SWMM_ENGINE_API
Definition openswmm_2d.h:53
void * SWMM_Engine
Opaque handle to an OpenSWMM Engine instance.
Definition openswmm_callbacks.h:51
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:1109
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:1058
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:492
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:424
SWMM_ENGINE_API int swmm_node_is_virtual(SWMM_Engine engine, int idx, int *is_virtual)
Query whether a node is a virtual junction.
Definition openswmm_nodes_impl.cpp:216
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:441
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:208
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:603
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:776
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:357
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:316
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:1086
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:546
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:835
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:1038
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:154
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:526
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:172
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:813
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:1006
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:791
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:621
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:1129
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:700
SWMM_NodeType
Node type classification.
Definition openswmm_nodes.h:48
@ SWMM_NODE_JUNCTION
Definition openswmm_nodes.h:49
@ SWMM_NODE_OUTFALL
Definition openswmm_nodes.h:50
@ SWMM_NODE_DIVIDER
Definition openswmm_nodes.h:52
@ SWMM_NODE_STORAGE
Definition openswmm_nodes.h:51
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:1014
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:1138
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:713
SWMM_ENGINE_API int swmm_node_inlet_eligible(SWMM_Engine engine, int idx, int for_drop_inlet, int *rule_code)
Dry-run check of the inlet-junction rules (all virtual-junction rules plus 623: both attached conduit...
Definition openswmm_nodes_impl.cpp:259
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:632
SWMM_ENGINE_API int swmm_node_set_virtual(SWMM_Engine engine, int idx, int make_virtual)
Set or clear a node's virtual-junction flag.
Definition openswmm_nodes_impl.cpp:228
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:1030
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:333
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:109
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:1050
SWMM_ENGINE_API int swmm_node_set_rim_depth(SWMM_Engine engine, int idx, double depth)
Set a node's rendering-only rim (ground) depth above the invert.
Definition openswmm_nodes_impl.cpp:192
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:583
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:652
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:288
SWMM_DividerType
Flow divider method.
Definition openswmm_nodes.h:768
@ SWMM_DIVIDER_CUTOFF
Definition openswmm_nodes.h:769
@ SWMM_DIVIDER_TABULAR
Definition openswmm_nodes.h:771
@ SWMM_DIVIDER_WEIR
Definition openswmm_nodes.h:772
@ SWMM_DIVIDER_OVERFLOW
Definition openswmm_nodes.h:770
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:766
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:63
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:481
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:516
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:963
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:308
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:670
SWMM_ENGINE_API int swmm_node_is_inlet(SWMM_Engine engine, int idx, int *is_inlet)
Definition openswmm_nodes_impl.cpp:247
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:998
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:864
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:58
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:163
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:978
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:1066
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:1022
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:370
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:349
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:341
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:986
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:451
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:384
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:824
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:280
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:471
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:556
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:183
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:878
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:736
SWMM_ENGINE_API int swmm_node_get_rim_depth(SWMM_Engine engine, int idx, double *depth)
Get a node's rendering-only rim (ground) depth above the invert.
Definition openswmm_nodes_impl.cpp:296
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:850
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:1095
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:912
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:325
SWMM_StorageShape
Storage-unit surface-area relation codes.
Definition openswmm_nodes.h:532
@ SWMM_STORAGE_CONICAL
Definition openswmm_nodes.h:536
@ SWMM_STORAGE_PARABOLOID
Definition openswmm_nodes.h:537
@ SWMM_STORAGE_FUNCTIONAL
Definition openswmm_nodes.h:534
@ SWMM_STORAGE_PYRAMIDAL
Definition openswmm_nodes.h:538
@ SWMM_STORAGE_TABULAR
Definition openswmm_nodes.h:533
@ SWMM_STORAGE_CYLINDRICAL
Definition openswmm_nodes.h:535
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:403
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:936
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:1153
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:926
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:898
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:950
SWMM_ENGINE_API int swmm_node_virtual_eligible(SWMM_Engine engine, int idx, int *rule_code)
Dry-run check of the virtual-junction usage rules for a node.
Definition openswmm_nodes_impl.cpp:239
SWMM_ENGINE_API int swmm_node_set_inlet(SWMM_Engine engine, int idx, int make_inlet)
Promote a node to an inlet junction (sets is_virtual and is_inlet, applying the virtual-junction deri...
Definition openswmm_nodes_impl.cpp:269
SWMM_ENGINE_API int swmm_node_count(SWMM_Engine engine)
Get the total number of nodes in the model.
Definition openswmm_nodes_impl.cpp:53
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:78
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:145
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:1074
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:756
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:461
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:536