16#ifndef OPENSWMM_ENGINE_2D_SURFACE_STATE_DATA_HPP
17#define OPENSWMM_ENGINE_2D_SURFACE_STATE_DATA_HPP
142 void resize(
int n_triangles,
int n_vertices) {
143 auto nt =
static_cast<std::size_t
>(n_triangles);
144 auto nv =
static_cast<std::size_t
>(n_vertices);
147 depth.assign(nt, 0.0);
148 head.assign(nt, 0.0);
185 depth.size() *
sizeof(
double));
187 volume.size() *
sizeof(
double));
224 [[maybe_unused]]
int nthreads = 1) noexcept {
228 const int n =
static_cast<int>(
depth.size());
229#if defined(SWMM_USE_OPENMP)
230#pragma omp parallel for schedule(static) num_threads(nthreads)
232 for (
int i = 0; i < n; ++i) {
Definition NodeCoupling.cpp:15
Definition NodeCoupling.cpp:15
Structure-of-Arrays storage for all nodes.
Definition NodeData.hpp:114
Definition ActiveSetData.hpp:39
SoA storage for per-edge boundary conditions.
Definition BoundaryData.hpp:55
Descriptor for a single coupling point between 2D and 1D.
Definition NodeCoupling.hpp:41
Definition SurfaceStateData.hpp:41
std::vector< double > grad_hy_lim
Limited gradient Y.
Definition SurfaceStateData.hpp:82
std::vector< double > grad_hy
∂h/∂y (unlimited gradient)
Definition SurfaceStateData.hpp:80
void save_state() noexcept
Definition SurfaceStateData.hpp:183
std::vector< int8_t > coupling_forced
0=computed, 1=override, 2=add
Definition SurfaceStateData.hpp:113
std::vector< double > coupling_flux
Exchange with SWMM node (m/s, + = into 2D)
Definition SurfaceStateData.hpp:100
std::vector< int8_t > rainfall_forced
0=computed, 1=override, 2=add
Definition SurfaceStateData.hpp:107
double evap_loss_total
Definition SurfaceStateData.hpp:136
std::vector< double > stat_max_depth
Maximum depth ψ_o seen at each cell (m)
Definition SurfaceStateData.hpp:128
std::vector< double > cell_continuity_err
Definition SurfaceStateData.hpp:92
const ActiveSetData * active_set
Definition SurfaceStateData.hpp:72
std::vector< double > net_source
Net source/sink per cell (m/s)
Definition SurfaceStateData.hpp:101
std::vector< double > rainfall_force_val
Forced rainfall value.
Definition SurfaceStateData.hpp:109
std::vector< double > stat_max_cont_err
Max |cell_continuity_err| (m³/s)
Definition SurfaceStateData.hpp:130
std::vector< double > stat_cum_volume
Cumulative volume through cell (m³)
Definition SurfaceStateData.hpp:131
std::vector< int8_t > evap_persist
0=reset, 1=persist
Definition SurfaceStateData.hpp:111
void clear_reset_forcings() noexcept
Clear RESET forcings after each step.
Definition SurfaceStateData.hpp:198
std::vector< double > depth
Mean wetted depth h̄ = V/A_wet (m) [reconstructed].
Definition SurfaceStateData.hpp:74
std::vector< double > face_vx
Cell velocity X component (m/s)
Definition SurfaceStateData.hpp:88
std::vector< double > grad_hx
∂h/∂x (unlimited gradient)
Definition SurfaceStateData.hpp:79
const std::vector< CouplingPoint > * node_coupling
non-outfall points
Definition SurfaceStateData.hpp:64
std::vector< double > rainfall
Rainfall intensity (m/s)
Definition SurfaceStateData.hpp:98
std::vector< double > volume
Cell water volume V (m³) — the integrated state.
Definition SurfaceStateData.hpp:76
std::vector< double > coupling_force_val
Forced coupling value.
Definition SurfaceStateData.hpp:115
std::vector< double > evap_force_val
Forced evaporation value.
Definition SurfaceStateData.hpp:112
std::vector< double > vert_head
Head reconstructed at vertices.
Definition SurfaceStateData.hpp:85
std::vector< int8_t > evap_forced
0=computed, 1=override, 2=add
Definition SurfaceStateData.hpp:110
void reset_state() noexcept
Definition SurfaceStateData.hpp:190
std::vector< double > head
Free-surface elevation η (m) [reconstructed].
Definition SurfaceStateData.hpp:75
std::vector< double > grad_hx_lim
Limited gradient X.
Definition SurfaceStateData.hpp:81
const NodeData * nodes_1d
Definition SurfaceStateData.hpp:63
std::vector< int8_t > coupling_persist
0=reset, 1=persist
Definition SurfaceStateData.hpp:114
void resize(int n_triangles, int n_vertices)
Definition SurfaceStateData.hpp:142
std::vector< double > face_vy
Cell velocity Y component (m/s)
Definition SurfaceStateData.hpp:89
std::vector< double > evap_rate
Evaporation demand rate (m/s, >= 0)
Definition SurfaceStateData.hpp:99
std::vector< double > stat_max_velocity
Max cell speed |v| = √(vx²+vy²) (m/s)
Definition SurfaceStateData.hpp:129
const BoundaryData * boundary
Definition SurfaceStateData.hpp:54
std::vector< double > old_depth
Mean depth at start of coupling interval.
Definition SurfaceStateData.hpp:121
std::vector< int8_t > rainfall_persist
0=reset, 1=persist
Definition SurfaceStateData.hpp:108
std::vector< double > old_volume
Volume at start of coupling interval (m³)
Definition SurfaceStateData.hpp:122
void update_statistics(const std::vector< double > &tri_area, double dt, int nthreads=1) noexcept
Definition SurfaceStateData.hpp:222
std::vector< double > edge_flux
Normal flux through each edge.
Definition SurfaceStateData.hpp:95