OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
openswmm::twoD::Infil2D Class Reference

Owns per-cell infiltration parameters, kernel state and held rates. More...

#include <Infil2D.hpp>

Collaboration diagram for openswmm::twoD::Infil2D:

Public Member Functions

std::vector< Infil2DDefault > & defaults () noexcept
 
const std::vector< Infil2DDefault > & defaults () const noexcept
 
std::vector< Infil2DOverride > & overrides () noexcept
 
const std::vector< Infil2DOverride > & overrides () const noexcept
 
Infil2DOptionsoptions () noexcept
 
const Infil2DOptionsoptions () const noexcept
 
bool resolve (const MeshData &mesh, const SimulationOptions &opts, std::string &err)
 Resolve tag/override precedence into flat per-cell state.
 
void setAquifer2DAvailable (bool on) noexcept
 G1 — tell validation that a [2D_AQUIFER] resolved, so the AQUIFER_2D destination has somewhere to send its water.
 
bool aquifer2DAvailable () const noexcept
 
void updateRates (const MeshData &mesh, SurfaceStateData &state, double dt)
 Recompute and publish per-cell infiltration rates (D-I1).
 
bool active () const noexcept
 True when at least one cell resolved to a model.
 
void deactivate () noexcept
 
const std::vector< Infil2DRow > & resolvedRows () const noexcept
 Resolved method per triangle; has_method == false entries are NONE.
 
const std::vector< Infil2DProvenance > & provenance () const noexcept
 Provenance per triangle (D-I3, for the writer).
 
const std::vector< double > & cumulative () const noexcept
 
double stepSeconds () const noexcept
 
void reset ()
 Clear everything back to the unconfigured fast path.
 

Detailed Description

Owns per-cell infiltration parameters, kernel state and held rates.

Lifecycle:

  1. Parsers fill defaults(), overrides(), options().
  2. SurfaceRouter2D::initialize() calls resolve() once the mesh (and therefore MeshData::tri_tag) is available.
  3. SurfaceRouter2D calls updateRates() every INFIL_STEP.
  4. The marcher consumes SurfaceStateData::infil_rate only.

Empty/unconfigured is the fast path: active() is false and no array is allocated, so a project with no [2D_INFILTRATION*] sections is bitwise identical to the pre-track-I engine (gate I7).

Member Function Documentation

◆ active()

bool openswmm::twoD::Infil2D::active ( ) const
inlinenoexcept

True when at least one cell resolved to a model.

◆ aquifer2DAvailable()

bool openswmm::twoD::Infil2D::aquifer2DAvailable ( ) const
inlinenoexcept

◆ cumulative()

const std::vector< double > & openswmm::twoD::Infil2D::cumulative ( ) const
inlinenoexcept

Cumulative infiltration CAPACITY per triangle (m): the integral of the published rate, without the solver's depth ramp. On a drying cell this exceeds the water actually removed, so it is NOT ledger-consistent with MassBalance2D::infil_out. SurfaceRouter2D::infilCumulative() is the ledger-consistent series and is what the sidecar's infil_cum and the C API's *_get_cum_bulk report; this one is retained as the kernel-side diagnostic.

◆ deactivate()

void openswmm::twoD::Infil2D::deactivate ( )
inlinenoexcept

E2: [2D_OPTIONS] INFILTRATION NO — keep the rows (they still save) but run without infiltration. Called after resolve().

◆ defaults() [1/2]

const std::vector< Infil2DDefault > & openswmm::twoD::Infil2D::defaults ( ) const
inlinenoexcept

◆ defaults() [2/2]

std::vector< Infil2DDefault > & openswmm::twoD::Infil2D::defaults ( )
inlinenoexcept
Here is the caller graph for this function:

◆ options() [1/2]

const Infil2DOptions & openswmm::twoD::Infil2D::options ( ) const
inlinenoexcept

◆ options() [2/2]

Infil2DOptions & openswmm::twoD::Infil2D::options ( )
inlinenoexcept
Here is the caller graph for this function:

◆ overrides() [1/2]

const std::vector< Infil2DOverride > & openswmm::twoD::Infil2D::overrides ( ) const
inlinenoexcept

◆ overrides() [2/2]

std::vector< Infil2DOverride > & openswmm::twoD::Infil2D::overrides ( )
inlinenoexcept
Here is the caller graph for this function:

◆ provenance()

const std::vector< Infil2DProvenance > & openswmm::twoD::Infil2D::provenance ( ) const
inlinenoexcept

Provenance per triangle (D-I3, for the writer).

◆ reset()

void openswmm::twoD::Infil2D::reset ( )

Clear everything back to the unconfigured fast path.

◆ resolve()

bool openswmm::twoD::Infil2D::resolve ( const MeshData & mesh,
const SimulationOptions & opts,
std::string & err )

Resolve tag/override precedence into flat per-cell state.

D-I3 precedence: override > tag > '' > none. Initializes the hydrology kernel state for every cell that resolved to a model, converting project-unit parameters through `infil::_init`.

Parameters
meshMesh (uses tri_tag and n_triangles()).
optsSimulation options (unit system for the *_init conversions).
err[out] Human-readable message when the return is false.
Returns
False on a validation failure (unsupported destination, out-of-range triangle index, unknown method, bad parameters).
Here is the call graph for this function:

◆ resolvedRows()

const std::vector< Infil2DRow > & openswmm::twoD::Infil2D::resolvedRows ( ) const
inlinenoexcept

Resolved method per triangle; has_method == false entries are NONE.

◆ setAquifer2DAvailable()

void openswmm::twoD::Infil2D::setAquifer2DAvailable ( bool on)
inlinenoexcept

G1 — tell validation that a [2D_AQUIFER] resolved, so the AQUIFER_2D destination has somewhere to send its water.

Must be called before resolve(). Without it AQUIFER_2D is refused, which is the right answer when there is no aquifer: silently treating it as LOST would drain a model the user believed was recharging.

◆ stepSeconds()

double openswmm::twoD::Infil2D::stepSeconds ( ) const
inlinenoexcept

Resolved cadence in seconds (options_.infil_step, or the project WET_STEP when that was <= 0). Set by resolve().

◆ updateRates()

void openswmm::twoD::Infil2D::updateRates ( const MeshData & mesh,
SurfaceStateData & state,
double dt )

Recompute and publish per-cell infiltration rates (D-I1).

Called on the INFIL_STEP cadence. Advances kernel state for EVERY model-carrying cell, including cells the marcher has deactivated — otherwise a dry cell presents full initial capacity when rain finally arrives (§5.5.2).

Writes state.infil_rate[i] in m/s, >= 0. Conversion: precip/depth SI→ft on the way in, rate ft/s→SI on the way out.

Parameters
meshMesh (unused today; kept for symmetry and future area use).
stateSurface state — reads rainfall/depth, writes infil_rate.
dtElapsed seconds since the previous call (the INFIL_STEP).
Here is the call graph for this function:

The documentation for this class was generated from the following files: