OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
openswmm_water_age.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_WATER_AGE_H
44#define OPENSWMM_WATER_AGE_H
45
46#include "openswmm_engine.h"
47
48#ifdef __cplusplus
49extern "C" {
50#endif
51
66
78
91SWMM_ENGINE_API int swmm_water_age_get_global_source(SWMM_Engine engine, int source, double* hours);
92
109SWMM_ENGINE_API int swmm_water_age_set_global_source(SWMM_Engine engine, int source, double hours);
110
120
135SWMM_ENGINE_API int swmm_water_age_get_override(SWMM_Engine engine, int index, int* source,
136 int* node_index, double* hours);
137
155SWMM_ENGINE_API int swmm_water_age_set_override(SWMM_Engine engine, int source, int node_index,
156 double hours);
157
170SWMM_ENGINE_API int swmm_water_age_remove_override(SWMM_Engine engine, int source, int node_index);
171
186SWMM_ENGINE_API int swmm_water_age_save(SWMM_Engine engine, const char* path);
187
188#ifdef __cplusplus
189}
190#endif
191
192#endif // OPENSWMM_WATER_AGE_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_water_age_override_count(SWMM_Engine engine, int *count)
Count stored per-node source-age override rows.
Definition openswmm_water_age_impl.cpp:114
SWMM_WaterAgeSource
Source pathways (mirrors the engine's WaterAgeSource order — the values are the storage indices,...
Definition openswmm_water_age.h:56
@ SWMM_AGE_SRC_GW
Definition openswmm_water_age.h:59
@ SWMM_AGE_SRC_EXTERNAL_INFLOW
Definition openswmm_water_age.h:61
@ SWMM_AGE_SRC_RDII
Definition openswmm_water_age.h:60
@ SWMM_AGE_SRC_IFACE
Definition openswmm_water_age.h:62
@ SWMM_AGE_SRC_RAINFALL
Definition openswmm_water_age.h:57
@ SWMM_AGE_SRC_INITIAL_STATE
Definition openswmm_water_age.h:63
@ SWMM_AGE_SRC_DWF
Definition openswmm_water_age.h:58
@ SWMM_AGE_SRC_COUNT
Definition openswmm_water_age.h:64
SWMM_ENGINE_API int swmm_water_age_get_enabled(SWMM_Engine engine, int *enabled)
Read the model WATER_AGE option without changing it.
Definition openswmm_water_age_impl.cpp:84
SWMM_ENGINE_API int swmm_water_age_remove_override(SWMM_Engine engine, int source, int node_index)
Remove one source/node override and shift later row indices down.
Definition openswmm_water_age_impl.cpp:162
SWMM_ENGINE_API int swmm_water_age_set_global_source(SWMM_Engine engine, int source, double hours)
Assign a global pathway source age in hours.
Definition openswmm_water_age_impl.cpp:103
SWMM_ENGINE_API int swmm_water_age_set_override(SWMM_Engine engine, int source, int node_index, double hours)
Insert or update a source/node age override.
Definition openswmm_water_age_impl.cpp:138
SWMM_ENGINE_API int swmm_water_age_get_override(SWMM_Engine engine, int index, int *source, int *node_index, double *hours)
Read a per-node source-age override by row index.
Definition openswmm_water_age_impl.cpp:123
SWMM_ENGINE_API int swmm_water_age_get_global_source(SWMM_Engine engine, int source, double *hours)
Read one global pathway source age in hours.
Definition openswmm_water_age_impl.cpp:92
SWMM_ENGINE_API int swmm_water_age_save(SWMM_Engine engine, const char *path)
Serialize the current source-age table to a component file.
Definition openswmm_water_age_impl.cpp:174