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
84SWMM_ENGINE_API const char* swmm_node_id(SWMM_Engine engine, int idx);
85
123 double* pollutant_amounts, int count);
124
125/* =========================================================================
126 * Creation (BUILDING or OPENED — "editable" states)
127 * ========================================================================= */
128
152SWMM_ENGINE_API int swmm_node_add(SWMM_Engine engine, const char* id, int type);
153
179SWMM_ENGINE_API int swmm_node_pop_last(SWMM_Engine engine, const char* id);
180
181/* =========================================================================
182 * Geometry setters (BUILDING or OPENED)
183 * ========================================================================= */
184
196SWMM_ENGINE_API int swmm_node_set_invert_elev(SWMM_Engine engine, int idx, double elev);
197
209SWMM_ENGINE_API int swmm_node_set_max_depth(SWMM_Engine engine, int idx, double depth);
210
222SWMM_ENGINE_API int swmm_node_set_surcharge_depth(SWMM_Engine engine, int idx, double depth);
223
226SWMM_ENGINE_API int swmm_node_set_storage_area(SWMM_Engine engine, int idx, double area);
228SWMM_ENGINE_API int swmm_node_get_storage_area(SWMM_Engine engine, int idx, double* area);
229
245SWMM_ENGINE_API int swmm_node_set_pond_area(SWMM_Engine engine, int idx, double area);
246
261SWMM_ENGINE_API int swmm_node_set_initial_depth(SWMM_Engine engine, int idx, double depth);
262
286SWMM_ENGINE_API int swmm_node_set_rim_depth(SWMM_Engine engine, int idx, double depth);
287
288/* =========================================================================
289 * Geometry getters
290 * ========================================================================= */
291
303SWMM_ENGINE_API int swmm_node_get_type(SWMM_Engine engine, int idx, int* type);
304
322SWMM_ENGINE_API int swmm_node_is_virtual(SWMM_Engine engine, int idx, int* is_virtual);
323
348SWMM_ENGINE_API int swmm_node_set_virtual(SWMM_Engine engine, int idx, int make_virtual);
349
371SWMM_ENGINE_API int swmm_node_virtual_eligible(SWMM_Engine engine, int idx, int* rule_code);
372
373/* -------------------------------------------------------------------------
374 * Inlet junctions (2026-09-05). An inlet junction is a virtual junction
375 * (is_virtual = 1) that additionally carries is_inlet = 1, sits between two
376 * STREET conduits (or RECT_OPEN/TRAPEZOIDAL for drop-inlet designs), owns one
377 * inlet-usage row (swmm_inlet_usage_set with SWMM_INLET_HOST_NODE) naming the
378 * inlet design and the capture node, and — unlike a plain virtual junction —
379 * is NOT sealed: it floods above the street section's full depth (or the
380 * [INLET_JUNCTIONS] MaxDepth when supplied) and receives the capture node's
381 * overflow back as street flow.
382 * ------------------------------------------------------------------------- */
383
392SWMM_ENGINE_API int swmm_node_is_inlet(SWMM_Engine engine, int idx, int* is_inlet);
393
408SWMM_ENGINE_API int swmm_node_inlet_eligible(SWMM_Engine engine, int idx, int for_drop_inlet,
409 int* rule_code);
410
425SWMM_ENGINE_API int swmm_node_set_inlet(SWMM_Engine engine, int idx, int make_inlet);
426
438SWMM_ENGINE_API int swmm_node_get_invert_elev(SWMM_Engine engine, int idx, double* elev);
439
451SWMM_ENGINE_API int swmm_node_get_max_depth(SWMM_Engine engine, int idx, double* depth);
452
469SWMM_ENGINE_API int swmm_node_get_rim_depth(SWMM_Engine engine, int idx, double* depth);
470
471/* =========================================================================
472 * Hydraulic state getters/setters
473 * ========================================================================= */
474
486SWMM_ENGINE_API int swmm_node_get_depth(SWMM_Engine engine, int idx, double* depth);
487
499SWMM_ENGINE_API int swmm_node_set_depth(SWMM_Engine engine, int idx, double depth);
500
512SWMM_ENGINE_API int swmm_node_get_head(SWMM_Engine engine, int idx, double* head);
513
526SWMM_ENGINE_API int swmm_node_get_volume(SWMM_Engine engine, int idx, double* volume);
527
544SWMM_ENGINE_API int swmm_node_get_lateral_inflow(SWMM_Engine engine, int idx, double* inflow);
545
561SWMM_ENGINE_API int swmm_node_get_overflow(SWMM_Engine engine, int idx, double* overflow);
562
574SWMM_ENGINE_API int swmm_node_get_inflow(SWMM_Engine engine, int idx, double* inflow);
575
576/* =========================================================================
577 * Runtime forcing (RUNNING state only)
578 * ========================================================================= */
579
594SWMM_ENGINE_API int swmm_node_set_lateral_inflow(SWMM_Engine engine, int idx, double flow);
595
611 int pollutant_idx, double mass_rate);
612
625SWMM_ENGINE_API int swmm_node_set_head_boundary(SWMM_Engine engine, int idx, double head);
626
627/* =========================================================================
628 * Water quality
629 * ========================================================================= */
630
643SWMM_ENGINE_API int swmm_node_get_quality(SWMM_Engine engine, int node_idx, int pollutant_idx,
644 double* conc);
645
646/* =========================================================================
647 * Storage Node API
648 * ========================================================================= */
649
662SWMM_ENGINE_API int swmm_node_set_storage_curve(SWMM_Engine engine, int idx, int curve_idx);
663
675SWMM_ENGINE_API int swmm_node_get_storage_curve(SWMM_Engine engine, int idx, int* curve_idx);
676
696 double b, double c);
697
713 double* b, double* c);
714
733
753SWMM_ENGINE_API int swmm_node_set_storage_shape(SWMM_Engine engine, int idx, int shape);
754
766SWMM_ENGINE_API int swmm_node_get_storage_shape(SWMM_Engine engine, int idx, int* shape);
767
792SWMM_ENGINE_API int swmm_node_set_storage_geometry(SWMM_Engine engine, int idx, double p1,
793 double p2, double p3);
794
809SWMM_ENGINE_API int swmm_node_get_storage_geometry(SWMM_Engine engine, int idx, double* p1,
810 double* p2, double* p3);
811
828SWMM_ENGINE_API int swmm_node_set_storage_seep_rate(SWMM_Engine engine, int idx, double rate);
829
844SWMM_ENGINE_API int swmm_node_get_storage_seep_rate(SWMM_Engine engine, int idx, double* rate);
845
864SWMM_ENGINE_API int swmm_node_set_exfil_params(SWMM_Engine engine, int idx, double suction,
865 double ksat, double imd);
866
881SWMM_ENGINE_API int swmm_node_get_exfil_params(SWMM_Engine engine, int idx, double* suction,
882 double* ksat, double* imd);
883
884/* =========================================================================
885 * Outfall Node API
886 * ========================================================================= */
887
903SWMM_ENGINE_API int swmm_node_set_outfall_type(SWMM_Engine engine, int idx, int type);
904
916SWMM_ENGINE_API int swmm_node_get_outfall_type(SWMM_Engine engine, int idx, int* type);
917
930SWMM_ENGINE_API int swmm_node_set_outfall_stage(SWMM_Engine engine, int idx, double stage);
931
944SWMM_ENGINE_API int swmm_node_set_outfall_tidal(SWMM_Engine engine, int idx, int curve_idx);
945
958SWMM_ENGINE_API int swmm_node_set_outfall_timeseries(SWMM_Engine engine, int idx, int ts_idx);
959
971SWMM_ENGINE_API int swmm_node_get_outfall_param(SWMM_Engine engine, int idx, double* param);
972
992SWMM_ENGINE_API int swmm_node_get_outfall_tidal(SWMM_Engine engine, int idx, int* curve_idx);
993
1011SWMM_ENGINE_API int swmm_node_get_outfall_timeseries(SWMM_Engine engine, int idx, int* ts_idx);
1012
1028SWMM_ENGINE_API int swmm_node_set_outfall_flap_gate(SWMM_Engine engine, int idx, int has_gate);
1029
1041SWMM_ENGINE_API int swmm_node_get_outfall_flap_gate(SWMM_Engine engine, int idx, int* has_gate);
1042
1043/* =========================================================================
1044 * Divider Node API
1045 * ========================================================================= */
1046
1061
1074SWMM_ENGINE_API int swmm_node_set_divider_type(SWMM_Engine engine, int idx, int type);
1075
1087SWMM_ENGINE_API int swmm_node_get_divider_type(SWMM_Engine engine, int idx, int* type);
1088
1089/* =========================================================================
1090 * Additional Geometry / State Getters
1091 * ========================================================================= */
1092
1104SWMM_ENGINE_API int swmm_node_get_surcharge_depth(SWMM_Engine engine, int idx, double* depth);
1105
1117SWMM_ENGINE_API int swmm_node_get_ponded_area(SWMM_Engine engine, int idx, double* area);
1118
1130SWMM_ENGINE_API int swmm_node_get_initial_depth(SWMM_Engine engine, int idx, double* depth);
1131
1143SWMM_ENGINE_API int swmm_node_get_crown_elev(SWMM_Engine engine, int idx, double* elev);
1144
1156SWMM_ENGINE_API int swmm_node_get_full_volume(SWMM_Engine engine, int idx, double* vol);
1157
1169SWMM_ENGINE_API int swmm_node_get_losses(SWMM_Engine engine, int idx, double* losses);
1170
1182SWMM_ENGINE_API int swmm_node_get_outflow(SWMM_Engine engine, int idx, double* outflow);
1183
1195SWMM_ENGINE_API int swmm_node_get_degree(SWMM_Engine engine, int idx, int* degree);
1196
1197/* =========================================================================
1198 * Node Statistics
1199 * ========================================================================= */
1200
1212SWMM_ENGINE_API int swmm_node_get_stat_max_depth(SWMM_Engine engine, int idx, double* val);
1213
1225SWMM_ENGINE_API int swmm_node_get_stat_max_overflow(SWMM_Engine engine, int idx, double* val);
1226
1238SWMM_ENGINE_API int swmm_node_get_stat_vol_flooded(SWMM_Engine engine, int idx, double* val);
1239
1251SWMM_ENGINE_API int swmm_node_get_stat_time_flooded(SWMM_Engine engine, int idx, double* val);
1252
1253/* =========================================================================
1254 * Bulk access
1255 * ========================================================================= */
1256
1269SWMM_ENGINE_API int swmm_node_get_depths_bulk(SWMM_Engine engine, double* buf, int count);
1270
1283SWMM_ENGINE_API int swmm_node_get_heads_bulk(SWMM_Engine engine, double* buf, int count);
1284
1297SWMM_ENGINE_API int swmm_node_get_inflows_bulk(SWMM_Engine engine, double* buf, int count);
1298
1311SWMM_ENGINE_API int swmm_node_get_overflows_bulk(SWMM_Engine engine, double* buf, int count);
1312
1325SWMM_ENGINE_API int swmm_node_set_depths_bulk(SWMM_Engine engine, const double* buf, int count);
1326
1341SWMM_ENGINE_API int swmm_node_set_lat_inflows_bulk(SWMM_Engine engine, const double* buf,
1342 int count);
1343
1357SWMM_ENGINE_API int swmm_node_get_quality_bulk(SWMM_Engine engine, int pollutant_idx, double* buf,
1358 int count);
1359
1381SWMM_ENGINE_API int swmm_node_get_volumes_bulk(SWMM_Engine engine, double* buf, int count);
1382
1399SWMM_ENGINE_API int swmm_node_get_outflows_bulk(SWMM_Engine engine, double* buf, int count);
1400
1417SWMM_ENGINE_API int swmm_node_get_losses_bulk(SWMM_Engine engine, double* buf, int count);
1418
1436SWMM_ENGINE_API int swmm_node_get_lateral_inflows_bulk(SWMM_Engine engine, double* buf, int count);
1437
1482SWMM_ENGINE_API int swmm_node_get_ids_bulk(SWMM_Engine engine, char* buf, int stride, int count);
1483
1484/* =========================================================================
1485 * Outfall-to-subcatchment routing
1486 * ========================================================================= */
1487
1500SWMM_ENGINE_API int swmm_node_set_outfall_route_to(SWMM_Engine engine, int idx, int subcatch_idx);
1501
1511SWMM_ENGINE_API int swmm_node_get_outfall_route_to(SWMM_Engine engine, int idx, int* subcatch_idx);
1512
1513/* =========================================================================
1514 * Depth from volume (inverse of getVolume)
1515 * ========================================================================= */
1516
1531SWMM_ENGINE_API int swmm_node_get_depth_from_volume(SWMM_Engine engine, int idx, double volume,
1532 double* depth);
1533
1547SWMM_ENGINE_API int swmm_node_rename(SWMM_Engine engine, int idx, const char* newId);
1548
1549/* =========================================================================
1550 * Tag — free-form string label from the INP `[TAGS]` section
1551 * ========================================================================= */
1552
1564SWMM_ENGINE_API int swmm_node_get_tag(SWMM_Engine engine, int idx, char* buf, int buflen);
1565
1576SWMM_ENGINE_API int swmm_node_set_tag(SWMM_Engine engine, int idx, const char* tag);
1577
1578#ifdef __cplusplus
1579} /* extern "C" */
1580#endif
1581
1582#endif /* OPENSWMM_NODES_H */
#define SWMM_ENGINE_API
Definition openswmm_2d.h:62
void * SWMM_Engine
Opaque handle to an OpenSWMM Engine instance.
Definition openswmm_callbacks.h:55
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)
Evaluate node depth from a supplied display-unit water volume.
Definition openswmm_nodes_impl.cpp:1318
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:1260
SWMM_ENGINE_API int swmm_node_set_lat_inflows_bulk(SWMM_Engine engine, const double *buf, int count)
Overwrite a prefix of the current assembled lateral-inflow field.
Definition openswmm_nodes_impl.cpp:605
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:527
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:295
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:544
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:286
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:724
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:942
SWMM_ENGINE_API int swmm_node_get_inflow(SWMM_Engine engine, int idx, double *inflow)
Read the current assembled lateral-inflow field.
Definition openswmm_nodes_impl.cpp:457
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:406
SWMM_ENGINE_API int swmm_node_set_outfall_route_to(SWMM_Engine engine, int idx, int subcatch_idx)
Set an outfall route-to subcatchment index directly.
Definition openswmm_nodes_impl.cpp:1293
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:669
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:1012
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:1237
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:201
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:645
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:245
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:987
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:1197
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:958
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:742
SWMM_ENGINE_API int swmm_node_rename(SWMM_Engine engine, int idx, const char *newId)
Rename a node in the editable name index.
Definition openswmm_nodes_impl.cpp:1337
SWMM_ENGINE_API int swmm_node_set_storage_area(SWMM_Engine engine, int idx, double area)
Definition openswmm_nodes_impl.cpp:221
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:832
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:1207
SWMM_ENGINE_API int swmm_node_get_tag(SWMM_Engine engine, int idx, char *buf, int buflen)
Copy a node free-form tag.
Definition openswmm_nodes_impl.cpp:1347
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:846
SWMM_ENGINE_API int swmm_node_inlet_eligible(SWMM_Engine engine, int idx, int for_drop_inlet, int *rule_code)
Evaluate inlet-junction topology rules without changing the node.
Definition openswmm_nodes_impl.cpp:339
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:753
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:306
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:1227
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:426
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:151
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:1250
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:270
SWMM_ENGINE_API int swmm_node_get_export_receipt(SWMM_Engine engine, int idx, SWMM_OutfallExportReceipt *receipt, double *pollutant_amounts, int count)
Read committed external 1D outfall exports without withdrawing water again.
Definition openswmm_nodes_impl.cpp:76
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:704
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:774
SWMM_ENGINE_API int swmm_node_get_storage_area(SWMM_Engine engine, int idx, double *area)
Definition openswmm_nodes_impl.cpp:235
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:372
SWMM_DividerType
Flow divider method.
Definition openswmm_nodes.h:1055
@ SWMM_DIVIDER_CUTOFF
Definition openswmm_nodes.h:1056
@ SWMM_DIVIDER_TABULAR
Definition openswmm_nodes.h:1058
@ SWMM_DIVIDER_WEIR
Definition openswmm_nodes.h:1059
@ SWMM_DIVIDER_OVERFLOW
Definition openswmm_nodes.h:1057
SWMM_ENGINE_API int swmm_node_get_storage_seep_rate(SWMM_Engine engine, int idx, double *rate)
Get the constant seepage (exfiltration) rate of a storage node.
Definition openswmm_nodes_impl.cpp:924
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:67
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:592
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:632
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:1146
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:396
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:799
SWMM_ENGINE_API int swmm_node_is_inlet(SWMM_Engine engine, int idx, int *is_inlet)
Read whether a node carries the inlet-junction marker.
Definition openswmm_nodes_impl.cpp:328
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:1187
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:1041
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:61
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:211
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:1163
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:1270
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:1217
SWMM_ENGINE_API int swmm_node_set_lateral_inflow(SWMM_Engine engine, int idx, double flow)
Set a persistent runtime user lateral-inflow contribution.
Definition openswmm_nodes_impl.cpp:472
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:447
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:437
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:1173
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:556
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 additive runtime pollutant amount-rate contribution.
Definition openswmm_nodes_impl.cpp:486
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:999
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:362
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:580
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:681
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:257
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:1055
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:875
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:382
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:1027
SWMM_ENGINE_API int swmm_node_get_outfall_route_to(SWMM_Engine engine, int idx, int *subcatch_idx)
Read the outfall route-to subcatchment index.
Definition openswmm_nodes_impl.cpp:1303
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:1090
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:416
SWMM_StorageShape
Storage-unit surface-area relation codes.
Definition openswmm_nodes.h:723
@ SWMM_STORAGE_CONICAL
Definition openswmm_nodes.h:727
@ SWMM_STORAGE_PARABOLOID
Definition openswmm_nodes.h:728
@ SWMM_STORAGE_FUNCTIONAL
Definition openswmm_nodes.h:725
@ SWMM_STORAGE_PYRAMIDAL
Definition openswmm_nodes.h:730
@ SWMM_STORAGE_TABULAR
Definition openswmm_nodes.h:724
@ SWMM_STORAGE_CYLINDRICAL
Definition openswmm_nodes.h:726
SWMM_ENGINE_API int swmm_node_set_head_boundary(SWMM_Engine engine, int idx, double head)
Set an outfall fixed-head boundary retained in its subtype row.
Definition openswmm_nodes_impl.cpp:505
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:1116
SWMM_ENGINE_API int swmm_node_set_tag(SWMM_Engine engine, int idx, const char *tag)
Copy or clear a node free-form tag without changing topology.
Definition openswmm_nodes_impl.cpp:1362
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:1105
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:1075
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:1132
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:319
SWMM_ENGINE_API int swmm_node_set_inlet(SWMM_Engine engine, int idx, int make_inlet)
Enable or disable inlet-junction authoring on an editable node.
Definition openswmm_nodes_impl.cpp:349
SWMM_ENGINE_API int swmm_node_count(SWMM_Engine engine)
Get the total number of nodes in the model.
Definition openswmm_nodes_impl.cpp:55
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:117
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:191
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:1280
SWMM_ENGINE_API int swmm_node_set_storage_seep_rate(SWMM_Engine engine, int idx, double rate)
Set a constant seepage (exfiltration) rate for a storage node.
Definition openswmm_nodes_impl.cpp:905
SWMM_ENGINE_API int swmm_node_get_inflows_bulk(SWMM_Engine engine, double *buf, int count)
Copy a prefix of the assembled lateral-inflow field.
Definition openswmm_nodes_impl.cpp:568
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:657
Definition openswmm_nodes.h:95
double reversed_m3
Definition openswmm_nodes.h:97
double exported_m3
Definition openswmm_nodes.h:96
double exported_heat_j
Definition openswmm_nodes.h:98
unsigned flags
Definition openswmm_nodes.h:99