OpenSWMM Engine  6.0.0-alpha.1
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.1)
Loading...
Searching...
No Matches
BoundaryData.hpp
Go to the documentation of this file.
1
23#ifndef OPENSWMM_ENGINE_2D_BOUNDARY_DATA_HPP
24#define OPENSWMM_ENGINE_2D_BOUNDARY_DATA_HPP
25
26#include <vector>
27#include <cstdint>
28
29namespace openswmm::twoD {
30
40enum class BoundaryType : int8_t {
41 WALL = 0,
42 NORMAL_FLOW = 1,
43 SPECIFIED_STAGE = 2,
44 SPECIFIED_FLOW = 3,
45 RATING_CURVE = 4
46};
47
56
58 std::vector<int8_t> edge_bc_type;
59
62 std::vector<double> edge_bed_slope;
63
66 std::vector<double> edge_bc_head;
67
71 std::vector<int> edge_bc_tseries;
72
74 std::vector<std::string> edge_bc_tseries_name;
75
78 std::vector<double> edge_bc_cum_flux;
79
80 // -----------------------------------------------------------------------
81 // V-E4 — SPECIFIED_FLOW slots (per-metre-of-edge discharge).
82 // Sign convention: outward-positive (matches edge_bc_cum_flux).
83 // -----------------------------------------------------------------------
84
87 std::vector<double> edge_bc_flow;
88
92 std::vector<int> edge_bc_flow_tseries;
93
95 std::vector<std::string> edge_bc_flow_tseries_name;
96
97 // -----------------------------------------------------------------------
98 // V-E5 — RATING_CURVE slot (stage → flow lookup).
99 // -----------------------------------------------------------------------
100
103 std::vector<int> edge_bc_rating_curve;
104
106 std::vector<std::string> edge_bc_rating_curve_name;
107
108 // -----------------------------------------------------------------------
109 // Lifecycle
110 // -----------------------------------------------------------------------
111
116 void resize(int n_edges) {
117 auto n = static_cast<std::size_t>(n_edges);
118 edge_bc_type.assign(n, static_cast<int8_t>(BoundaryType::WALL));
119 edge_bed_slope.assign(n, 0.0);
120 edge_bc_head.assign(n, 0.0);
121 edge_bc_tseries.assign(n, -1);
122 edge_bc_tseries_name.resize(n);
123 edge_bc_cum_flux.assign(n, 0.0);
124 edge_bc_flow.assign(n, 0.0);
125 edge_bc_flow_tseries.assign(n, -1);
127 edge_bc_rating_curve.assign(n, -1);
129 }
130
131 int size() const noexcept { return static_cast<int>(edge_bc_type.size()); }
132};
133
134} // namespace openswmm::twoD
135
136#endif // OPENSWMM_ENGINE_2D_BOUNDARY_DATA_HPP
Definition NodeCoupling.cpp:15
BoundaryType
Boundary condition types for 2D mesh edges.
Definition BoundaryData.hpp:40
@ RATING_CURVE
Stage → flow lookup (curve registry index)
@ SPECIFIED_FLOW
Prescribed discharge per metre of edge (constant or TS)
@ NORMAL_FLOW
Manning outflow using bed slope.
@ WALL
Zero-flux wall (default)
@ SPECIFIED_STAGE
Prescribed water surface elevation (constant or TS)
SoA storage for per-edge boundary conditions.
Definition BoundaryData.hpp:55
std::vector< std::string > edge_bc_flow_tseries_name
Timeseries name for deferred resolution (cleared after resolve).
Definition BoundaryData.hpp:95
void resize(int n_edges)
Resize all arrays to n_edges and initialize to WALL defaults.
Definition BoundaryData.hpp:116
std::vector< int > edge_bc_tseries
Definition BoundaryData.hpp:71
std::vector< int8_t > edge_bc_type
Boundary condition type per edge (cast from BoundaryType)
Definition BoundaryData.hpp:58
std::vector< std::string > edge_bc_tseries_name
Timeseries name for deferred resolution (cleared after resolve).
Definition BoundaryData.hpp:74
std::vector< double > edge_bed_slope
Definition BoundaryData.hpp:62
std::vector< double > edge_bc_flow
Definition BoundaryData.hpp:87
std::vector< double > edge_bc_head
Definition BoundaryData.hpp:66
int size() const noexcept
Definition BoundaryData.hpp:131
std::vector< std::string > edge_bc_rating_curve_name
Curve name for deferred resolution (cleared after resolve).
Definition BoundaryData.hpp:106
std::vector< double > edge_bc_cum_flux
Definition BoundaryData.hpp:78
std::vector< int > edge_bc_rating_curve
Definition BoundaryData.hpp:103
std::vector< int > edge_bc_flow_tseries
Definition BoundaryData.hpp:92