71#ifndef OPENSWMM_ENGINE_2D_SUBSURFACE_SOLVER_HPP
72#define OPENSWMM_ENGINE_2D_SUBSURFACE_SOLVER_HPP
91using openswmm::NodeData;
123 std::vector<std::string>& warnings);
125 bool active() const noexcept {
return state_.active; }
157 return tier >= 0 && tier < static_cast<int>(cells_by_tier_.size()) &&
158 !cells_by_tier_[
static_cast<std::size_t
>(tier)].empty();
161 return tier >= 0 && tier < static_cast<int>(faces_by_tier_.size()) &&
162 !faces_by_tier_[
static_cast<std::size_t
>(tier)].empty();
165 return static_cast<int>(cells_by_tier_.size());
168 const std::vector<long>&
tierFirings() const noexcept {
return tier_firings_; }
184 return pending_surface_;
201 return node_exchange_vol_;
207 double storage() const noexcept {
return state_.storage(); }
212 void resolveClosures(std::vector<std::string>& warnings);
217 double gatherLateral(
int i)
noexcept;
219 double gatherNode(
int i)
noexcept;
220 void markPendingSurface(
int i)
noexcept;
224 std::vector<GwNodeBed> node_beds_;
230 std::vector<std::vector<int>> cells_by_tier_;
231 std::vector<std::vector<int>> faces_by_tier_;
232 std::vector<uint8_t> face_tier_;
233 std::vector<long> tier_firings_;
234 std::vector<int> pending_surface_;
235 std::vector<uint8_t> pending_flag_;
236 std::vector<int> cell_nface_;
237 std::vector<double> node_exchange_vol_;
238 bool accumulators_pending_ =
false;
242 std::vector<int> subcatch_outlet_node_;
245 std::vector<int> cell_subcatch_;
G-steps 4 and 5 — closure B: the σ-coordinate explicit unsaturated column with a moving lower boundar...
G-step 1 — state, parameters and options for the two-zone groundwater kernel (TWO_ZONE_GROUNDWATER_EX...
The two-zone kernel. Owned by SurfaceRouter2D; driven by the marcher's tier hooks.
Definition SubsurfaceSolver.hpp:97
void refreshDtCell(const MeshData &mesh, const InertialEdges &edges)
Definition SubsurfaceSolver.cpp:306
void fireGwCells(int tier, double dt, SurfaceStateData &surf)
Gather + closure + node/deep/ET/Dunne for the cells of one tier.
Definition SubsurfaceSolver.cpp:883
bool tierHasCells(int tier) const noexcept
True when the tier's cell list is non-empty.
Definition SubsurfaceSolver.hpp:156
SubsurfaceState & state() noexcept
Definition SubsurfaceSolver.hpp:126
const std::vector< int > & pendingSurfaceCells() const noexcept
Definition SubsurfaceSolver.hpp:183
const std::vector< long > & tierFirings() const noexcept
Per-tier firing counts — the G-A telemetry (swmm_gw2d_get_tier_histogram).
Definition SubsurfaceSolver.hpp:168
double takeToSurface(int cell) noexcept
Definition SubsurfaceSolver.cpp:581
int tierCount() const noexcept
Definition SubsurfaceSolver.hpp:164
const std::vector< double > & nodeExchangeVolumes() const noexcept
Definition SubsurfaceSolver.hpp:200
const SubsurfaceState & state() const noexcept
Definition SubsurfaceSolver.hpp:127
double storage() const noexcept
Storage now, for the continuity ledger.
Definition SubsurfaceSolver.hpp:207
void assignTiers(double dt0, int n_tiers)
Definition SubsurfaceSolver.cpp:396
bool tierHasFaces(int tier) const noexcept
Definition SubsurfaceSolver.hpp:160
void fireGwFaces(int tier, double dt)
Lateral Darcy on the faces of one tier; books ±ΔV into eacc_L/R.
Definition SubsurfaceSolver.cpp:442
void compactPending() noexcept
Definition SubsurfaceSolver.cpp:595
void settle(SurfaceStateData &surf)
Definition SubsurfaceSolver.cpp:891
const GwOptions & options() const noexcept
Definition SubsurfaceSolver.hpp:128
bool active() const noexcept
Definition SubsurfaceSolver.hpp:125
int requiredTiers(double dt0) const noexcept
Definition SubsurfaceSolver.cpp:385
std::string initialize(const MeshData &mesh, const InertialEdges &edges, const SolverOptions2D &opts, const GwUnitFactors &uf, int n_nodes, SubsurfaceConfig &cfg, std::vector< std::string > &warnings)
Resolve the authored rows onto cells, seed state, size the accumulators.
Definition SubsurfaceSolver.cpp:207
void resetNodeExchangeVolumes() noexcept
Zero the per-node ledger at the start of a routing batch.
Definition SubsurfaceSolver.cpp:508
void bookInfiltrationFromSurface(int cell, double vol_m3) noexcept
Definition SubsurfaceSolver.cpp:567
void sampleNodeExchange(const NodeData *nodes, double dt)
Definition SubsurfaceSolver.cpp:512
Definition NodeCoupling.cpp:16
Definition NodeCoupling.cpp:16
Structure-of-Arrays storage for all nodes.
Definition NodeData.hpp:130
[2D_AQUIFER_OPTIONS]. Defaults are the plan's starred values.
Definition SubsurfaceData.hpp:87
Project-unit → SI multipliers for the four kinds of aquifer number.
Definition SubsurfaceData.hpp:226
Canonical unique interior-edge layout + per-cell incidence for the local-inertial scheme.
Definition InertialEdges.hpp:61
SoA storage for 2D mixed triangle/quad mesh geometry and topology.
Definition MeshData.hpp:67
Configuration for the 2D surface routing solver.
Definition SolverOptions2D.hpp:208
Everything the parser fills, before resolution onto cells.
Definition SubsurfaceData.hpp:234
Per-cell resolved parameters and state (SoA).
Definition SubsurfaceData.hpp:146
Definition SurfaceStateData.hpp:59
Definition SoilCharacteristic.hpp:90