OpenSWMM Engine  6.0.0-alpha.1
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.1)
Loading...
Searching...
No Matches
InfraData.hpp
Go to the documentation of this file.
1
14#ifndef OPENSWMM_ENGINE_INFRA_DATA_HPP
15#define OPENSWMM_ENGINE_INFRA_DATA_HPP
16
17#include <vector>
18#include <string>
19
20namespace openswmm {
21
22// ============================================================================
23// Transect definitions (from [TRANSECTS] section)
24// ============================================================================
25
27 int count() const { return static_cast<int>(names.size()); }
28
29 std::vector<std::string> names;
30 std::vector<std::string> comments;
31 std::vector<double> n_left;
32 std::vector<double> n_right;
33 std::vector<double> n_channel;
34 std::vector<double> x_left_bank;
35 std::vector<double> x_right_bank;
40 std::vector<double> x_left_encroachment;
41 std::vector<double> x_right_encroachment;
42 std::vector<double> x_factor;
43 std::vector<double> y_factor;
44 std::vector<double> length_factor;
46 std::vector<std::vector<double>> stations;
47 std::vector<std::vector<double>> elevations;
48};
49
50// ============================================================================
51// Street definitions (from [STREETS] section)
52// ============================================================================
53
55 int count() const { return static_cast<int>(names.size()); }
56
57 std::vector<std::string> names;
58 std::vector<double> t_crown;
59 std::vector<double> h_curb;
60 std::vector<double> sx;
61 std::vector<double> n_road;
62 std::vector<double> gutter_depres;
63 std::vector<double> gutter_width;
64 std::vector<int> sides;
65 std::vector<double> back_width;
66 std::vector<double> back_slope;
67 std::vector<double> back_n;
68};
69
70// ============================================================================
71// Inlet definitions (from [INLETS] section)
72// ============================================================================
73
74struct InletStore {
75 int count() const { return static_cast<int>(names.size()); }
76
77 std::vector<std::string> names;
78 std::vector<std::string> inlet_type;
79 std::vector<double> length;
80 std::vector<double> width;
81 std::vector<std::string> grate_type;
82 std::vector<double> open_area;
83 std::vector<double> splash_veloc;
84};
85
86// ============================================================================
87// Inlet usage (from [INLET_USAGE] section)
88// ============================================================================
89
91 int count() const { return static_cast<int>(link_index.size()); }
92
93 std::vector<int> link_index;
94 std::vector<int> design_index;
95 std::vector<int> node_index;
96 std::vector<int> num_inlets;
97 std::vector<int> placement;
98 std::vector<double> clog_factor;
99 std::vector<double> flow_limit;
100 std::vector<double> local_depress;
101 std::vector<double> local_width;
102 std::vector<int> street_index;
103
104 // Stats (populated by InletSolver::gatherStats() before reporting)
105 std::vector<double> stat_capture_vol;
106 std::vector<double> stat_bypass_vol;
107 std::vector<double> stat_backflow_vol;
108 std::vector<double> stat_peak_flow;
109
110 void resize_stats(int n) {
111 auto un = static_cast<std::size_t>(n);
112 stat_capture_vol.assign(un, 0.0);
113 stat_bypass_vol.assign(un, 0.0);
114 stat_backflow_vol.assign(un, 0.0);
115 stat_peak_flow.assign(un, 0.0);
116 }
117};
118
119// ============================================================================
120// Control rule text (from [CONTROLS] section)
121// ============================================================================
122
124 int count() const { return static_cast<int>(rule_text.size()); }
125
128 std::vector<std::string> rule_text;
129};
130
131} // namespace openswmm
132
133#endif // OPENSWMM_ENGINE_INFRA_DATA_HPP
Definition NodeCoupling.cpp:15
Definition InfraData.hpp:123
int count() const
Definition InfraData.hpp:124
std::vector< std::string > rule_text
Definition InfraData.hpp:128
Definition InfraData.hpp:74
std::vector< double > open_area
Definition InfraData.hpp:82
std::vector< double > width
or height for curb
Definition InfraData.hpp:80
std::vector< std::string > grate_type
P-50, P-50x100, CURVED_VANE, etc.
Definition InfraData.hpp:81
int count() const
Definition InfraData.hpp:75
std::vector< double > splash_veloc
Definition InfraData.hpp:83
std::vector< std::string > inlet_type
GRATE/CURB/SLOTTED/DROP_GRATE/DROP_CURB/CUSTOM.
Definition InfraData.hpp:78
std::vector< double > length
Definition InfraData.hpp:79
std::vector< std::string > names
Definition InfraData.hpp:77
Definition InfraData.hpp:90
std::vector< int > num_inlets
Number of inlets per side.
Definition InfraData.hpp:96
std::vector< int > street_index
Index into StreetStore (-1 if none)
Definition InfraData.hpp:102
std::vector< int > design_index
Index into InletStore.
Definition InfraData.hpp:94
std::vector< double > stat_capture_vol
Total captured volume (ft³)
Definition InfraData.hpp:105
std::vector< double > flow_limit
Max capture flow (cfs), 0=unlimited.
Definition InfraData.hpp:99
std::vector< int > node_index
Receiving node index.
Definition InfraData.hpp:95
std::vector< double > local_width
Local depression width (ft)
Definition InfraData.hpp:101
std::vector< double > local_depress
Local gutter depression (ft)
Definition InfraData.hpp:100
std::vector< double > stat_peak_flow
Peak captured flow (cfs)
Definition InfraData.hpp:108
std::vector< int > placement
0=auto, 1=on_grade, 2=on_sag
Definition InfraData.hpp:97
std::vector< double > clog_factor
1.0 - pctClogged/100
Definition InfraData.hpp:98
int count() const
Definition InfraData.hpp:91
std::vector< int > link_index
Conduit link index.
Definition InfraData.hpp:93
std::vector< double > stat_backflow_vol
Total backflow volume (ft³)
Definition InfraData.hpp:107
void resize_stats(int n)
Definition InfraData.hpp:110
std::vector< double > stat_bypass_vol
Total bypassed volume (ft³)
Definition InfraData.hpp:106
Definition InfraData.hpp:54
std::vector< double > gutter_depres
Definition InfraData.hpp:62
std::vector< double > h_curb
Definition InfraData.hpp:59
std::vector< double > back_slope
Definition InfraData.hpp:66
std::vector< double > sx
Cross slope (%)
Definition InfraData.hpp:60
std::vector< double > back_n
Definition InfraData.hpp:67
std::vector< double > back_width
Definition InfraData.hpp:65
std::vector< double > gutter_width
Definition InfraData.hpp:63
int count() const
Definition InfraData.hpp:55
std::vector< double > t_crown
Definition InfraData.hpp:58
std::vector< int > sides
Definition InfraData.hpp:64
std::vector< std::string > names
Definition InfraData.hpp:57
std::vector< double > n_road
Definition InfraData.hpp:61
Definition InfraData.hpp:26
std::vector< std::string > comments
Free-form description per transect (DA-ENG-09)
Definition InfraData.hpp:30
std::vector< double > x_left_encroachment
Definition InfraData.hpp:40
std::vector< double > x_left_bank
Definition InfraData.hpp:34
std::vector< double > y_factor
Definition InfraData.hpp:43
std::vector< double > x_right_bank
Definition InfraData.hpp:35
std::vector< double > n_left
Definition InfraData.hpp:31
std::vector< std::vector< double > > stations
Station-elevation pairs per transect.
Definition InfraData.hpp:46
std::vector< double > x_factor
Definition InfraData.hpp:42
std::vector< double > n_channel
Definition InfraData.hpp:33
std::vector< std::vector< double > > elevations
Definition InfraData.hpp:47
std::vector< double > length_factor
Definition InfraData.hpp:44
int count() const
Definition InfraData.hpp:27
std::vector< double > x_right_encroachment
Definition InfraData.hpp:41
std::vector< std::string > names
Definition InfraData.hpp:29
std::vector< double > n_right
Definition InfraData.hpp:32