32#ifndef OPENSWMM_ENGINE_2D_SURFACE_STATE_DATA_HPP
33#define OPENSWMM_ENGINE_2D_SURFACE_STATE_DATA_HPP
225 void resize(
int n_triangles,
int n_vertices) {
226 auto nt =
static_cast<std::size_t
>(n_triangles);
227 auto nv =
static_cast<std::size_t
>(n_vertices);
230 depth.assign(nt, 0.0);
231 head.assign(nt, 0.0);
272 depth.size() *
sizeof(
double));
274 volume.size() *
sizeof(
double));
315 [[maybe_unused]]
int nthreads = 1) noexcept {
319 const int n =
static_cast<int>(
depth.size());
320#if defined(SWMM_USE_OPENMP)
321#pragma omp parallel for schedule(static) num_threads(nthreads)
323 for (
int i = 0; i < n; ++i) {
Structure-of-Arrays (SoA) storage for 2D triangular mesh geometry.
Overland transport S1 — per-cell species MASS on the 2D surface.
Definition NodeCoupling.cpp:16
constexpr int kMaxCellVerts
Definition MeshData.hpp:49
Definition NodeCoupling.cpp:16
Structure-of-Arrays storage for all nodes.
Definition NodeData.hpp:130
SoA storage for per-edge boundary conditions.
Definition BoundaryData.hpp:71
Descriptor for a single coupling point between 2D and 1D.
Definition NodeCoupling.hpp:57
Definition SurfaceStateData.hpp:59
std::vector< double > grad_hy_lim
Limited gradient Y.
Definition SurfaceStateData.hpp:101
std::vector< double > infil_rate
Definition SurfaceStateData.hpp:137
std::vector< double > grad_hy
∂h/∂y (unlimited gradient)
Definition SurfaceStateData.hpp:99
void save_state() noexcept
Definition SurfaceStateData.hpp:270
std::vector< int8_t > coupling_forced
0=computed, 1=override, 2=add
Definition SurfaceStateData.hpp:182
std::vector< double > coupling_flux
Exchange with SWMM node (m/s, + = into 2D)
Definition SurfaceStateData.hpp:150
bool forcing_ever_set
Definition SurfaceStateData.hpp:198
std::vector< double > vert_depth_signed
Definition SurfaceStateData.hpp:114
std::vector< int8_t > rainfall_forced
0=computed, 1=override, 2=add
Definition SurfaceStateData.hpp:176
double evap_loss_total
Definition SurfaceStateData.hpp:219
std::vector< double > stat_max_depth
Maximum depth ψ_o seen at each cell (m)
Definition SurfaceStateData.hpp:211
std::vector< double > cell_continuity_err
Definition SurfaceStateData.hpp:121
std::vector< double > net_source
Net source/sink per cell (m/s)
Definition SurfaceStateData.hpp:170
SurfaceTransportState transport
Definition SurfaceStateData.hpp:91
std::vector< double > rainfall_force_val
Forced rainfall value.
Definition SurfaceStateData.hpp:178
std::vector< double > stat_max_cont_err
Max |cell_continuity_err| (m³/s)
Definition SurfaceStateData.hpp:213
std::vector< double > stat_cum_volume
Cumulative volume through cell (m³)
Definition SurfaceStateData.hpp:214
std::vector< int8_t > evap_persist
0=reset, 1=persist
Definition SurfaceStateData.hpp:180
void clear_reset_forcings() noexcept
Clear RESET forcings after each step.
Definition SurfaceStateData.hpp:285
bool forcing_dirty
Definition SurfaceStateData.hpp:191
const std::vector< double > * node_row_conc
Definition SurfaceStateData.hpp:83
std::vector< double > depth
Mean wetted depth h̄ = V/A_wet (m) [reconstructed].
Definition SurfaceStateData.hpp:93
std::vector< double > face_vx
Cell velocity X component (m/s)
Definition SurfaceStateData.hpp:117
std::vector< double > grad_hx
∂h/∂x (unlimited gradient)
Definition SurfaceStateData.hpp:98
const std::vector< CouplingPoint > * node_coupling
non-outfall points
Definition SurfaceStateData.hpp:84
std::vector< double > rainfall
Rainfall intensity (m/s)
Definition SurfaceStateData.hpp:127
std::vector< double > volume
Cell water volume V (m³) — the integrated state.
Definition SurfaceStateData.hpp:95
std::vector< double > coupling_force_val
Forced coupling value.
Definition SurfaceStateData.hpp:184
std::vector< double > evap_force_val
Forced evaporation value.
Definition SurfaceStateData.hpp:181
std::vector< double > vert_head
Head reconstructed at vertices.
Definition SurfaceStateData.hpp:104
std::vector< int8_t > evap_forced
0=computed, 1=override, 2=add
Definition SurfaceStateData.hpp:179
void reset_state() noexcept
Definition SurfaceStateData.hpp:277
std::vector< double > head
Free-surface elevation η (m) [reconstructed].
Definition SurfaceStateData.hpp:94
std::vector< double > grad_hx_lim
Limited gradient X.
Definition SurfaceStateData.hpp:100
const NodeData * nodes_1d
Definition SurfaceStateData.hpp:78
std::vector< int8_t > coupling_persist
0=reset, 1=persist
Definition SurfaceStateData.hpp:183
void resize(int n_triangles, int n_vertices)
Definition SurfaceStateData.hpp:225
std::vector< double > face_vy
Cell velocity Y component (m/s)
Definition SurfaceStateData.hpp:118
std::vector< double > coupling_applied
Definition SurfaceStateData.hpp:169
std::vector< double > evap_rate
Evaporation demand rate (m/s, >= 0)
Definition SurfaceStateData.hpp:128
std::vector< double > stat_max_velocity
Max cell speed |v| = √(vx²+vy²) (m/s)
Definition SurfaceStateData.hpp:212
const BoundaryData * boundary
Definition SurfaceStateData.hpp:72
std::vector< double > old_depth
Mean depth at start of coupling interval.
Definition SurfaceStateData.hpp:204
std::vector< int8_t > rainfall_persist
0=reset, 1=persist
Definition SurfaceStateData.hpp:177
std::vector< double > old_volume
Volume at start of coupling interval (m³)
Definition SurfaceStateData.hpp:205
void update_statistics(const std::vector< double > &tri_area, double dt, int nthreads=1) noexcept
Definition SurfaceStateData.hpp:313
std::vector< double > edge_flux
Normal flux through each edge.
Definition SurfaceStateData.hpp:124
std::vector< double > infil_applied
Definition SurfaceStateData.hpp:148
Definition SurfaceTransportState.hpp:69