OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
openswmm_transport.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 */
17
41
42#ifndef OPENSWMM_TRANSPORT_H
43#define OPENSWMM_TRANSPORT_H
44
45#include "openswmm_engine.h"
46
47#ifdef __cplusplus
48extern "C" {
49#endif
50
59
69
79
91
102
113
124
136
146
156SWMM_ENGINE_API int swmm_transport_get_conduit_disp(SWMM_Engine engine, int index, int* link_index,
157 double* value);
158
168
186SWMM_ENGINE_API int swmm_transport_get_boundary(SWMM_Engine engine, int index, char* element,
187 int elem_len, char* species, int spec_len,
188 int* is_ts, double* value, char* ts_name,
189 int ts_len);
190
200
219SWMM_ENGINE_API int swmm_transport_get_source(SWMM_Engine engine, int index, char* element,
220 int elem_len, char* species, int spec_len, int* is_ts,
221 double* value, char* ts_name, int ts_len);
222
223/* =========================================================================
224 * Authoring (closed C-API gaps 2026-10-11)
225 *
226 * The setters below edit the transport.ard configuration that the
227 * serializer writes back to the component file, so API edits persist on
228 * save. They are accepted while the model is being edited (BUILDING or
229 * OPENED) and return SWMM_ERR_LIFECYCLE afterwards. Each edit marks the
230 * configuration as present (swmm_transport_get_configured() == 1).
231 * ========================================================================= */
232
242SWMM_ENGINE_API int swmm_transport_get_detailed_output(SWMM_Engine engine, char* buf, int buflen);
243
257
270 double value);
271
282
301SWMM_ENGINE_API int swmm_transport_set_boundary(SWMM_Engine engine, const char* element,
302 const char* species, int is_ts, double value,
303 const char* ts_name);
304
316
335SWMM_ENGINE_API int swmm_transport_set_source(SWMM_Engine engine, const char* element,
336 const char* species, int is_ts, double value,
337 const char* ts_name);
338
350
351#ifdef __cplusplus
352}
353#endif
354
355#endif /* OPENSWMM_TRANSPORT_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_transport_get_target_dx(SWMM_Engine engine, double *dx)
Read the requested transport-cell spacing.
Definition openswmm_transport_impl.cpp:141
SWMM_ENGINE_API int swmm_transport_get_dispersion_value(SWMM_Engine engine, double *value)
Read the fixed dispersion coefficient.
Definition openswmm_transport_impl.cpp:119
SWMM_ENGINE_API int swmm_transport_get_boundary(SWMM_Engine engine, int index, char *element, int elem_len, char *species, int spec_len, int *is_ts, double *value, char *ts_name, int ts_len)
Copy an authored transport boundary row with optional output fields.
Definition openswmm_transport_impl.cpp:188
SWMM_ENGINE_API int swmm_transport_get_detailed_output(SWMM_Engine engine, char *buf, int buflen)
Read the configured detailed transport CSV sidecar path.
Definition openswmm_transport_impl.cpp:323
SWMM_ENGINE_API int swmm_transport_remove_conduit_disp(SWMM_Engine engine, int index)
Remove an authored conduit dispersion row by index.
Definition openswmm_transport_impl.cpp:364
SWMM_ENGINE_API int swmm_transport_set_boundary(SWMM_Engine engine, const char *element, const char *species, int is_ts, double value, const char *ts_name)
Upsert a transport boundary keyed by element and species names.
Definition openswmm_transport_impl.cpp:375
SWMM_ENGINE_API int swmm_transport_remove_boundary(SWMM_Engine engine, int index)
Remove an authored boundary row by index.
Definition openswmm_transport_impl.cpp:382
SWMM_ENGINE_API int swmm_transport_remove_source(SWMM_Engine engine, int index)
Remove an authored source row by index.
Definition openswmm_transport_impl.cpp:394
SWMM_ENGINE_API int swmm_transport_set_target_dx(SWMM_Engine engine, double dx)
Assign the requested transport-cell spacing and mark transport configuration present.
Definition openswmm_transport_impl.cpp:149
SWMM_ENGINE_API int swmm_transport_get_conduit_disp(SWMM_Engine engine, int index, int *link_index, double *value)
Read one authored conduit-dispersion override.
Definition openswmm_transport_impl.cpp:167
SWMM_ENGINE_API int swmm_transport_get_dispersion_mode(SWMM_Engine engine, int *mode)
Read the global longitudinal-dispersion mode.
Definition openswmm_transport_impl.cpp:100
SWMM_ENGINE_API int swmm_transport_boundary_count(SWMM_Engine engine, int *count)
Count authored transport boundary rows.
Definition openswmm_transport_impl.cpp:180
SWMM_ENGINE_API int swmm_transport_conduit_disp_count(SWMM_Engine engine, int *count)
Count authored per-conduit dispersion override rows.
Definition openswmm_transport_impl.cpp:159
SWMM_ENGINE_API int swmm_transport_source_count(SWMM_Engine engine, int *count)
Count authored transport source rows.
Definition openswmm_transport_impl.cpp:197
SWMM_TransportDispersionMode
[TRANSPORT_OPTIONS] DISPERSION mode.
Definition openswmm_transport.h:52
@ SWMM_DISPERSION_FISCHER
Definition openswmm_transport.h:55
@ SWMM_DISPERSION_OFF
Definition openswmm_transport.h:53
@ SWMM_DISPERSION_VALUE
Definition openswmm_transport.h:57
SWMM_ENGINE_API int swmm_transport_get_configured(SWMM_Engine engine, int *configured)
Read whether an ARD transport component is authored.
Definition openswmm_transport_impl.cpp:92
SWMM_ENGINE_API int swmm_transport_set_conduit_disp(SWMM_Engine engine, int link_index, double value)
Add or replace the dispersion coefficient for one conduit.
Definition openswmm_transport_impl.cpp:340
SWMM_ENGINE_API int swmm_transport_set_dispersion_value(SWMM_Engine engine, double value)
Assign the fixed dispersion coefficient and mark transport configuration present.
Definition openswmm_transport_impl.cpp:127
SWMM_ENGINE_API int swmm_transport_set_dispersion_mode(SWMM_Engine engine, int mode)
Assign the global dispersion mode and mark transport configuration present.
Definition openswmm_transport_impl.cpp:108
SWMM_ENGINE_API int swmm_transport_get_source(SWMM_Engine engine, int index, char *element, int elem_len, char *species, int spec_len, int *is_ts, double *value, char *ts_name, int ts_len)
Copy an authored transport source row with optional output fields.
Definition openswmm_transport_impl.cpp:205
SWMM_ENGINE_API int swmm_transport_set_detailed_output(SWMM_Engine engine, const char *path)
Store a detailed transport CSV sidecar path and mark configuration present.
Definition openswmm_transport_impl.cpp:331
SWMM_ENGINE_API int swmm_transport_set_source(SWMM_Engine engine, const char *element, const char *species, int is_ts, double value, const char *ts_name)
Upsert a transport source keyed by element and species names.
Definition openswmm_transport_impl.cpp:387