OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
LidLayerCommon.hpp
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
46
47#ifndef OPENSWMM_ENGINE_TRANSPORT_LID_LAYER_COMMON_HPP
48#define OPENSWMM_ENGINE_TRANSPORT_LID_LAYER_COMMON_HPP
49
50#include <vector>
51
54
55namespace openswmm::transport {
56
58
60constexpr int kExternal = -1;
61constexpr int kAbsent = -2;
62
63constexpr int kSurf = static_cast<int>(LidLayer::SURFACE);
64constexpr int kPave = static_cast<int>(LidLayer::PAVEMENT);
65constexpr int kSoil = static_cast<int>(LidLayer::SOIL);
66constexpr int kStor = static_cast<int>(LidLayer::STORAGE);
67
72struct Donors { int surface, pavement, soil, storage; };
73
74Donors donorsFor(lid::LIDType t, bool has_soil);
75
78void layerVolumes(const lid::LIDGroupSoA& g, std::size_t ui,
79 double (&v)[kNL]);
80
82std::vector<int> buildOffsets(const lid::LIDSolver& solver);
83
84} // namespace openswmm::transport
85
86#endif // OPENSWMM_ENGINE_TRANSPORT_LID_LAYER_COMMON_HPP
Low Impact Development (LID) control modules.
Phase A4 — per-(LID unit, layer, species) transported state.
Definition LID.hpp:215
LIDType
Definition LID.hpp:58
Definition ExplicitFvSolver.hpp:52
constexpr int kPave
Definition LidLayerCommon.hpp:64
constexpr int kSoil
Definition LidLayerCommon.hpp:65
constexpr int kNL
Definition LidLayerCommon.hpp:57
std::vector< int > buildOffsets(const lid::LIDSolver &solver)
Flat index of each per-type group's first unit; back() == n_units.
Definition LidLayerCommon.cpp:71
constexpr int kStor
Definition LidLayerCommon.hpp:66
void layerVolumes(const lid::LIDGroupSoA &g, std::size_t ui, double(&v)[kNL])
Definition LidLayerCommon.cpp:62
constexpr int kAbsent
Definition LidLayerCommon.hpp:61
constexpr int kSurf
Definition LidLayerCommon.hpp:63
constexpr int kExternal
-1 means "external to the unit"; -2 means "this type has no such layer".
Definition LidLayerCommon.hpp:60
Donors donorsFor(lid::LIDType t, bool has_soil)
Definition LidLayerCommon.cpp:30
@ PAVEMENT
Definition LidLayerSpeciesData.hpp:54
@ SURFACE
Definition LidLayerSpeciesData.hpp:53
@ SOIL
Definition LidLayerSpeciesData.hpp:55
@ STORAGE
Definition LidLayerSpeciesData.hpp:56
static constexpr int kLayerCount
Definition LidLayerSpeciesData.hpp:106
Definition LID.hpp:83
Definition LidLayerCommon.hpp:72
int pavement
Definition LidLayerCommon.hpp:72
int soil
Definition LidLayerCommon.hpp:72
int storage
Definition LidLayerCommon.hpp:72
int surface
Definition LidLayerCommon.hpp:72