OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
openswmm_sq2d.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
42
43#ifndef OPENSWMM_SQ2D_H
44#define OPENSWMM_SQ2D_H
45
46#include "openswmm_engine.h"
47
48#ifdef __cplusplus
49extern "C" {
50#endif
51
52#define SWMM_SQ2D_SCOPE_GLOBAL 0
53#define SWMM_SQ2D_SCOPE_TAG 1
54#define SWMM_SQ2D_SCOPE_CELL 2
55
56/* =========================================================================
57 * [2D_COVERAGES]
58 * ========================================================================= */
59
69
87SWMM_ENGINE_API int swmm_2d_coverage_set(SWMM_Engine engine, int scope, const char* tag, int cell,
88 const char* const* landuses, const double* percents,
89 int n);
90
100SWMM_ENGINE_API int swmm_2d_coverage_row_size(SWMM_Engine engine, int index, int* n);
101
119SWMM_ENGINE_API int swmm_2d_coverage_get(SWMM_Engine engine, int index, int k, int* scope,
120 char* tag, int taglen, int* cell, char* landuse, int lulen,
121 double* percent);
122
134
135/* =========================================================================
136 * [2D_LOADINGS]
137 * ========================================================================= */
138
148
165SWMM_ENGINE_API int swmm_2d_loading_set(SWMM_Engine engine, int scope, const char* tag, int cell,
166 const char* species, double value);
167
183SWMM_ENGINE_API int swmm_2d_loading_get(SWMM_Engine engine, int index, int* scope, char* tag,
184 int taglen, int* cell, char* species, int splen,
185 double* value);
186
198
199/* =========================================================================
200 * [2D_CURB_LENGTH]
201 * ========================================================================= */
202
212
226SWMM_ENGINE_API int swmm_2d_curb_length_set(SWMM_Engine engine, int scope, const char* tag,
227 int cell, double length);
228
242SWMM_ENGINE_API int swmm_2d_curb_length_get(SWMM_Engine engine, int index, int* scope, char* tag,
243 int taglen, int* cell, double* length);
244
256
257/* =========================================================================
258 * Buildup store (running model)
259 * ========================================================================= */
260
275SWMM_ENGINE_API int swmm_2d_get_buildup_bulk(SWMM_Engine engine, const char* species, double* out,
276 int n);
277
278#ifdef __cplusplus
279}
280#endif
281
282#endif /* OPENSWMM_SQ2D_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_2d_curb_length_remove(SWMM_Engine engine, int index)
Remove an authored 2D curb-length scope row.
Definition ApiSq2D.cpp:326
SWMM_ENGINE_API int swmm_2d_curb_length_count(SWMM_Engine engine, int *count)
Count authored 2D curb-length scope rows.
Definition ApiSq2D.cpp:279
SWMM_ENGINE_API int swmm_2d_coverage_get(SWMM_Engine engine, int index, int k, int *scope, char *tag, int taglen, int *cell, char *landuse, int lulen, double *percent)
Copy the scope and one land-use/percentage pair of a coverage row.
Definition ApiSq2D.cpp:177
SWMM_ENGINE_API int swmm_2d_curb_length_get(SWMM_Engine engine, int index, int *scope, char *tag, int taglen, int *cell, double *length)
Copy one authored curb-length scope row.
Definition ApiSq2D.cpp:309
SWMM_ENGINE_API int swmm_2d_coverage_remove(SWMM_Engine engine, int index)
Remove an authored 2D coverage scope row.
Definition ApiSq2D.cpp:199
SWMM_ENGINE_API int swmm_2d_curb_length_set(SWMM_Engine engine, int scope, const char *tag, int cell, double length)
Upsert a scope's authored curb length.
Definition ApiSq2D.cpp:287
SWMM_ENGINE_API int swmm_2d_loading_set(SWMM_Engine engine, int scope, const char *tag, int cell, const char *species, double value)
Upsert a scope/species initial buildup loading.
Definition ApiSq2D.cpp:220
SWMM_ENGINE_API int swmm_2d_get_buildup_bulk(SWMM_Engine engine, const char *species, double *out, int n)
Read per-cell total land-use buildup for an active surface species.
Definition ApiSq2D.cpp:339
SWMM_ENGINE_API int swmm_2d_coverage_set(SWMM_Engine engine, int scope, const char *tag, int cell, const char *const *landuses, const double *percents, int n)
Replace the complete land-use coverage set for one scope.
Definition ApiSq2D.cpp:149
SWMM_ENGINE_API int swmm_2d_loading_remove(SWMM_Engine engine, int index)
Remove an authored 2D loading scope row.
Definition ApiSq2D.cpp:266
SWMM_ENGINE_API int swmm_2d_loading_get(SWMM_Engine engine, int index, int *scope, char *tag, int taglen, int *cell, char *species, int splen, double *value)
Copy one authored initial-loading scope row.
Definition ApiSq2D.cpp:246
SWMM_ENGINE_API int swmm_2d_coverage_row_size(SWMM_Engine engine, int index, int *n)
Count the land-use pairs in an authored coverage row.
Definition ApiSq2D.cpp:169
SWMM_ENGINE_API int swmm_2d_loading_count(SWMM_Engine engine, int *count)
Count authored 2D loading scope rows.
Definition ApiSq2D.cpp:212
SWMM_ENGINE_API int swmm_2d_coverage_count(SWMM_Engine engine, int *count)
Count authored 2D coverage scope rows.
Definition ApiSq2D.cpp:141