OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
openswmm_infil2d.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
70
71#ifndef OPENSWMM_INFIL2D_H
72#define OPENSWMM_INFIL2D_H
73
74#include "openswmm_engine.h"
75
76#ifdef __cplusplus
77extern "C" {
78#endif
79
80/* =========================================================================
81 * Codes and limits
82 * ========================================================================= */
83
90#define SWMM_INFIL2D_MAX_PARAMS 5
91
95#define SWMM_INFIL2D_HORTON 0
96#define SWMM_INFIL2D_MOD_HORTON 1
97#define SWMM_INFIL2D_GREEN_AMPT 2
98#define SWMM_INFIL2D_MOD_GREEN_AMPT 3
99#define SWMM_INFIL2D_CURVE_NUMBER 4
100#define SWMM_INFIL2D_CONSTANT 5
101
108#define SWMM_INFIL2D_DEST_LOST 0
109#define SWMM_INFIL2D_DEST_SUBCATCH_AQUIFER 1
110#define SWMM_INFIL2D_DEST_AQUIFER_2D 2
111
112/* =========================================================================
113 * Value types
114 * ========================================================================= */
115
126
162
163/* =========================================================================
164 * Options — `[2D_INFILTRATION_OPTIONS]`
165 * ========================================================================= */
166
179 SWMM_Infil2DOptions* options);
180
204 const SWMM_Infil2DOptions* options);
205
206/* =========================================================================
207 * Tag defaults — `[2D_INFILTRATION_DEFAULTS]`
208 * ========================================================================= */
209
221
235 SWMM_Infil2DRow* row);
236
250 char* buf, int buflen);
251
274 const char* tag,
275 const SWMM_Infil2DRow* row);
276
291 const char* tag);
292
293/* =========================================================================
294 * Per-cell overrides — `[2D_INFILTRATION]`
295 * ========================================================================= */
296
321 SWMM_Infil2DRow* row,
322 int* is_override);
323
344 const SWMM_Infil2DRow* row);
345
369 const int* tris, int n,
370 const SWMM_Infil2DRow* row);
371
372/* =========================================================================
373 * State readback (SI, like the rest of the 2D API)
374 * ========================================================================= */
375
393 double* f, int n);
394
413 double* F, int n);
414
429 double* volume);
430
431#ifdef __cplusplus
432} /* extern "C" */
433#endif
434
435#endif /* OPENSWMM_INFIL2D_H */
SWMM_ENGINE_API int swmm_infil2d_set_options(SWMM_Engine engine, const SWMM_Infil2DOptions *options)
Set the 2D infiltration options (INFIL_STEP, seconds).
Definition ApiInfil2D.cpp:205
SWMM_ENGINE_API int swmm_infil2d_set_cells(SWMM_Engine engine, const int *tris, int n, const SWMM_Infil2DRow *row)
Assign one specification to many triangles in a single call.
Definition ApiInfil2D.cpp:367
SWMM_ENGINE_API int swmm_infil2d_get_options(SWMM_Engine engine, SWMM_Infil2DOptions *options)
Get the 2D infiltration options (INFIL_STEP).
Definition ApiInfil2D.cpp:196
SWMM_ENGINE_API int swmm_infil2d_set_default(SWMM_Engine engine, const char *tag, const SWMM_Infil2DRow *row)
Add or replace the default row for a tag.
Definition ApiInfil2D.cpp:263
SWMM_ENGINE_API int swmm_infil2d_defaults_count(SWMM_Engine engine, int *count)
Number of authored tag-default rows, including the ‘’*'` row.
Definition ApiInfil2D.cpp:223
SWMM_ENGINE_API int swmm_infil2d_get_default(SWMM_Engine engine, int idx, SWMM_Infil2DRow *row)
Read one tag-default row by index.
Definition ApiInfil2D.cpp:232
SWMM_ENGINE_API int swmm_infil2d_get_cell(SWMM_Engine engine, int tri, SWMM_Infil2DRow *row, int *is_override)
Read the infiltration specification in force at one triangle.
Definition ApiInfil2D.cpp:310
SWMM_ENGINE_API int swmm_infil2d_get_total_volume(SWMM_Engine engine, double *volume)
Get the cumulative 2D infiltration loss (m³) — the infil_out mass-balance ledger row.
Definition ApiInfil2D.cpp:428
SWMM_ENGINE_API int swmm_infil2d_get_rate_bulk(SWMM_Engine engine, double *f, int n)
Bulk get the held per-cell infiltration rate (m/s, >= 0).
Definition ApiInfil2D.cpp:402
#define SWMM_INFIL2D_MAX_PARAMS
Number of positional parameter columns carried per row.
Definition openswmm_infil2d.h:90
SWMM_ENGINE_API int swmm_infil2d_remove_default(SWMM_Engine engine, const char *tag)
Remove every default row carrying a tag.
Definition ApiInfil2D.cpp:288
SWMM_ENGINE_API int swmm_infil2d_get_default_tag(SWMM_Engine engine, int idx, char *buf, int buflen)
Read the TAG of one default row by index.
Definition ApiInfil2D.cpp:245
SWMM_ENGINE_API int swmm_infil2d_get_cum_bulk(SWMM_Engine engine, double *F, int n)
Bulk get the cumulative infiltrated depth per cell (m).
Definition ApiInfil2D.cpp:414
SWMM_ENGINE_API int swmm_infil2d_set_cell(SWMM_Engine engine, int tri, const SWMM_Infil2DRow *row)
Set (or clear) the per-cell [2D_INFILTRATION] override of one triangle.
Definition ApiInfil2D.cpp:343
#define SWMM_ENGINE_API
Definition openswmm_2d.h:53
void * SWMM_Engine
Opaque handle to an OpenSWMM Engine instance.
Definition openswmm_callbacks.h:51
OpenSWMM Engine — primary transparent C API (master header).
[2D_INFILTRATION_OPTIONS] — POD mirror of openswmm::twoD::Infil2DOptions.
Definition openswmm_infil2d.h:119
double infil_step
Definition openswmm_infil2d.h:124
One infiltration specification — POD mirror of openswmm::twoD::Infil2DRow.
Definition openswmm_infil2d.h:150
int has_method
Definition openswmm_infil2d.h:153
int dest
Definition openswmm_infil2d.h:160
int method
Definition openswmm_infil2d.h:155
double p[SWMM_INFIL2D_MAX_PARAMS]
Definition openswmm_infil2d.h:157