Polymorphic point and native-batch snow boundary. One owner serializes state mutation and buffer use. Configure compatible model geometry/materials after allocation; a successful allocation alone does not establish physical snowpack parameters. Derived methods define failure and payload validation; this interface supplies no universal rollback/status.
More...
#include <SnowModel.hpp>
|
| virtual | ~SnowModel ()=default |
| | Destroy derived owned snow state through the base interface. Caller ends all active callbacks/borrows before destruction; no implicit commit.
|
| |
| virtual void | initializeElements (int n)=0 |
| | Allocate/reset model-specific storage for point elements.
|
| |
| virtual void | step (int e, const SnowInputs &input, SnowOutputs &output)=0 |
| | Advance one model element through its SI point boundary.
|
| |
| virtual int | stateSize () const =0 |
| | Read the element payload length expected by pack/unpack.
|
| |
| virtual void | pack (int e, double *output) const =0 |
| | Copy one model's element payload into a caller buffer.
|
| |
| virtual void | unpack (int e, const double *input)=0 |
| | Restore one matching model's element payload.
|
| |
| virtual void | execute (SimulationContext &context, double dt_s, double temp_F, double wind_mph, const double *rain_ft_s, const double *snow_ft_s, double gamma, double ea)=0 |
| | Execute the native subcatchment batch boundary for legacy arithmetic/order.
|
| |
| virtual void | plowSnow (SimulationContext &context, double dt_s, const double *snow_ft_s)=0 |
| | Accumulate and redistribute native batch snowfall through derived lifecycle.
|
| |
Polymorphic point and native-batch snow boundary. One owner serializes state mutation and buffer use. Configure compatible model geometry/materials after allocation; a successful allocation alone does not establish physical snowpack parameters. Derived methods define failure and payload validation; this interface supplies no universal rollback/status.
◆ ~SnowModel()
| virtual openswmm::surface::SnowModel::~SnowModel |
( |
| ) |
|
|
virtualdefault |
Destroy derived owned snow state through the base interface. Caller ends all active callbacks/borrows before destruction; no implicit commit.
◆ execute()
| virtual void openswmm::surface::SnowModel::execute |
( |
SimulationContext & | context, |
|
|
double | dt_s, |
|
|
double | temp_F, |
|
|
double | wind_mph, |
|
|
const double * | rain_ft_s, |
|
|
const double * | snow_ft_s, |
|
|
double | gamma, |
|
|
double | ea ) |
|
pure virtual |
Execute the native subcatchment batch boundary for legacy arithmetic/order.
- Parameters
-
| [in,out] | context | Compatible model geometry/ownership as required by derived solver. |
| dt_s | Finite positive interval seconds. |
| temp_F | Held air temperature Fahrenheit. |
| wind_mph | Held wind speed mph. |
| rain_ft_s | Readable per-subcatchment rain ft/s array of initialized batch count. |
| snow_ft_s | Readable same-count snow ft/s array; accumulation/plowing sequencing is defined by the derived model, not automatically repeated here. |
| gamma | Native psychrometric coefficient F^-1. |
| ea | Native saturation vapour pressure in Hg. Caller uses the derived batch lifecycle rather than also point-stepping the same water interval. No portable external clock advancement or shared failure result. |
Implemented in openswmm::snow::DegreeDaySnow.
◆ initializeElements()
| virtual void openswmm::surface::SnowModel::initializeElements |
( |
int | n | ) |
|
|
pure virtual |
Allocate/reset model-specific storage for point elements.
- Parameters
-
| n | Nonnegative requested element count, representable by the implementation. Derived storage may round capacity up; caller then supplies model parameters. No common external clock, physical water debit or context binding is performed. |
Implemented in openswmm::snow::DegreeDaySnow.
◆ pack()
| virtual void openswmm::surface::SnowModel::pack |
( |
int | e, |
|
|
double * | output ) const |
|
pure virtual |
Copy one model's element payload into a caller buffer.
- Parameters
-
| e | Valid initialized element index. |
| [out] | output | Writable array of at least stateSize() doubles, not retained. Slot order/units are implementation-specific; geometry/global state can be omitted. Caller serializes packing with mutation; no common bounds/error check is promised. |
Implemented in openswmm::snow::DegreeDaySnow.
◆ plowSnow()
| virtual void openswmm::surface::SnowModel::plowSnow |
( |
SimulationContext & | context, |
|
|
double | dt_s, |
|
|
const double * | snow_ft_s ) |
|
pure virtual |
Accumulate and redistribute native batch snowfall through derived lifecycle.
- Parameters
-
| [in,out] | context | Compatible subcatchment geometry/units and plow destinations. |
| dt_s | Finite positive elapsed seconds. |
| snow_ft_s | Readable per-subcatchment snowfall ft/s array, qualified by caller. Derived implementation defines enabled/external ownership, removed-water and age bookkeeping. Invoke at most once before the corresponding native melt execution; this interface itself does not validate or settle an external receiver. |
Implemented in openswmm::snow::DegreeDaySnow.
◆ stateSize()
| virtual int openswmm::surface::SnowModel::stateSize |
( |
| ) |
const |
|
pure virtual |
Read the element payload length expected by pack/unpack.
- Returns
- Number of double slots for this implementation, not a portable versioned restart schema. Use matching model/configuration and its documented native units.
Implemented in openswmm::snow::DegreeDaySnow.
◆ step()
| virtual void openswmm::surface::SnowModel::step |
( |
int | e, |
|
|
const SnowInputs & | input, |
|
|
SnowOutputs & | output ) |
|
pure virtual |
Advance one model element through its SI point boundary.
- Parameters
-
| e | Valid initialized element index with compatible parameters/history. |
| input | Borrowed finite interval weather in SnowInputs units; positive dt_s. |
| [out] | output | Element interval depths/state; derived class defines available fields and invalid-input behavior. Must not alias input or mutable model storage. Point stepping does not imply native inter-subcatchment plowing; caller must use the derived model's specified accumulation/plowing lifecycle exactly once. |
Implemented in openswmm::snow::DegreeDaySnow.
◆ unpack()
| virtual void openswmm::surface::SnowModel::unpack |
( |
int | e, |
|
|
const double * | input ) |
|
pure virtual |
Restore one matching model's element payload.
- Parameters
-
| e | Valid initialized element index with matching model/configuration. |
| input | Readable stateSize()-double buffer in the implementation's slot order/ units, borrowed during this call. Caller validates shape/finite physical values. No common schema migration, rollback or clock/geometry restoration is implied. |
Implemented in openswmm::snow::DegreeDaySnow.
The documentation for this class was generated from the following file:
- /home/runner/work/openswmm.engine/openswmm.engine/src/engine/hydrology/surface/SnowModel.hpp