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
69 int* enabled);
70
73 int source,
74 double* hours);
75
82 int source,
83 double hours);
84
87 int* count);
88
94 int* source, int* node_index,
95 double* hours);
96
104 int source, int node_index,
105 double hours);
106
109 int source,
110 int node_index);
111
118 const char* path);
119
120#ifdef __cplusplus
121}
122#endif
123
124#endif // OPENSWMM_WATER_AGE_H
#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).
SWMM_ENGINE_API int swmm_water_age_override_count(SWMM_Engine engine, int *count)
Number of per-node override rows.
Definition openswmm_water_age_impl.cpp:96
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)
1 if [OPTIONS] WATER_AGE is ON, else 0.
Definition openswmm_water_age_impl.cpp:64
SWMM_ENGINE_API int swmm_water_age_remove_override(SWMM_Engine engine, int source, int node_index)
Remove the override for (source, node_index); BADINDEX if none.
Definition openswmm_water_age_impl.cpp:144
SWMM_ENGINE_API int swmm_water_age_set_global_source(SWMM_Engine engine, int source, double hours)
Set the GLOBAL age for one source pathway, HOURS.
Definition openswmm_water_age_impl.cpp:83
SWMM_ENGINE_API int swmm_water_age_set_override(SWMM_Engine engine, int source, int node_index, double hours)
Add or update the override for (source, node_index), HOURS.
Definition openswmm_water_age_impl.cpp:119
SWMM_ENGINE_API int swmm_water_age_get_override(SWMM_Engine engine, int index, int *source, int *node_index, double *hours)
Read override row index (0-based): its source, node index, and HOURS. Row order is stable across edit...
Definition openswmm_water_age_impl.cpp:105
SWMM_ENGINE_API int swmm_water_age_get_global_source(SWMM_Engine engine, int source, double *hours)
GLOBAL age for one source pathway, HOURS (signed per D-NS1).
Definition openswmm_water_age_impl.cpp:72
SWMM_ENGINE_API int swmm_water_age_save(SWMM_Engine engine, const char *path)
Write the current table as a [WATER_AGE_SOURCES] component file (the model.age format the waterage co...
Definition openswmm_water_age_impl.cpp:158