32#ifndef OPENSWMM_ENGINE_2D_SURFACE_STATE_DATA_HPP
33#define OPENSWMM_ENGINE_2D_SURFACE_STATE_DATA_HPP
175 (
snow.owns(i) ?
snow.exposedFractions()[i] : 1.);
306 void resize(
int n_triangles,
int n_vertices) {
311 auto nt =
static_cast<std::size_t
>(n_triangles);
312 auto nv =
static_cast<std::size_t
>(n_vertices);
315 depth.assign(nt, 0.0);
316 head.assign(nt, 0.0);
441 [[maybe_unused]]
int nthreads = 1) noexcept {
445 const int n =
static_cast<int>(
depth.size());
446#if defined(SWMM_USE_OPENMP)
447#pragma omp parallel for schedule(static) num_threads(nthreads)
449 for (
int i = 0; i < n; ++i) {
454 if (std::isfinite(speed) &&
Structure-of-Arrays (SoA) storage for 2D triangular mesh geometry.
Mesh thermal state, including bed energy retained through surface drying.
Snow state and advancement for mesh cells.
Runtime coupling state and canonical transport exchange quantities.
Overland transport S1 — per-cell species MASS on the 2D surface.
Owned mixed degree-day/UEB snow on remaining mesh weather footprints. Geometry area is horizontal m2;...
Definition MeshSnow.hpp:54
Definition ExchangeLaw.hpp:60
constexpr int kMaxCellVerts
Definition MeshData.hpp:49
Definition ExchangeLaw.hpp:60
Structure-of-Arrays storage for all nodes.
Definition NodeData.hpp:125
Central, reentrant simulation context.
Definition SimulationContext.hpp:390
SoA storage for per-edge boundary conditions.
Definition BoundaryData.hpp:73
Descriptor for a single coupling point between 2D and 1D.
Definition NodeCoupling.hpp:59
Definition MeshHeat.hpp:27
Definition RuntimeCoupling.hpp:226
Definition RuntimeCoupling.hpp:44
Definition SurfaceStateData.hpp:64
std::vector< double > rk2_rain_pending
Definition SurfaceStateData.hpp:288
std::vector< double > grad_hy_lim
Limited gradient Y.
Definition SurfaceStateData.hpp:121
std::vector< double > infil_rate
Definition SurfaceStateData.hpp:187
std::vector< double > grad_hy
∂h/∂y (unlimited gradient)
Definition SurfaceStateData.hpp:119
void save_state() noexcept
Save the current depth and conserved-volume arrays for local rollback.
Definition SurfaceStateData.hpp:372
std::vector< int8_t > coupling_forced
0=computed, 1=override, 2=add
Definition SurfaceStateData.hpp:244
std::vector< double > coupling_flux
Exchange with SWMM node (m/s, + = into 2D)
Definition SurfaceStateData.hpp:200
bool forcing_ever_set
Definition SurfaceStateData.hpp:264
std::vector< double > vert_depth_signed
Definition SurfaceStateData.hpp:134
MeshHeatState heat
Definition SurfaceStateData.hpp:111
std::vector< int8_t > rainfall_forced
0=computed, 1=override, 2=add
Definition SurfaceStateData.hpp:238
RuntimeSources runtime_sources
Definition SurfaceStateData.hpp:254
double evap_loss_total
Definition SurfaceStateData.hpp:285
std::vector< double > stat_max_depth
Maximum depth ψ_o seen at each cell (m)
Definition SurfaceStateData.hpp:277
std::vector< double > cell_continuity_err
Definition SurfaceStateData.hpp:142
std::vector< double > net_source
Net source/sink per cell (m/s)
Definition SurfaceStateData.hpp:232
SurfaceTransportState transport
Definition SurfaceStateData.hpp:110
SimulationContext * snow_context
Definition SurfaceStateData.hpp:151
std::vector< double > rainfall_force_val
Forced rainfall value.
Definition SurfaceStateData.hpp:240
std::vector< double > stat_max_cont_err
Max |cell_continuity_err| (m³/s)
Definition SurfaceStateData.hpp:279
std::vector< double > stat_cum_volume
Cumulative volume through cell (m³)
Definition SurfaceStateData.hpp:280
std::vector< int8_t > evap_persist
0=reset, 1=persist
Definition SurfaceStateData.hpp:242
void clear_reset_forcings() noexcept
Clear RESET forcings after each step.
Definition SurfaceStateData.hpp:399
bool forcing_dirty
Definition SurfaceStateData.hpp:257
const std::vector< double > * node_row_conc
Definition SurfaceStateData.hpp:88
std::vector< double > depth
Mean wetted depth h̄ = V/A_wet (m) [reconstructed].
Definition SurfaceStateData.hpp:113
std::vector< double > boundary_requested
signed cumulative request pending receipt drain
Definition SurfaceStateData.hpp:228
std::vector< double > face_vx
Cell velocity X component (m/s)
Definition SurfaceStateData.hpp:138
std::vector< double > grad_hx
∂h/∂x (unlimited gradient)
Definition SurfaceStateData.hpp:118
const std::vector< CouplingPoint > * node_coupling
Definition SurfaceStateData.hpp:89
const std::vector< int > * coupling_head_cells
Definition SurfaceStateData.hpp:98
std::vector< double > rainfall
Raw precipitation intensity (m/s)
Definition SurfaceStateData.hpp:177
std::vector< double > volume
Cell water volume V (m³) — the integrated state.
Definition SurfaceStateData.hpp:115
double exposedEvaporation(int i) const
Resolve atmospheric evaporation demand over the snow-exposed surface.
Definition SurfaceStateData.hpp:173
std::vector< double > coupling_force_val
Forced coupling value.
Definition SurfaceStateData.hpp:246
std::vector< double > evap_force_val
Forced evaporation value.
Definition SurfaceStateData.hpp:243
std::vector< double > vert_head
Head reconstructed at vertices.
Definition SurfaceStateData.hpp:124
std::vector< int8_t > evap_forced
0=computed, 1=override, 2=add
Definition SurfaceStateData.hpp:241
std::vector< double > snow_catch
Definition SurfaceStateData.hpp:152
void reset_state() noexcept
Restore only the saved depth and conserved-volume arrays.
Definition SurfaceStateData.hpp:384
std::vector< double > boundary_out_applied
Definition SurfaceStateData.hpp:227
std::vector< int > boundary_receipt_slots
padded edge slot for each transfer entry
Definition SurfaceStateData.hpp:225
std::vector< double > head
Free-surface elevation η (m) [reconstructed].
Definition SurfaceStateData.hpp:114
std::vector< double > grad_hx_lim
Limited gradient X.
Definition SurfaceStateData.hpp:120
const NodeData * nodes_1d
Definition SurfaceStateData.hpp:83
std::vector< int8_t > coupling_persist
0=reset, 1=persist
Definition SurfaceStateData.hpp:245
void resize(int n_triangles, int n_vertices)
Reset main surface hydraulic arrays to a new mixed-cell/vertex extent.
Definition SurfaceStateData.hpp:306
surface::MeshSnow snow
Definition SurfaceStateData.hpp:150
std::vector< double > boundary_last_flow
last applied substep flow (m³/s)
Definition SurfaceStateData.hpp:229
std::vector< double > face_vy
Cell velocity Y component (m/s)
Definition SurfaceStateData.hpp:139
std::vector< double > coupling_applied
Definition SurfaceStateData.hpp:219
std::vector< double > evap_rate
Evaporation demand rate (m/s, >= 0)
Definition SurfaceStateData.hpp:178
std::vector< double > stat_max_velocity
Max cell speed |v| = √(vx²+vy²) (m/s)
Definition SurfaceStateData.hpp:278
const BoundaryData * boundary
Definition SurfaceStateData.hpp:77
std::vector< double > old_depth
Mean depth at start of coupling interval.
Definition SurfaceStateData.hpp:270
std::vector< int8_t > rainfall_persist
0=reset, 1=persist
Definition SurfaceStateData.hpp:239
RuntimeForcings runtime_forcings
Definition SurfaceStateData.hpp:255
std::vector< double > old_volume
Volume at start of coupling interval (m³)
Definition SurfaceStateData.hpp:271
const std::vector< double > * node_pond_area_m2
Definition SurfaceStateData.hpp:102
const std::vector< double > * node_pond_base
Definition SurfaceStateData.hpp:95
void update_statistics(const std::vector< double > &tri_area, double dt, int nthreads=1) noexcept
Update cumulative statistics / rendering envelopes.
Definition SurfaceStateData.hpp:440
std::vector< double > boundary_in_applied
Definition SurfaceStateData.hpp:226
std::vector< double > coupling_native
Definition SurfaceStateData.hpp:256
std::vector< double > edge_flux
Normal flux through each edge.
Definition SurfaceStateData.hpp:145
std::vector< double > boundary_last_dt
last boundary substep duration (s)
Definition SurfaceStateData.hpp:230
double liquidRainfall(int i) const
Resolve the liquid-water precipitation source for one cell.
Definition SurfaceStateData.hpp:162
std::vector< double > infil_applied
Definition SurfaceStateData.hpp:198
double coupling_window_s
Definition SurfaceStateData.hpp:103
Definition SurfaceTransportState.hpp:70