25#ifndef OPENSWMM_FORCING_DATA_HPP
26#define OPENSWMM_FORCING_DATA_HPP
132 void resize(
int n_nodes,
int n_links,
int n_subcatches,
133 int n_gages,
int n_pollutants) {
140 auto un =
static_cast<std::size_t
>(n_nodes);
141 auto ul =
static_cast<std::size_t
>(n_links);
142 auto us =
static_cast<std::size_t
>(n_subcatches);
143 auto ug =
static_cast<std::size_t
>(n_gages);
144 auto unp =
static_cast<std::size_t
>(n_nodes) *
145 static_cast<std::size_t
>(n_pollutants);
167 auto ulp =
static_cast<std::size_t
>(n_links) *
168 static_cast<std::size_t
>(n_pollutants);
194 auto set_none = [](
auto& mode_vec) {
220 auto clear_resets = [](
auto& mode_vec,
const auto& persist_vec) {
221 for (std::size_t i = 0; i < mode_vec.size(); ++i) {
254 default:
return broadcast;
268 default:
return broadcast;
288 default:
return gage_rainfall;
302 default:
return broadcast;
321 default:
return gage_snowfall;
346 default:
return broadcast_rate;
@ NONE
Definition SimulationContext.hpp:125
Definition NodeCoupling.cpp:15
ForcingPersist
Definition ForcingData.hpp:43
@ PERSIST
Keep until explicitly cleared.
Definition ForcingData.hpp:45
@ RESET
Auto-clear after each timestep.
Definition ForcingData.hpp:44
ForcingMode
Definition ForcingData.hpp:37
@ OVERRIDE
Replace computed value with user value.
Definition ForcingData.hpp:39
@ ADD
Add user value to computed value.
Definition ForcingData.hpp:40
@ NONE
Use model-computed value (no forcing)
Definition ForcingData.hpp:38
Definition ForcingData.hpp:52
void clear_reset_entries()
Clear only RESET-persistence entries (called at end of each step).
Definition ForcingData.hpp:219
std::vector< double > subcatch_rainfall_value
user units (in/hr or mm/hr)
Definition ForcingData.hpp:86
std::vector< ForcingMode > node_lat_inflow_mode
Definition ForcingData.hpp:56
double effective_wind(double broadcast) const noexcept
Resolve the effective wind speed (mph internal).
Definition ForcingData.hpp:264
ForcingMode climate_evap_mode
Definition ForcingData.hpp:113
void resize(int n_nodes, int n_links, int n_subcatches, int n_gages, int n_pollutants)
Allocate all arrays and initialise to NONE / 0 / RESET.
Definition ForcingData.hpp:132
double climate_evap_value
ft/sec (internal; converted from in/day or mm/day at the C API boundary)
Definition ForcingData.hpp:114
std::vector< double > link_setting_value
0.0–1.0 for pump/orifice/weir
Definition ForcingData.hpp:76
std::vector< ForcingMode > gage_rainfall_mode
Definition ForcingData.hpp:99
int n_pollutants_
Definition ForcingData.hpp:123
std::vector< ForcingPersist > subcatch_evap_persist
Definition ForcingData.hpp:91
std::vector< ForcingMode > link_quality_mode
flattened link × pollutant
Definition ForcingData.hpp:79
void clear_all()
Reset ALL forcing modes to NONE (called on simulation restart).
Definition ForcingData.hpp:193
std::vector< ForcingMode > subcatch_snowfall_mode
Definition ForcingData.hpp:93
int n_links_
Definition ForcingData.hpp:120
ForcingMode climate_wind_mode
Definition ForcingData.hpp:109
std::vector< double > node_lat_inflow_value
Definition ForcingData.hpp:57
std::vector< ForcingMode > subcatch_rainfall_mode
Definition ForcingData.hpp:85
std::vector< double > link_quality_value
OVERRIDE: concentration; ADD: mass rate (mass/sec)
Definition ForcingData.hpp:80
std::vector< double > subcatch_evap_value
prescribed PET rate, ft/sec (internal units; converted from in/day or mm/day at the C API boundary)
Definition ForcingData.hpp:90
int n_subcatches_
Definition ForcingData.hpp:121
double climate_temperature_value
deg F (internal; converted from deg C at the C API boundary for SI)
Definition ForcingData.hpp:106
double effective_temperature(double broadcast) const noexcept
Resolve the effective air temperature (deg F internal).
Definition ForcingData.hpp:250
std::vector< ForcingMode > link_setting_mode
Definition ForcingData.hpp:75
double effective_snowfall(std::size_t ui, double gage_snowfall) const noexcept
Resolve the effective snowfall for a subcatchment (ft/sec).
Definition ForcingData.hpp:316
std::vector< ForcingMode > node_quality_mode
Definition ForcingData.hpp:65
std::vector< ForcingPersist > subcatch_snowfall_persist
Definition ForcingData.hpp:95
double climate_wind_value
mph (internal; converted from km/hr at the C API boundary for SI)
Definition ForcingData.hpp:110
std::vector< double > subcatch_snowfall_value
ft/sec (internal; converted from in/hr or mm/hr at the C API boundary)
Definition ForcingData.hpp:94
std::vector< double > gage_rainfall_value
user units (in/hr or mm/hr)
Definition ForcingData.hpp:100
std::vector< ForcingPersist > gage_rainfall_persist
Definition ForcingData.hpp:101
double effective_rainfall(std::size_t ui, double gage_rainfall) const noexcept
Resolve the effective rainfall for a subcatchment.
Definition ForcingData.hpp:283
std::vector< ForcingPersist > link_quality_persist
Definition ForcingData.hpp:81
std::vector< ForcingPersist > link_flow_persist
Definition ForcingData.hpp:73
ForcingPersist climate_wind_persist
Definition ForcingData.hpp:111
ForcingMode climate_temperature_mode
Definition ForcingData.hpp:105
std::vector< double > link_flow_value
Definition ForcingData.hpp:72
std::vector< ForcingPersist > node_lat_inflow_persist
Definition ForcingData.hpp:58
double effective_climate_evap(double broadcast) const noexcept
Resolve the effective system-wide evaporation rate (ft/sec).
Definition ForcingData.hpp:298
std::vector< ForcingMode > link_flow_mode
Definition ForcingData.hpp:71
ForcingPersist climate_temperature_persist
Definition ForcingData.hpp:107
std::vector< ForcingMode > node_head_boundary_mode
Definition ForcingData.hpp:60
std::vector< ForcingPersist > node_quality_persist
Definition ForcingData.hpp:67
std::vector< ForcingPersist > subcatch_rainfall_persist
Definition ForcingData.hpp:87
double effective_evap_rate(std::size_t ui, double broadcast_rate) const noexcept
Resolve the effective evaporation rate for a subcatchment.
Definition ForcingData.hpp:338
std::vector< ForcingPersist > node_head_boundary_persist
Definition ForcingData.hpp:62
ForcingPersist climate_evap_persist
Definition ForcingData.hpp:115
std::vector< ForcingPersist > link_setting_persist
Definition ForcingData.hpp:77
std::vector< double > node_head_boundary_value
Definition ForcingData.hpp:61
int n_gages_
Definition ForcingData.hpp:122
std::vector< ForcingMode > subcatch_evap_mode
Definition ForcingData.hpp:89
int n_nodes_
Definition ForcingData.hpp:119
std::vector< double > node_quality_value
mass rate (mass/sec)
Definition ForcingData.hpp:66