|
hydrobricks
|
#include <ProcessRoutingDelay.h>
Public Member Functions | |
| ProcessRoutingDelay (WaterContainer *container) | |
| bool | IsValid () const override |
| void | SetParameters (const ProcessSettings &processSettings) override |
| void | Reset () override |
| void | Finalize () override |
| const vecDouble & | GetChangeRates () override |
| double * | GetValuePointer (std::string_view name) override |
Public Member Functions inherited from ProcessOutflow | |
| ProcessOutflow (WaterContainer *container) | |
| int | GetConnectionCount () const override |
Public Member Functions inherited from Process | |
| Process (WaterContainer *container) | |
| virtual void | Validate () const |
| const float * | GetParameterValuePointer (const ProcessSettings &processSettings, std::string_view name) |
| void | SetParentContext (HydroUnit *unit, Brick *brick) |
| virtual void | SetHydroUnitProperties (HydroUnit *unit, Brick *brick) |
| virtual void | AttachForcing (Forcing *) |
| void | AttachFluxOut (std::unique_ptr< Flux > flux) |
| int | GetOutputFluxCount () const |
| Flux * | GetOutputFlux (size_t index) const |
| virtual bool | ToAtmosphere () const |
| virtual bool | RequiresDailyTimeStep () const |
| virtual bool | NeedsTargetBrickLinking () const |
| virtual bool | NeedsGateBrickLinking () const |
| virtual bool | HasConstraintPriority () const |
| virtual void | StoreInOutgoingFlux (double *rate, int index) |
| void | ApplyChange (int connectionIndex, double rate, double timeStepInDays) |
| virtual vecDoublePt | GetStateVariables () |
| const string & | GetName () const |
| void | SetName (const string &name) |
| void | SetTimeMachine (TimeMachine *timeMachine) |
| WaterContainer * | GetWaterContainer () const |
| virtual void | SetTargetBrick (Brick *) |
| virtual void | AddGateBrick (Brick *) |
| virtual bool | LinksMultipleTargets () const |
| virtual void | AddTargetBrickWithWeights (Brick *, const std::vector< Brick * > &) |
| virtual bool | IsLateralProcess () const noexcept |
| virtual bool | HasLinearResponse () const |
| virtual double | GetLinearResponseRate () const |
| virtual double | GetLinearResponseOffset () const |
| bool | HasOutputFluxes () const noexcept |
| bool | HasWaterContainer () const noexcept |
Static Public Member Functions | |
| static void | RegisterProcessSettings (SettingsModel *modelSettings) |
Static Public Member Functions inherited from ProcessOutflow | |
| static void | RegisterProcessSettings (SettingsModel *modelSettings) |
Static Public Member Functions inherited from Process | |
| static std::unique_ptr< Process > | Factory (const ProcessSettings &processSettings, Brick *brick) |
| static bool | RegisterSettings (SettingsModel *modelSettings, const string &processType) |
| static bool | HasParameter (const ProcessSettings &processSettings, std::string_view name) |
Protected Member Functions | |
| const vecDouble & | GetRates () override |
| void | _recomputeOrdinates () |
Protected Member Functions inherited from Process | |
| double | GetForcingRate (Forcing *forcing) const |
| double | GetTimeStepInDays () const |
| int | GetCurrentDayOfYear () const |
| const vecDouble & | StoreRates (std::initializer_list< double > rates) |
| double | GetSumChangeRatesOtherProcesses () const |
Protected Attributes | |
| const float * | _delay |
| vecDouble | _schedule |
| vecDouble | _ordinates |
| double | _lastDelay |
| double | _lastTimeStep |
| double | _previousContent |
| double | _processStorage |
Protected Attributes inherited from Process | |
| string | _name |
| WaterContainer * | _container |
| TimeMachine * | _timeMachine {nullptr} |
| HydroUnit * | _hydroUnit {nullptr} |
| string | _parentBrickName |
| std::vector< std::unique_ptr< Flux > > | _outputs |
| vecDouble | _changeRates |
Pure translation: the inflow of the routing brick leaves it unchanged in shape, a fixed duration later (the translation element of PREVAH's glacier reservoirs).
The delay [d] is a duration whatever the time step. On the grid of time steps it is d = delay / timestep steps; the water received during a step is a block one step long, and shifting that block by d steps lands a share (1 - f) of it in step floor(d) and f in the next one, f being the fractional part of d. A delay that is a whole number of steps is therefore an exact shift, and a delay shorter than a step (a one-hour translation on a daily step) spreads a matching share onto the next step instead of being dropped. A zero delay behaves exactly like a pass-through.
GetRates() is read-only: it returns what is scheduled for this step plus the same-step share of the water arriving now, read as it enters during the solve (the upstream rates and this step's forcing and instantaneous amounts), so a zero delay makes the brick transparent. Finalize() measures the water that actually arrived, schedules the rest of it, and carries any undelivered amount over so no water is stranded in the brick.
|
protected |
Recompute the ordinates and resize the schedule for the current delay and step.
|
overridevirtual |
Advance the delivery schedule once per time step, using the committed amounts.
Reimplemented from Process.
|
inlinenodiscardoverridevirtual |
Get the change rates of the process.
The returned reference points to a reusable per-process buffer that is overwritten on the next call; consume it before calling again.
Bypasses the empty-container shortcut of the base class, as routing:hbv does: the scheduled delivery usually drains the whole content within the step.
Reimplemented from Process.
|
overrideprotectedvirtual |
Get the rates of the process.
Implementations must store their result via StoreRates() (or directly in the _changeRates buffer) and return the reference, to avoid allocating on the hot path.
Read-only: the delivery due this step, from the current schedule.
Implements Process.
|
overridevirtual |
Get the value pointer for a given element.
| name | name of the element to get. |
Reimplemented from ProcessOutflow.
|
nodiscardoverridevirtual |
Check that everything is correctly defined.
Reimplemented from ProcessOutflow.
|
static |
Register the process settings (parameters and logging defaults) in the settings model.
| modelSettings | The settings model to register the parameters in. |
|
overridevirtual |
Reset all the fluxes connected to the process.
Reimplemented from Process.
|
overridevirtual |
Assign the parameters to the process.
| processSettings | settings of the process containing the parameters. |
Reimplemented from Process.