OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
openswmm_2d.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
41
46
47#ifndef OPENSWMM_2D_H
48#define OPENSWMM_2D_H
49
50#include "openswmm_callbacks.h"
51
52#ifdef OPENSWMM_ENGINE_STATIC
53#define SWMM_ENGINE_API
54#else
55#ifdef _WIN32
56#ifdef openswmm_engine_EXPORTS
57#define SWMM_ENGINE_API __declspec(dllexport)
58#else
59#define SWMM_ENGINE_API __declspec(dllimport)
60#endif
61#else
62#define SWMM_ENGINE_API __attribute__((visibility("default")))
63#endif
64#endif
65
66#ifdef __cplusplus
67extern "C" {
68#endif
69
70/* =========================================================================
71 * 2D Module Status
72 * ========================================================================= */
73
91SWMM_ENGINE_API int swmm_2d_is_active(SWMM_Engine engine, int* active);
92
108
129
130/* =========================================================================
131 * Mesh Geometry — Query (read-only after initialization)
132 * ========================================================================= */
133
149
162SWMM_ENGINE_API int swmm_2d_vertex_count(SWMM_Engine engine, int* count);
163
177
200SWMM_ENGINE_API int swmm_2d_vertex_get_xyz(SWMM_Engine engine, int idx, double* x, double* y,
201 double* z);
202
222SWMM_ENGINE_API int swmm_2d_vertex_get_xyz_bulk(SWMM_Engine engine, double* x, double* y,
223 double* z);
224
256SWMM_ENGINE_API int swmm_2d_set_vertex_z(SWMM_Engine engine, int idx, double z);
257
292SWMM_ENGINE_API int swmm_2d_set_vertex_z_bulk(SWMM_Engine engine, const double* z, int count);
293
314SWMM_ENGINE_API int swmm_2d_triangle_get_vertices(SWMM_Engine engine, int idx, int* v0, int* v1,
315 int* v2);
316
317/* -------------------------------------------------------------------------
318 * Mixed triangle / quadrilateral meshes (2D_TRI_QUAD_MESH_PLAN_2026-09-06).
319 *
320 * A "triangle index" everywhere in this header is a CELL index: cells are
321 * numbered triangles first (the [2D_TRIANGLES] rows), then quads (the
322 * [2D_QUADS] rows). Every swmm_2d_triangle_* accessor that reads a per-cell
323 * scalar (area, centroid, Manning, init depth/velocity, tag, coupling) works
324 * on a quad too; only the two 3-slot connectivity getters refuse quads.
325 * Local edge k of a cell has endpoints v[(k+1)%nv], v[(k+2)%nv].
326 * ------------------------------------------------------------------------- */
327
341SWMM_ENGINE_API int swmm_2d_cell_count(SWMM_Engine engine, int* count);
342
355SWMM_ENGINE_API int swmm_2d_quad_count(SWMM_Engine engine, int* count);
356
374SWMM_ENGINE_API int swmm_2d_edge_stride(SWMM_Engine engine, int* stride);
375
389SWMM_ENGINE_API int swmm_2d_cell_vertex_count(SWMM_Engine engine, int idx, int* nv);
390
409SWMM_ENGINE_API int swmm_2d_cell_get_vertices(SWMM_Engine engine, int idx, int* v, int* nv);
410
429SWMM_ENGINE_API int swmm_2d_cell_get_neighbours(SWMM_Engine engine, int idx, int* n, int* nv);
430
450SWMM_ENGINE_API int swmm_2d_triangle_get_area(SWMM_Engine engine, int idx, double* area);
451
468SWMM_ENGINE_API int swmm_2d_triangle_get_centroid(SWMM_Engine engine, int idx, double* cx,
469 double* cy, double* cz);
470
485SWMM_ENGINE_API int swmm_2d_triangle_get_mannings(SWMM_Engine engine, int idx, double* n);
486
503SWMM_ENGINE_API int swmm_2d_set_triangle_mannings(SWMM_Engine engine, int idx, double n);
504
521SWMM_ENGINE_API int swmm_2d_triangle_get_init_depth(SWMM_Engine engine, int idx, double* d);
522
540SWMM_ENGINE_API int swmm_2d_set_triangle_init_depth(SWMM_Engine engine, int idx, double d);
541
557 double* v);
558
578 double v);
579
594SWMM_ENGINE_API int swmm_2d_set_vertex_tag(SWMM_Engine engine, int idx, const char* tag);
595
610SWMM_ENGINE_API int swmm_2d_set_triangle_tag(SWMM_Engine engine, int idx, const char* tag);
611
628SWMM_ENGINE_API int swmm_2d_get_vertex_tag(SWMM_Engine engine, int idx, char* buf, int buflen);
629
646SWMM_ENGINE_API int swmm_2d_get_triangle_tag(SWMM_Engine engine, int idx, char* buf, int buflen);
647
669SWMM_ENGINE_API int swmm_2d_triangle_get_neighbours(SWMM_Engine engine, int idx, int* n0, int* n1,
670 int* n2);
671
698SWMM_ENGINE_API int swmm_2d_edge_get_geometry_bulk(SWMM_Engine engine, double* length, double* nx,
699 double* ny);
700
701/* =========================================================================
702 * Coupling Map — Query
703 * ========================================================================= */
704
718
732
751 int* node_idx);
752
772 int* node_idx);
773
805 const char* node_name);
806
842 const char* node_name, double cd, double area);
843
860
876
903SWMM_ENGINE_API int swmm_2d_get_triangle_coupling_row(SWMM_Engine engine, int row_idx, int* tri_idx,
904 int* node_idx, double* cd, double* area);
905
924SWMM_ENGINE_API int swmm_2d_get_vertex_coupling_cd(SWMM_Engine engine, int vertex_idx, double* cd);
925
945SWMM_ENGINE_API int swmm_2d_set_vertex_coupling_cd(SWMM_Engine engine, int vertex_idx, double cd);
946
973 double* area);
974
997 double area);
998
999/* =========================================================================
1000 * 2D State — Per-Triangle (read during RUNNING)
1001 * ========================================================================= */
1002
1021SWMM_ENGINE_API int swmm_2d_get_depth(SWMM_Engine engine, int idx, double* depth);
1022
1037SWMM_ENGINE_API int swmm_2d_get_head(SWMM_Engine engine, int idx, double* head);
1038
1053SWMM_ENGINE_API int swmm_2d_get_coupling_flux(SWMM_Engine engine, int idx, double* flux);
1054
1069SWMM_ENGINE_API int swmm_2d_get_rainfall(SWMM_Engine engine, int idx, double* rainfall);
1070
1103SWMM_ENGINE_API int swmm_2d_get_rainfall_weights(SWMM_Engine engine, int idx, int* method,
1104 int* gage_indices, double* weights, int capacity,
1105 int* count);
1106
1121SWMM_ENGINE_API int swmm_2d_get_net_source(SWMM_Engine engine, int idx, double* net_source);
1122
1139SWMM_ENGINE_API int swmm_2d_get_depths_bulk(SWMM_Engine engine, double* depths);
1140
1155SWMM_ENGINE_API int swmm_2d_get_heads_bulk(SWMM_Engine engine, double* heads);
1156
1174SWMM_ENGINE_API int swmm_2d_get_velocities_bulk(SWMM_Engine engine, double* vx, double* vy);
1175
1191
1208SWMM_ENGINE_API int swmm_2d_get_rainfall_bulk(SWMM_Engine engine, double* rainfall);
1209
1233SWMM_ENGINE_API int swmm_2d_get_report_rainfall_bulk(SWMM_Engine engine, double report_date,
1234 double* rainfall);
1235
1253SWMM_ENGINE_API int swmm_2d_get_rain_volume_bulk(SWMM_Engine engine, double* volumes);
1254
1286
1315
1316/* ---- Overland transport results (read-only during RUNNING) -------------- */
1317
1333SWMM_ENGINE_API int swmm_2d_species_count(SWMM_Engine engine, int* count);
1334
1350SWMM_ENGINE_API int swmm_2d_species_name(SWMM_Engine engine, int species, char* buf, int buflen);
1351
1372SWMM_ENGINE_API int swmm_2d_get_cell_conc(SWMM_Engine engine, int species, double* out, int len,
1373 int* written);
1374
1375/* =========================================================================
1376 * 2D Edge Conveyance (§11A of docs/2dModelStrategy.md)
1377 *
1378 * Per-edge multiplicative factor in [0, 1] that attenuates the
1379 * diffusion-wave flux across the edge (default 1.0 = unrestricted, 0.0 =
1380 * wall). Public storage is `[cell * edge_stride + edge_local]`. Interior edges
1381 * are symmetric: setting the value on one slot mirrors to the partner
1382 * slot on the neighbour triangle so mass conservation is preserved.
1383 *
1384 * Safe to call between routing steps. Calling during a routing step is
1385 * undefined — the 2D sub-stepper holds a const reference to the mesh.
1386 * ========================================================================= */
1387
1411SWMM_ENGINE_API int swmm_2d_get_edge_conveyance(SWMM_Engine engine, int tri, int edge,
1412 double* conveyance);
1413
1442SWMM_ENGINE_API int swmm_2d_set_edge_conveyance(SWMM_Engine engine, int tri, int edge,
1443 double conveyance);
1444
1462SWMM_ENGINE_API int swmm_2d_get_edge_conveyance_bulk(SWMM_Engine engine, double* conveyance);
1463
1477
1478/* =========================================================================
1479 * 2D State — Per-Vertex (reconstructed heads)
1480 * ========================================================================= */
1481
1496SWMM_ENGINE_API int swmm_2d_vertex_get_head(SWMM_Engine engine, int idx, double* head);
1497
1513
1536
1537/* =========================================================================
1538 * 2D Solver Statistics
1539 * ========================================================================= */
1540
1554SWMM_ENGINE_API int swmm_2d_get_max_depth(SWMM_Engine engine, double* max_depth);
1555
1569SWMM_ENGINE_API int swmm_2d_get_total_volume(SWMM_Engine engine, double* volume);
1570
1586
1603
1619SWMM_ENGINE_API int swmm_2d_get_solver_last_step(SWMM_Engine engine, double* h_last);
1620
1639
1657
1674SWMM_ENGINE_API int swmm_2d_get_stat_max_depths(SWMM_Engine engine, double* max_depths);
1675
1692SWMM_ENGINE_API int swmm_2d_get_stat_max_velocities(SWMM_Engine engine, double* max_velocities);
1693
1711
1726
1751SWMM_ENGINE_API int swmm_2d_get_mass_balance(SWMM_Engine engine, double* init_storage,
1752 double* final_storage, double* rainfall_in,
1753 double* coupling_1d_to_2d_in,
1754 double* coupling_2d_to_1d_out, double* outfall_in,
1755 double* outfall_out, double* boundary_in,
1756 double* boundary_out, double* evap_out);
1757
1758/* =========================================================================
1759 * 2D Forcing — Override rainfall or coupling for external control
1760 * ========================================================================= */
1761
1789SWMM_ENGINE_API int swmm_2d_force_rainfall(SWMM_Engine engine, int idx, double value, int mode,
1790 int persist);
1791
1810SWMM_ENGINE_API int swmm_2d_force_rainfall_uniform(SWMM_Engine engine, double value, int mode,
1811 int persist);
1812
1845SWMM_ENGINE_API int swmm_2d_force_evap(SWMM_Engine engine, int idx, double value, int mode,
1846 int persist);
1847
1866SWMM_ENGINE_API int swmm_2d_force_evap_uniform(SWMM_Engine engine, double value, int mode,
1867 int persist);
1868
1890SWMM_ENGINE_API int swmm_2d_force_coupling_flux(SWMM_Engine engine, int idx, double value, int mode,
1891 int persist);
1892
1906
1907/* =========================================================================
1908 * 2D Solver Options — Query/Modify (valid after INITIALIZED)
1909 * ========================================================================= */
1910
1924SWMM_ENGINE_API int swmm_2d_get_dry_depth(SWMM_Engine engine, double* dry_depth);
1925
1940SWMM_ENGINE_API int swmm_2d_set_dry_depth(SWMM_Engine engine, double dry_depth);
1941
1942/* =========================================================================
1943 * 2D Boundary Conditions
1944 * ========================================================================= */
1945
1956#define SWMM_2D_BC_WALL 0
1957#define SWMM_2D_BC_NORMAL_FLOW 1
1958#define SWMM_2D_BC_SPECIFIED_STAGE 2
1959#define SWMM_2D_BC_SPECIFIED_FLOW 3
1960#define SWMM_2D_BC_RATING_CURVE 4
1961
1976
1999SWMM_ENGINE_API int swmm_2d_get_edge_bc_type(SWMM_Engine engine, int tri_idx, int edge,
2000 int* bc_type);
2001
2028 const double* values, int species_count);
2047SWMM_ENGINE_API int swmm_2d_clear_edge_bc(SWMM_Engine engine, int cell, int edge);
2048
2049/* -------------------------------------------------------------------------
2050 * Authored [2D_INITIAL_QUALITY] and [2D_BOUNDARY_QUALITY] rows
2051 * (closed C-API gaps 2026-10-11)
2052 *
2053 * The rows the deck spells, resolved against the mesh, tags and species at
2054 * swmm_engine_initialize() and written back on save. Editable while BUILDING
2055 * or OPENED (SWMM_ERR_LIFECYCLE afterwards); concentrations are in species
2056 * units, finite and >= 0, as the parser requires. Cell indices are 0-based
2057 * here (the deck's CELL rows are 1-based). A set with the same key as an
2058 * existing row replaces it.
2059 * ------------------------------------------------------------------------- */
2060
2061#define SWMM_2D_QUAL_SCOPE_GLOBAL 0
2062#define SWMM_2D_QUAL_SCOPE_TAG 1
2063#define SWMM_2D_QUAL_SCOPE_CELL 2
2064
2076
2095SWMM_ENGINE_API int swmm_2d_get_initial_quality(SWMM_Engine engine, int index, int* scope,
2096 char* tag, int tag_len, int* cell, char* species,
2097 int species_len, double* conc);
2098
2115SWMM_ENGINE_API int swmm_2d_set_initial_quality(SWMM_Engine engine, int scope, const char* tag,
2116 int cell, const char* species, double conc);
2117
2130
2131/* Authored [2D_INITIAL_BED_QUALITY] rows seed finite LOCAL_STORAGE bed
2132 * porewater. Scope constants and lifecycle match [2D_INITIAL_QUALITY]. */
2162SWMM_ENGINE_API int swmm_2d_get_initial_bed_quality(SWMM_Engine engine, int index, int* scope,
2163 char* tag, int tag_len, int* cell,
2164 char* species, int species_len, double* conc);
2181SWMM_ENGINE_API int swmm_2d_set_initial_bed_quality(SWMM_Engine engine, int scope, const char* tag,
2182 int cell, const char* species, double conc);
2195
2207
2225SWMM_ENGINE_API int swmm_2d_get_boundary_quality(SWMM_Engine engine, int index, int* cell,
2226 int* edge, char* species, int species_len,
2227 double* conc);
2228
2244SWMM_ENGINE_API int swmm_2d_set_boundary_quality(SWMM_Engine engine, int cell, int edge,
2245 const char* species, double conc);
2246
2259
2280SWMM_ENGINE_API int swmm_2d_set_edge_bc_type(SWMM_Engine engine, int tri_idx, int edge,
2281 int bc_type);
2282
2304SWMM_ENGINE_API int swmm_2d_get_edge_bc_head(SWMM_Engine engine, int tri_idx, int edge,
2305 double* head);
2306
2329SWMM_ENGINE_API int swmm_2d_set_edge_bc_head(SWMM_Engine engine, int tri_idx, int edge,
2330 double head);
2331
2336SWMM_ENGINE_API int swmm_2d_set_edge_bc_group(SWMM_Engine engine, int tri_idx, int edge, const char* group);
2337
2343SWMM_ENGINE_API int swmm_2d_get_edge_wall_drag(SWMM_Engine engine, int tri_idx, int edge, double* cw);
2344SWMM_ENGINE_API int swmm_2d_set_edge_wall_drag(SWMM_Engine engine, int tri_idx, int edge, double cw);
2345
2362SWMM_ENGINE_API int swmm_2d_get_edge_bc_slope(SWMM_Engine engine, int tri_idx, int edge,
2363 double* slope);
2364
2385SWMM_ENGINE_API int swmm_2d_set_edge_bc_slope(SWMM_Engine engine, int tri_idx, int edge,
2386 double slope);
2387
2414SWMM_ENGINE_API int swmm_2d_set_edge_bc_tseries_name(SWMM_Engine engine, int tri_idx, int edge,
2415 const char* name);
2416
2438SWMM_ENGINE_API int swmm_2d_get_edge_bc_tseries_name(SWMM_Engine engine, int tri_idx, int edge,
2439 char* buf, int buflen);
2440
2463SWMM_ENGINE_API int swmm_2d_get_edge_bc_flow(SWMM_Engine engine, int tri_idx, int edge,
2464 double* flow);
2465
2488SWMM_ENGINE_API int swmm_2d_set_edge_bc_flow(SWMM_Engine engine, int tri_idx, int edge,
2489 double flow);
2490
2512SWMM_ENGINE_API int swmm_2d_set_edge_bc_flow_tseries_name(SWMM_Engine engine, int tri_idx, int edge,
2513 const char* name);
2514
2532SWMM_ENGINE_API int swmm_2d_get_edge_bc_flow_tseries_name(SWMM_Engine engine, int tri_idx, int edge,
2533 char* buf, int buflen);
2534
2559SWMM_ENGINE_API int swmm_2d_set_edge_bc_rating_curve_name(SWMM_Engine engine, int tri_idx, int edge,
2560 const char* name);
2561
2579SWMM_ENGINE_API int swmm_2d_get_edge_bc_rating_curve_name(SWMM_Engine engine, int tri_idx, int edge,
2580 char* buf, int buflen);
2581
2599SWMM_ENGINE_API int swmm_2d_get_edge_bc_cum_flux(SWMM_Engine engine, int tri_idx, int edge,
2600 double* cum_flux);
2601
2602/* =========================================================================
2603 * Results-file variable selection ([2D_OPTIONS] REPORT_2D_VARIABLES)
2604 * =========================================================================
2605 * Engine-independent helpers so a host can build a checklist without
2606 * re-implementing the token vocabulary. Tokens are listed in bit order; the
2607 * presets DEFAULT / MINIMAL / ALL map to masks. Use swmm_options_get_ext /
2608 * swmm_options_set_ext with key "REPORT_2D_VARIABLES" to read/write a model.
2609 */
2610
2633SWMM_ENGINE_API unsigned swmm_2d_output_variable_mask(const char* text);
2641SWMM_ENGINE_API const char* swmm_2d_output_variable_text(unsigned mask);
2642
2643/* =========================================================================
2644 * Per-node 1D↔2D coupling type ([2D_NODE_COUPLING])
2645 * =========================================================================
2646 * A node attribute of the 1D model, held with or without a mesh: whether a
2647 * node may couple to the 2D surface and through what structure. Map rows
2648 * ([2D_VERTEX_NODE_MAP] / [2D_TRIANGLE_NODE_MAP]) naming a NONE node are
2649 * ignored at initialize. A node without an authored row takes its class
2650 * default: junction or divider → MANHOLE, storage → OPEN, outfall → OUTFALL,
2651 * inlet or virtual junction → NONE. OUTFALL is legal only on outfalls (an
2652 * outfall is OUTFALL or NONE); OPEN only on storage nodes. Setters work in
2653 * the BUILDING and OPENED states.
2654 */
2655
2665
2684SWMM_ENGINE_API int swmm_node_get_2d_coupling_type(SWMM_Engine engine, int node_idx, int* type,
2685 int* authored);
2686
2701 int* type);
2702
2718SWMM_ENGINE_API int swmm_node_set_2d_coupling_type(SWMM_Engine engine, int node_idx, int type);
2719
2733
2757 const char* key, char* value, int value_len);
2758
2777 const char* key, const char* value);
2778
2779#ifdef __cplusplus
2780} /* extern "C" */
2781#endif
2782
2783#endif /* OPENSWMM_2D_H */
SWMM_ENGINE_API int swmm_2d_get_total_exchange_flow(SWMM_Engine engine, double *flow)
Get total exchange flow rate (sum of all coupling flows, m³/s). Positive = net flow from 2D into 1D n...
Definition Api2D.cpp:1119
SWMM_ENGINE_API int swmm_2d_get_edge_bc_head(SWMM_Engine engine, int tri_idx, int edge, double *head)
Get specified stage boundary head for an edge.
Definition Api2D.cpp:1598
SWMM_ENGINE_API int swmm_2d_get_triangle_coupling_row(SWMM_Engine engine, int row_idx, int *tri_idx, int *node_idx, double *cd, double *area)
Read one authored node→cell coupling row by row index.
Definition Api2D.cpp:624
SWMM_ENGINE_API int swmm_2d_vertex_get_coupled_node(SWMM_Engine engine, int vertex_idx, int *node_idx)
Get vertex coupling: which SWMM node is coupled to this vertex.
Definition Api2D.cpp:513
SWMM_ENGINE_API int swmm_2d_set_vertex_coupling_cd(SWMM_Engine engine, int vertex_idx, double cd)
Set the coupling discharge coefficient of a vertex ([2D_VERTEX_NODE_MAP] CD column)....
Definition Api2D.cpp:654
SWMM_ENGINE_API int swmm_2d_get_solver_last_step(SWMM_Engine engine, double *h_last)
Get the explicit marcher's last sub-step size (s). (Renamed from swmm_2d_get_cvode_last_step with the...
Definition Api2D.cpp:1139
SWMM_ENGINE_API int swmm_2d_triangle_get_area(SWMM_Engine engine, int idx, double *area)
Get triangle area.
Definition Api2D.cpp:312
SWMM_ENGINE_API int swmm_2d_edge_stride(SWMM_Engine engine, int *stride)
Edge-slot stride of the bulk edge arrays (swmm_2d_get_edge_flux_bulk, swmm_2d_edge_get_geometry_bulk,...
Definition Api2D.cpp:267
SWMM_ENGINE_API int swmm_2d_get_run_stats(SWMM_Engine engine, SWMM_2DRunStats *stats)
Read the cumulative marcher statistics and backend of the 2D run. Counters are zero (and n_tiers 0) b...
Definition Api2D.cpp:1149
SWMM_ENGINE_API int swmm_2d_get_continuity_error(SWMM_Engine engine, double *err)
Get the global 2D surface continuity error (fraction).
Definition Api2D.cpp:1210
SWMM_ENGINE_API int swmm_2d_get_edge_bc_flow(SWMM_Engine engine, int tri_idx, int edge, double *flow)
Get prescribed flow per metre of edge for a SPECIFIED_FLOW edge. V-E4.
Definition Api2D.cpp:1790
SWMM_ENGINE_API int swmm_2d_add_triangle_coupling(SWMM_Engine engine, int tri_idx, const char *node_name, double cd, double area)
Append one node→cell coupling row ([2D_TRIANGLE_NODE_MAP] repeated-row form).
Definition Api2D.cpp:563
SWMM_ENGINE_API int swmm_2d_get_rainfall_bulk(SWMM_Engine engine, double *rainfall)
Bulk get the rainfall intensity (m/s) applied to every triangle over the solver's current routing win...
Definition Api2D.cpp:788
SWMM_ENGINE_API int swmm_2d_triangle_get_neighbours(SWMM_Engine engine, int idx, int *n0, int *n1, int *n2)
Get triangle neighbour indices (-1 = boundary edge).
Definition Api2D.cpp:461
SWMM_ENGINE_API int swmm_2d_get_edge_bc_type(SWMM_Engine engine, int tri_idx, int edge, int *bc_type)
Get boundary condition type for an edge.
Definition Api2D.cpp:1478
SWMM_ENGINE_API int swmm_2d_reset_edge_conveyance(SWMM_Engine engine)
Reset every edge's conveyance factor to 1.0 (unrestricted).
Definition Api2D.cpp:962
SWMM_ENGINE_API int swmm_node_set_2d_coupling_type(SWMM_Engine engine, int node_idx, int type)
Author a node's coupling type. Parameters that do not apply to the new type are dropped.
Definition openswmm_node_coupling_2d_impl.cpp:54
SWMM_ENGINE_API int swmm_2d_quad_count(SWMM_Engine engine, int *count)
Number of quadrilateral cells (0 for an all-triangle mesh).
Definition Api2D.cpp:258
SWMM_ENGINE_API int swmm_2d_edge_get_geometry_bulk(SWMM_Engine engine, double *length, double *nx, double *ny)
Bulk get edge geometry — time-invariant edge length and outward unit normal components,...
Definition Api2D.cpp:1035
SWMM_ENGINE_API int swmm_node_get_2d_coupling_type(SWMM_Engine engine, int node_idx, int *type, int *authored)
Effective coupling type of a node.
Definition openswmm_node_coupling_2d_impl.cpp:28
SWMM_ENGINE_API int swmm_2d_get_total_volume(SWMM_Engine engine, double *volume)
Get total 2D surface volume (sum of depth * area).
Definition Api2D.cpp:1109
SWMM_ENGINE_API int swmm_2d_boundary_edge_count(SWMM_Engine engine, int *count)
Get the number of boundary edges (edges with no neighbour).
Definition Api2D.cpp:1447
SWMM_ENGINE_API int swmm_2d_set_edge_bc_type(SWMM_Engine engine, int tri_idx, int edge, int bc_type)
Set boundary condition type for an edge.
Definition Api2D.cpp:1575
SWMM_ENGINE_API int swmm_2d_vertex_get_xyz_bulk(SWMM_Engine engine, double *x, double *y, double *z)
Bulk get vertex coordinates.
Definition Api2D.cpp:190
SWMM_ENGINE_API int swmm_2d_set_vertex_tag(SWMM_Engine engine, int idx, const char *tag)
Set the descriptive tag of a vertex (the [2D_VERTICES] TAG column). Distinct from the 1D<->2D couplin...
Definition Api2D.cpp:394
SWMM_ENGINE_API int swmm_2d_clear_triangle_couplings(SWMM_Engine engine)
Remove every authored node→cell coupling row (all triangles).
Definition Api2D.cpp:600
SWMM_ENGINE_API int swmm_2d_get_rain_volume_bulk(SWMM_Engine engine, double *volumes)
Bulk get the cumulative rainfall VOLUME (m³) booked onto every triangle since the start of the run — ...
Definition Api2D.cpp:811
SWMM_ENGINE_API int swmm_2d_set_vertex_z(SWMM_Engine engine, int idx, double z)
Set vertex Z (ground elevation).
Definition Api2D.cpp:204
SWMM_ENGINE_API int swmm_2d_get_stat_max_continuity_err(SWMM_Engine engine, double *max_errs)
Get per-triangle max |continuity residual| statistics (cumulative, m3/s).
Definition Api2D.cpp:1199
SWMM_ENGINE_API int swmm_2d_get_edge_bc_tseries_name(SWMM_Engine engine, int tri_idx, int edge, char *buf, int buflen)
Get the timeseries NAME driving a SPECIFIED_STAGE edge.
Definition Api2D.cpp:1826
SWMM_ENGINE_API int swmm_2d_vertex_get_heads_bulk(SWMM_Engine engine, double *heads)
Bulk get reconstructed heads at all vertices.
Definition Api2D.cpp:1070
SWMM_ENGINE_API int swmm_node_get_2d_coupling_param(SWMM_Engine engine, int node_idx, const char *key, char *value, int value_len)
Read an authored coupling parameter as its section token, e.g. key "D" → "1.2", key "CREST" → "MESH_B...
Definition openswmm_node_coupling_2d_impl.cpp:85
SWMM_ENGINE_API int swmm_2d_get_triangle_tag(SWMM_Engine engine, int idx, char *buf, int buflen)
Get the descriptive tag of a triangle (the [2D_TRIANGLES] TAG column). Copies up to buflen-1 bytes in...
Definition Api2D.cpp:435
SWMM_ENGINE_API int swmm_2d_get_coupling_flux(SWMM_Engine engine, int idx, double *flux)
Get coupling exchange flux at a triangle (m/s, + = into 2D).
Definition Api2D.cpp:715
SWMM_ENGINE_API int swmm_2d_get_stat_max_depths(SWMM_Engine engine, double *max_depths)
Get per-triangle max depth statistics (cumulative, m).
Definition Api2D.cpp:1176
SWMM_ENGINE_API int swmm_2d_get_cell_conc(SWMM_Engine engine, int species, double *out, int len, int *written)
Per-cell concentration of one surface species: pollutant and MSX rows in their declared units,...
Definition Api2D.cpp:1014
SWMM_ENGINE_API int swmm_2d_set_triangle_tag(SWMM_Engine engine, int idx, const char *tag)
Set the descriptive tag of a triangle (the [2D_TRIANGLES] TAG column, e.g. a region / subcatchment id...
Definition Api2D.cpp:407
SWMM_ENGINE_API int swmm_2d_set_edge_bc_slope(SWMM_Engine engine, int tri_idx, int edge, double slope)
Set normal flow boundary slope for an edge.
Definition Api2D.cpp:1730
SWMM_ENGINE_API int swmm_2d_cell_get_neighbours(SWMM_Engine engine, int idx, int *n, int *nv)
Neighbour cell across each local edge, any shape.
Definition Api2D.cpp:299
SWMM_ENGINE_API int swmm_2d_force_rainfall(SWMM_Engine engine, int idx, double value, int mode, int persist)
Force rainfall on a specific triangle.
Definition Api2D.cpp:1276
SWMM_ENGINE_API int swmm_2d_get_max_depth(SWMM_Engine engine, double *max_depth)
Get the maximum depth across all triangles.
Definition Api2D.cpp:1098
SWMM_ENGINE_API int swmm_2d_get_depth(SWMM_Engine engine, int idx, double *depth)
Get water depth at a triangle.
Definition Api2D.cpp:693
SWMM_ENGINE_API int swmm_2d_get_report_rainfall_bulk(SWMM_Engine engine, double report_date, double *rainfall)
Bulk rainfall at a report instant, in SI m/s.
Definition Api2D.cpp:799
SWMM_ENGINE_API int swmm_2d_get_head(SWMM_Engine engine, int idx, double *head)
Get total head at a triangle (z + depth, m).
Definition Api2D.cpp:704
SWMM_ENGINE_API int swmm_2d_get_solver_steps(SWMM_Engine engine, long *steps)
Get number of explicit-marcher sub-steps taken in the last advance. (Renamed from swmm_2d_get_cvode_s...
Definition Api2D.cpp:1129
SWMM_ENGINE_API int swmm_2d_get_edge_flux_bulk(SWMM_Engine engine, double *flux)
Bulk get normal edge flux at every edge of every triangle.
Definition Api2D.cpp:970
SWMM_ENGINE_API int swmm_2d_get_edge_bc_cum_flux(SWMM_Engine engine, int tri_idx, int edge, double *cum_flux)
Get cumulative boundary flux at an edge (m³, + = outflow).
Definition Api2D.cpp:1747
SWMM_ENGINE_API int swmm_2d_triangle_coupling_count(SWMM_Engine engine, int *count)
Get the number of triangle-to-node coupling points.
Definition Api2D.cpp:497
SWMM_ENGINE_API int swmm_2d_triangle_get_centroid(SWMM_Engine engine, int idx, double *cx, double *cy, double *cz)
Get triangle centroid coordinates.
Definition Api2D.cpp:323
SWMM_ENGINE_API int swmm_2d_get_net_source(SWMM_Engine engine, int idx, double *net_source)
Get net source/sink rate at a triangle (m/s).
Definition Api2D.cpp:766
SWMM_ENGINE_API int swmm_2d_vertex_get_head(SWMM_Engine engine, int idx, double *head)
Get reconstructed head at a vertex.
Definition Api2D.cpp:1058
SWMM_ENGINE_API int swmm_2d_species_name(SWMM_Engine engine, int species, char *buf, int buflen)
One surface species row's name.
Definition Api2D.cpp:1001
SWMM_ENGINE_API int swmm_2d_force_evap(SWMM_Engine engine, int idx, double value, int mode, int persist)
Force evaporation on a specific triangle.
Definition Api2D.cpp:1318
SWMM_ENGINE_API int swmm_2d_get_depths_bulk(SWMM_Engine engine, double *depths)
Bulk get depths for all triangles (m).
Definition Api2D.cpp:777
SWMM_ENGINE_API int swmm_2d_set_triangle_init_velocity(SWMM_Engine engine, int idx, double u, double v)
Set triangle initial velocity (u, v in m/s; finite values; SWMM_ERR_BADPARAM otherwise)....
Definition Api2D.cpp:382
SWMM_ENGINE_API int swmm_2d_set_edge_bc_head(SWMM_Engine engine, int tri_idx, int edge, double head)
Set specified stage boundary head for an edge (same units convention as the getter).
Definition Api2D.cpp:1611
SWMM_ENGINE_API int swmm_2d_triangle_count(SWMM_Engine engine, int *count)
Get the number of mesh triangles.
Definition Api2D.cpp:167
SWMM_ENGINE_API int swmm_2d_get_rainfall(SWMM_Engine engine, int idx, double *rainfall)
Get rainfall intensity at a triangle (m/s).
Definition Api2D.cpp:726
SWMM_ENGINE_API int swmm_2d_get_coupling_fluxes_bulk(SWMM_Engine engine, double *fluxes)
Bulk get coupling fluxes for all triangles.
Definition Api2D.cpp:861
SWMM_ENGINE_API int swmm_2d_species_count(SWMM_Engine engine, int *count)
How many species rows the surface transports (0 when it carries none). Row order: pollutants,...
Definition Api2D.cpp:991
SWMM_ENGINE_API int swmm_2d_prepare_for_edit(SWMM_Engine engine)
Make the parsed 2D mesh editable without a full initialize().
Definition Api2D.cpp:135
SWMM_ENGINE_API int swmm_2d_cell_count(SWMM_Engine engine, int *count)
Number of cells (triangles + quads) — same value as swmm_2d_triangle_count.
Definition Api2D.cpp:249
SWMM_ENGINE_API int swmm_2d_set_triangle_mannings(SWMM_Engine engine, int idx, double n)
Set triangle Manning's roughness coefficient.
Definition Api2D.cpp:337
SWMM_ENGINE_API int swmm_2d_get_stat_max_velocities(SWMM_Engine engine, double *max_velocities)
Get per-triangle max velocity-magnitude statistics (cumulative, m/s).
Definition Api2D.cpp:1187
SWMM_ENGINE_API int swmm_2d_triangle_coupling_rows(SWMM_Engine engine, int *count)
Number of authored node→cell coupling rows.
Definition Api2D.cpp:615
SWMM_ENGINE_API int swmm_2d_set_vertex_coupled_node(SWMM_Engine engine, int vertex_idx, const char *node_name)
Set (or clear) the SWMM node a vertex is coupled to, by name.
Definition Api2D.cpp:539
SWMM_ENGINE_API int swmm_2d_get_dry_depth(SWMM_Engine engine, double *dry_depth)
Get the dry depth threshold (m).
Definition Api2D.cpp:1405
SWMM_ENGINE_API int swmm_2d_get_edge_conveyance_bulk(SWMM_Engine engine, double *conveyance)
Bulk get conveyance factor at every edge of every triangle.
Definition Api2D.cpp:945
SWMM_ENGINE_API int swmm_2d_cell_vertex_count(SWMM_Engine engine, int idx, int *nv)
Vertices (== edges) of a cell: 3 or 4.
Definition Api2D.cpp:276
SWMM_ENGINE_API int swmm_2d_cell_get_vertices(SWMM_Engine engine, int idx, int *v, int *nv)
Cell connectivity for any shape.
Definition Api2D.cpp:286
SWMM_ENGINE_API int swmm_2d_set_edge_bc_tseries_name(SWMM_Engine engine, int tri_idx, int edge, const char *name)
Set the timeseries NAME to drive a SPECIFIED_STAGE edge.
Definition Api2D.cpp:1766
SWMM_ENGINE_API int swmm_2d_set_vertex_z_bulk(SWMM_Engine engine, const double *z, int count)
Set EVERY vertex Z in one call.
Definition Api2D.cpp:215
SWMM_ENGINE_API int swmm_2d_get_coupling_volume_bulk(SWMM_Engine engine, double *volumes)
Bulk get the SIGNED cumulative 1D↔2D coupling exchange VOLUME (m³) per triangle since the start of th...
Definition Api2D.cpp:822
SWMM_ENGINE_API int swmm_node_reset_2d_coupling(SWMM_Engine engine, int node_idx)
Remove a node's [2D_NODE_COUPLING] row (back to the class default).
Definition openswmm_node_coupling_2d_impl.cpp:74
SWMM_ENGINE_API int swmm_2d_force_clear_all(SWMM_Engine engine)
Clear all 2D forcings.
Definition Api2D.cpp:1378
SWMM_ENGINE_API int swmm_2d_vertex_get_render_depths_bulk(SWMM_Engine engine, double *depths)
Bulk get render-oriented SIGNED vertex depths (m) at all vertices.
Definition Api2D.cpp:1082
SWMM_ENGINE_API int swmm_2d_get_mass_balance(SWMM_Engine engine, double *init_storage, double *final_storage, double *rainfall_in, double *coupling_1d_to_2d_in, double *coupling_2d_to_1d_out, double *outfall_in, double *outfall_out, double *boundary_in, double *boundary_out, double *evap_out)
Get the global 2D mass-balance terms (all m3). Any pointer may be NULL.
Definition Api2D.cpp:1224
SWMM_ENGINE_API int swmm_2d_vertex_count(SWMM_Engine engine, int *count)
Get the number of mesh vertices.
Definition Api2D.cpp:158
SWMM_ENGINE_API int swmm_2d_triangle_get_coupled_node(SWMM_Engine engine, int tri_idx, int *node_idx)
Get triangle coupling: which SWMM node is coupled to this triangle.
Definition Api2D.cpp:526
SWMM_ENGINE_API int swmm_2d_force_rainfall_uniform(SWMM_Engine engine, double value, int mode, int persist)
Force rainfall on all triangles (uniform).
Definition Api2D.cpp:1296
SWMM_ENGINE_API int swmm_node_set_2d_coupling_param(SWMM_Engine engine, int node_idx, const char *key, const char *value)
Author a coupling parameter from its section token; NULL or "" clears it. A node without a row gets o...
Definition openswmm_node_coupling_2d_impl.cpp:111
SWMM_ENGINE_API int swmm_2d_vertex_get_xyz(SWMM_Engine engine, int idx, double *x, double *y, double *z)
Get vertex coordinates.
Definition Api2D.cpp:176
SWMM_ENGINE_API int swmm_2d_force_evap_uniform(SWMM_Engine engine, double value, int mode, int persist)
Force evaporation on all triangles (uniform).
Definition Api2D.cpp:1338
SWMM_ENGINE_API int swmm_2d_get_edge_bc_slope(SWMM_Engine engine, int tri_idx, int edge, double *slope)
Get normal flow boundary slope for an edge.
Definition Api2D.cpp:1716
SWMM_ENGINE_API int swmm_2d_triangle_get_vertices(SWMM_Engine engine, int idx, int *v0, int *v1, int *v2)
Get triangle connectivity (3 vertex indices).
Definition Api2D.cpp:231
SWMM_ENGINE_API int swmm_2d_set_triangle_init_depth(SWMM_Engine engine, int idx, double d)
Set triangle initial water depth (mesh length units, >= 0; SWMM_ERR_BADPARAM otherwise — see the gett...
Definition Api2D.cpp:359
SWMM_ENGINE_API int swmm_2d_get_heads_bulk(SWMM_Engine engine, double *heads)
Bulk get heads for all triangles (m).
Definition Api2D.cpp:833
SWMM_ENGINE_API int swmm_2d_set_dry_depth(SWMM_Engine engine, double dry_depth)
Set the dry depth threshold (m).
Definition Api2D.cpp:1415
SWMM_ENGINE_API int swmm_2d_set_edge_conveyance(SWMM_Engine engine, int tri, int edge, double conveyance)
Set the per-edge conveyance factor for one edge.
Definition Api2D.cpp:926
SWMM_ENGINE_API int swmm_2d_get_vertex_coupling_cd(SWMM_Engine engine, int vertex_idx, double *cd)
Get the coupling discharge coefficient of a vertex ([2D_VERTEX_NODE_MAP] CD column; default 0....
Definition Api2D.cpp:643
SWMM_ENGINE_API int swmm_2d_vertex_coupling_count(SWMM_Engine engine, int *count)
Get the number of vertex-to-node coupling points.
Definition Api2D.cpp:481
SWMM_ENGINE_API int swmm_2d_triangle_get_mannings(SWMM_Engine engine, int idx, double *n)
Get triangle Manning's roughness.
Definition Api2D.cpp:450
SWMM_ENGINE_API int swmm_2d_get_edge_conveyance(SWMM_Engine engine, int tri, int edge, double *conveyance)
Get the per-edge conveyance factor for one edge.
Definition Api2D.cpp:914
SWMM_ENGINE_API int swmm_2d_force_coupling_flux(SWMM_Engine engine, int idx, double value, int mode, int persist)
Force coupling flux on a specific triangle (override computed exchange).
Definition Api2D.cpp:1360
SWMM_ENGINE_API int swmm_2d_triangle_get_init_depth(SWMM_Engine engine, int idx, double *d)
Get triangle initial water depth ([2D_TRIANGLES] INIT_DEPTH column, default 0 = dry)....
Definition Api2D.cpp:348
SWMM_ENGINE_API int swmm_2d_triangle_get_init_velocity(SWMM_Engine engine, int idx, double *u, double *v)
Get triangle initial velocity (u, v in m/s; [2D_INITIAL_VELOCITY] rows, default 0,...
Definition Api2D.cpp:370
SWMM_ENGINE_API int swmm_node_get_2d_coupling_default_type(SWMM_Engine engine, int node_idx, int *type)
Class default coupling type of a node (what it has without a row).
Definition openswmm_node_coupling_2d_impl.cpp:42
SWMM_ENGINE_API int swmm_2d_get_vertex_tag(SWMM_Engine engine, int idx, char *buf, int buflen)
Get the descriptive tag of a vertex (the [2D_VERTICES] TAG column). Copies up to buflen-1 bytes into ...
Definition Api2D.cpp:420
SWMM_ENGINE_API int swmm_2d_get_rainfall_weights(SWMM_Engine engine, int idx, int *method, int *gage_indices, double *weights, int capacity, int *count)
Inspect how RAINFALL_MODE maps the gages onto one triangle.
Definition Api2D.cpp:737
SWMM_ENGINE_API int swmm_2d_get_vertex_coupling_area(SWMM_Engine engine, int vertex_idx, double *area)
Get the coupling exchange area of a vertex ([2D_VERTEX_NODE_MAP] AREA column; default 1....
Definition Api2D.cpp:666
SWMM_ENGINE_API int swmm_2d_is_active(SWMM_Engine engine, int *active)
Check whether the 2D module is active for this simulation.
Definition Api2D.cpp:116
SWMM_ENGINE_API int swmm_2d_set_vertex_coupling_area(SWMM_Engine engine, int vertex_idx, double area)
Set the coupling exchange area of a vertex ([2D_VERTEX_NODE_MAP] AREA column). Persisted by the ....
Definition Api2D.cpp:677
double * y
Definition odesolve.c:37
SWMM_ENGINE_API int swmm_2d_get_edge_wall_drag(SWMM_Engine engine, int tri_idx, int edge, double *cw)
Definition Api2D.cpp:1672
SWMM_NodeCoupling2DType
Definition openswmm_2d.h:2657
@ SWMM_2D_COUPLING_OUTFALL
Definition openswmm_2d.h:2663
@ SWMM_2D_COUPLING_OPEN
Definition openswmm_2d.h:2662
@ SWMM_2D_COUPLING_MANHOLE
Definition openswmm_2d.h:2659
@ SWMM_2D_COUPLING_NONE
Definition openswmm_2d.h:2658
@ SWMM_2D_COUPLING_CURB
Definition openswmm_2d.h:2661
@ SWMM_2D_COUPLING_GRATE
Definition openswmm_2d.h:2660
SWMM_ENGINE_API int swmm_2d_set_edge_bc_flow_tseries_name(SWMM_Engine engine, int tri_idx, int edge, const char *name)
Set the timeseries NAME to drive a SPECIFIED_FLOW edge. V-E4 — same resolution contract as swmm_2d_se...
Definition Api2D.cpp:1887
SWMM_ENGINE_API int swmm_2d_get_edge_bc_flow_tseries_name(SWMM_Engine engine, int tri_idx, int edge, char *buf, int buflen)
Get the timeseries NAME driving a SPECIFIED_FLOW edge. SVBC A8 — same contract as swmm_2d_get_edge_bc...
Definition Api2D.cpp:1839
#define SWMM_ENGINE_API
Definition openswmm_2d.h:62
SWMM_ENGINE_API int swmm_2d_geometry_scale_to_si(SWMM_Engine engine, double *scale)
Multiplier converting the current mesh XYZ coordinates and lengths to metres (square it for areas)....
Definition Api2D.cpp:146
SWMM_ENGINE_API int swmm_2d_set_auto_backend_cpu(SWMM_Engine engine, int enabled)
Resolve an unoverridden AUTO backend to the built-in CPU marcher for this session....
Definition Api2D.cpp:124
SWMM_ENGINE_API int swmm_2d_set_edge_bc_group(SWMM_Engine engine, int tri_idx, int edge, const char *group)
Definition Api2D.cpp:1633
SWMM_ENGINE_API int swmm_2d_set_edge_wall_drag(SWMM_Engine engine, int tri_idx, int edge, double cw)
Definition Api2D.cpp:1683
SWMM_ENGINE_API int swmm_2d_get_initial_bed_quality(SWMM_Engine engine, int index, int *scope, char *tag, int tag_len, int *cell, char *species, int species_len, double *conc)
Read one authored finite-bed initial-quality row.
Definition Api2D.cpp:2102
SWMM_ENGINE_API int swmm_2d_set_initial_bed_quality(SWMM_Engine engine, int scope, const char *tag, int cell, const char *species, double conc)
Upsert a finite-bed initial-quality row by scope and species.
Definition Api2D.cpp:2122
SWMM_ENGINE_API int swmm_2d_set_edge_bc_flow(SWMM_Engine engine, int tri_idx, int edge, double flow)
Set prescribed flow per metre of edge (same units convention as the getter: display flow units/m befo...
Definition Api2D.cpp:1865
SWMM_ENGINE_API int swmm_2d_get_boundary_quality(SWMM_Engine engine, int index, int *cell, int *edge, char *species, int species_len, double *conc)
Read one [2D_BOUNDARY_QUALITY] row (inflow concentration through a boundary edge)....
Definition Api2D.cpp:2180
SWMM_ENGINE_API int swmm_2d_remove_initial_quality(SWMM_Engine engine, int index)
Erase one authored initial water-quality row.
Definition Api2D.cpp:2083
SWMM_ENGINE_API int swmm_2d_remove_boundary_quality(SWMM_Engine engine, int index)
Erase one authored boundary-quality row.
Definition Api2D.cpp:2228
SWMM_ENGINE_API int swmm_2d_initial_bed_quality_count(SWMM_Engine engine, int *count)
Read the authored finite-bed initial-quality row count.
Definition Api2D.cpp:2094
SWMM_ENGINE_API int swmm_2d_set_edge_bc_concentrations(SWMM_Engine engine, int cell, int edge, const double *values, int species_count)
Runtime inflow concentrations in the species getter's units/order. Outflow uses donor concentrations....
Definition Api2D.cpp:1533
SWMM_ENGINE_API const char * swmm_2d_output_variable_name(int i)
Token of group i (0-based, bit i), or "" when out of range.
Definition Api2D.cpp:1945
SWMM_ENGINE_API unsigned swmm_2d_output_variable_mask(const char *text)
Bitmask for a preset name ("DEFAULT", "MINIMAL", "ALL") or a token list; returns 0 for an unparseable...
Definition Api2D.cpp:1952
SWMM_ENGINE_API int swmm_2d_get_initial_quality(SWMM_Engine engine, int index, int *scope, char *tag, int tag_len, int *cell, char *species, int species_len, double *conc)
Read one [2D_INITIAL_QUALITY] row. Any out-pointer may be NULL.
Definition Api2D.cpp:2025
SWMM_ENGINE_API int swmm_2d_output_variable_count(void)
Number of selectable dataset groups.
Definition Api2D.cpp:1941
SWMM_ENGINE_API int swmm_2d_get_velocities_bulk(SWMM_Engine engine, double *vx, double *vy)
Bulk cell velocity in physical Cartesian SI m/s, matching Mesh2_face_vx/vy.
Definition Api2D.cpp:844
SWMM_ENGINE_API int swmm_2d_initial_quality_count(SWMM_Engine engine, int *count)
Read the authored initial water-quality row count.
Definition Api2D.cpp:2017
SWMM_ENGINE_API int swmm_2d_boundary_quality_count(SWMM_Engine engine, int *count)
Read the authored boundary-quality row count.
Definition Api2D.cpp:2172
SWMM_ENGINE_API int swmm_2d_clear_edge_bc(SWMM_Engine engine, int cell, int edge)
Restore the authored boundary hydraulics and quality for one edge.
Definition Api2D.cpp:1560
SWMM_ENGINE_API int swmm_2d_set_edge_bc_rating_curve_name(SWMM_Engine engine, int tri_idx, int edge, const char *name)
Set the curve NAME to drive a RATING_CURVE edge.
Definition Api2D.cpp:1912
SWMM_ENGINE_API int swmm_2d_set_boundary_quality(SWMM_Engine engine, int cell, int edge, const char *species, double conc)
Add or replace the row keyed by (cell, edge, species).
Definition Api2D.cpp:2197
SWMM_ENGINE_API int swmm_2d_get_edge_bc_rating_curve_name(SWMM_Engine engine, int tri_idx, int edge, char *buf, int buflen)
Get the curve NAME driving a RATING_CURVE edge. SVBC A8 — same contract as swmm_2d_get_edge_bc_tserie...
Definition Api2D.cpp:1852
SWMM_ENGINE_API const char * swmm_2d_output_variable_text(unsigned mask)
Preset name or token list for mask (static buffer, valid until the next call).
Definition Api2D.cpp:1961
SWMM_ENGINE_API int swmm_2d_remove_initial_bed_quality(SWMM_Engine engine, int index)
Erase one authored finite-bed initial-quality row.
Definition Api2D.cpp:2161
SWMM_ENGINE_API int swmm_2d_set_initial_quality(SWMM_Engine engine, int scope, const char *tag, int cell, const char *species, double conc)
Add or replace a row keyed by (scope, tag | cell, species).
Definition Api2D.cpp:2044
Callback function typedefs for the OpenSWMM Engine C API.
void * SWMM_Engine
Opaque handle to an OpenSWMM Engine instance.
Definition openswmm_callbacks.h:55
Cumulative explicit-marcher run statistics plus the backend and closure this run is on — the numbers ...
Definition openswmm_2d.h:1625
double last_step
Definition openswmm_2d.h:1632
long tier_cells[8]
Definition openswmm_2d.h:1637
int momentum
Definition openswmm_2d.h:1628
long steps
Definition openswmm_2d.h:1630
int n_tiers
Definition openswmm_2d.h:1636
double active_frac_min
Definition openswmm_2d.h:1633
double active_frac_max
Definition openswmm_2d.h:1635
long face_evals
Definition openswmm_2d.h:1631
double active_frac_mean
Definition openswmm_2d.h:1634
int lts_tiers
Definition openswmm_2d.h:1629
char backend[64]
Definition openswmm_2d.h:1626