52#ifdef OPENSWMM_ENGINE_STATIC
53#define SWMM_ENGINE_API
56#ifdef openswmm_engine_EXPORTS
57#define SWMM_ENGINE_API __declspec(dllexport)
59#define SWMM_ENGINE_API __declspec(dllimport)
62#define SWMM_ENGINE_API __attribute__((visibility("default")))
469 double* cy,
double* cz);
805 const char* node_name);
842 const char* node_name,
double cd,
double area);
904 int* node_idx,
double* cd,
double* area);
1104 int* gage_indices,
double* weights,
int capacity,
1412 double* conveyance);
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);
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
2028 const double* values,
int species_count);
2061#define SWMM_2D_QUAL_SCOPE_GLOBAL 0
2062#define SWMM_2D_QUAL_SCOPE_TAG 1
2063#define SWMM_2D_QUAL_SCOPE_CELL 2
2096 char* tag,
int tag_len,
int* cell,
char* species,
2097 int species_len,
double* conc);
2116 int cell,
const char* species,
double conc);
2163 char* tag,
int tag_len,
int* cell,
2164 char* species,
int species_len,
double* conc);
2182 int cell,
const char* species,
double conc);
2226 int* edge,
char* species,
int species_len,
2245 const char* species,
double conc);
2439 char* buf,
int buflen);
2533 char* buf,
int buflen);
2580 char* buf,
int buflen);
2757 const char* key,
char* value,
int value_len);
2777 const char* key,
const char* value);
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