hydrobricks
Loading...
Searching...
No Matches
Process Class Referenceabstract
Inheritance diagram for Process:
ProcessET ProcessInfiltration ProcessLateral ProcessMelt ProcessOutflow ProcessTransform ProcessETGR4J ProcessETSocont ProcessInterceptionGR4J ProcessInfiltrationGR4J ProcessInfiltrationSocont ProcessLateralSnowSlide ProcessMeltCemaNeige ProcessMeltDegreeDay ProcessMeltDegreeDayAspect ProcessMeltTemperatureIndex ProcessOutflowDirect ProcessOutflowLinear ProcessOutflowOverflow ProcessOutflowRest ProcessPercolationConstant ProcessPercolationGR4J ProcessProductionGR4J ProcessRoutingGR4J ProcessRoutingGR6J ProcessRunoffSocont ProcessTransformSnowToIceConstant ProcessTransformSnowToIceSwat

Public Member Functions

 Process (WaterContainer *container)
 
virtual void Reset ()
 
virtual bool IsValid () const =0
 
virtual void Validate () const
 
virtual void SetHydroUnitProperties (HydroUnit *unit, Brick *brick)
 
virtual void SetParameters (const ProcessSettings &processSettings)
 
virtual void AttachForcing (Forcing *)
 
void AttachFluxOut (std::unique_ptr< Flux > flux)
 
int GetOutputFluxCount () const
 
FluxGetOutputFlux (size_t index) const
 
virtual bool ToAtmosphere () const
 
virtual bool NeedsTargetBrickLinking () const
 
virtual int GetConnectionCount () const =0
 
virtual vecDouble GetChangeRates ()
 
virtual void StoreInOutgoingFlux (double *rate, int index)
 
void ApplyChange (int connectionIndex, double rate, double timeStepInDays)
 
virtual void Finalize ()
 
virtual vecDoublePt GetStateVariables ()
 
virtual double * GetValuePointer (std::string_view name)
 
const string & GetName () const
 
void SetName (const string &name)
 
void SetTimeMachine (TimeMachine *timeMachine)
 
WaterContainerGetWaterContainer () const
 
virtual void SetTargetBrick (Brick *)
 
virtual bool IsLateralProcess () const noexcept
 
bool HasOutputFluxes () const noexcept
 
bool HasWaterContainer () const noexcept
 

Static Public Member Functions

static std::unique_ptr< ProcessFactory (const ProcessSettings &processSettings, Brick *brick)
 
static bool RegisterSettings (SettingsModel *modelSettings, const string &processType)
 
static bool HasParameter (const ProcessSettings &processSettings, std::string_view name)
 
static const float * GetParameterValuePointer (const ProcessSettings &processSettings, std::string_view name)
 

Protected Member Functions

double GetSumChangeRatesOtherProcesses () const
 
virtual vecDouble GetRates ()=0
 

Protected Attributes

string _name
 
WaterContainer_container
 
TimeMachine_timeMachine {nullptr}
 
std::vector< std::unique_ptr< Flux > > _outputs
 

Member Function Documentation

◆ ApplyChange()

void Process::ApplyChange ( int connectionIndex,
double rate,
double timeStepInDays )

Apply the change rates to the process.

Parameters
connectionIndexindex of the connection.
ratechange rates.
timeStepInDaystime step in days.

◆ AttachFluxOut()

void Process::AttachFluxOut ( std::unique_ptr< Flux > flux)
inline

Attach outgoing flux.

Parameters
fluxoutgoing flux (ownership transferred)

◆ AttachForcing()

virtual void Process::AttachForcing ( Forcing * )
inlinevirtual

◆ Factory()

std::unique_ptr< Process > Process::Factory ( const ProcessSettings & processSettings,
Brick * brick )
static

Factory method to create a process.

Parameters
processSettingssettings of the process.
brickthe related brick.
Returns
the created process.

◆ Finalize()

virtual void Process::Finalize ( )
inlinevirtual

Finalize the process.

Reimplemented in ProcessRoutingGR4J, and ProcessRoutingGR6J.

◆ GetChangeRates()

vecDouble Process::GetChangeRates ( )
nodiscardvirtual

Get the change rates of the process.

Returns
vector of change rates.

Reimplemented in ProcessRoutingGR6J.

◆ GetConnectionCount()

virtual int Process::GetConnectionCount ( ) const
nodiscardpure virtual

Get the number of connections to the process.

Returns
number of connections to the process.

Implemented in ProcessET, ProcessInfiltration, ProcessLateral, ProcessMelt, ProcessOutflow, and ProcessTransform.

◆ GetName()

const string & Process::GetName ( ) const
inline

Get the name of the process.

Returns
name of the process.

◆ GetOutputFlux()

Flux * Process::GetOutputFlux ( size_t index) const
inline

Get an outgoing flux by its index.

Parameters
indexindex of the flux.
Returns
pointer to the flux.

◆ GetOutputFluxCount()

int Process::GetOutputFluxCount ( ) const
inline

Get the number of outgoing fluxes.

Returns
number of outgoing fluxes.

◆ GetParameterValuePointer()

const float * Process::GetParameterValuePointer ( const ProcessSettings & processSettings,
std::string_view name )
static

Get the value pointer of a parameter.

Parameters
processSettingssettings of the process containing the parameters.
namename of the parameter to get.
Returns
pointer to the value of the parameter.

◆ GetRates()

◆ GetStateVariables()

virtual vecDoublePt Process::GetStateVariables ( )
inlinevirtual

Get pointers to the state variables.

Returns
vector of pointers to the state variables.

◆ GetSumChangeRatesOtherProcesses()

double Process::GetSumChangeRatesOtherProcesses ( ) const
nodiscardprotected

Get the sum of change rates from other processes.

Returns
sum of change rates from other processes.

◆ GetValuePointer()

double * Process::GetValuePointer ( std::string_view name)
nodiscardvirtual

Get the value pointer for a given element.

Parameters
namename of the element to get.
Returns
pointer to the value of the given element.

Reimplemented in ProcessET, ProcessInfiltration, ProcessLateral, ProcessMelt, ProcessOutflow, ProcessRoutingGR4J, ProcessRoutingGR6J, and ProcessTransform.

◆ GetWaterContainer()

WaterContainer * Process::GetWaterContainer ( ) const
inline

Get the water container associated with the process.

Returns
pointer to the water container.

◆ HasOutputFluxes()

bool Process::HasOutputFluxes ( ) const
inlinenodiscardnoexcept

Check if the process has any output fluxes.

Returns
true if the process has at least one output flux.

◆ HasParameter()

bool Process::HasParameter ( const ProcessSettings & processSettings,
std::string_view name )
staticnodiscard

Check if the process has a parameter with the provided name.

Parameters
processSettingssettings of the process containing the parameters.
namename of the parameter to check.
Returns
true if the process has a parameter with the provided name.

◆ HasWaterContainer()

bool Process::HasWaterContainer ( ) const
inlinenodiscardnoexcept

Check if the process has a water container.

Returns
true if the process has a water container.

◆ IsLateralProcess()

virtual bool Process::IsLateralProcess ( ) const
inlinenodiscardvirtualnoexcept

Check if the process is a lateral process.

Returns
true if the process is a lateral process.

Reimplemented in ProcessLateral, and ProcessLateralSnowSlide.

◆ IsValid()

virtual bool Process::IsValid ( ) const
nodiscardpure virtual

◆ NeedsTargetBrickLinking()

virtual bool Process::NeedsTargetBrickLinking ( ) const
inlinenodiscardvirtual

Check if the process needs to link the target brick.

Returns
true if the process needs to link the target brick.

Reimplemented in ProcessInfiltration.

◆ RegisterSettings()

bool Process::RegisterSettings ( SettingsModel * modelSettings,
const string & processType )
staticnodiscard

Register the parameters and the needed forcing for the process.

Parameters
modelSettingssettings of the model.
processTypetype of process.
Returns
true if everything is correctly defined.

◆ Reset()

void Process::Reset ( )
virtual

Reset all the fluxes connected to the process.

Reimplemented in ProcessMeltCemaNeige, ProcessRoutingGR4J, and ProcessRoutingGR6J.

◆ SetHydroUnitProperties()

void Process::SetHydroUnitProperties ( HydroUnit * unit,
Brick * brick )
virtual

Set the properties of the hydro unit.

Parameters
unitthe related hydro unit.
brickthe related brick.

Reimplemented in ProcessLateralSnowSlide, ProcessMeltDegreeDayAspect, and ProcessRunoffSocont.

◆ SetName()

void Process::SetName ( const string & name)
inline

Set the name of the process.

Parameters
namename of the process.

◆ SetParameters()

void Process::SetParameters ( const ProcessSettings & processSettings)
virtual

◆ SetTargetBrick()

virtual void Process::SetTargetBrick ( Brick * )
inlinevirtual

Set the target brick for the process.

Parameters
bricktarget brick.

Reimplemented in ProcessInfiltration.

◆ SetTimeMachine()

void Process::SetTimeMachine ( TimeMachine * timeMachine)
inline

Set the time machine (non-owning reference). Required by processes that depend on the current simulation date.

Parameters
timeMachinepointer to the time machine.

◆ StoreInOutgoingFlux()

void Process::StoreInOutgoingFlux ( double * rate,
int index )
virtual

Store the water corresponding to the change rates in the outgoing fluxes.

Parameters
ratechange rates.
indexindex of the flux.

Reimplemented in ProcessOutflowOverflow.

◆ ToAtmosphere()

virtual bool Process::ToAtmosphere ( ) const
inlinenodiscardvirtual

Check if the process sends water to the atmosphere.

Returns
true if the process sends water to the atmosphere.

Reimplemented in ProcessET.

◆ Validate()

void Process::Validate ( ) const
virtual

Validate that everything is correctly defined. Throws an exception if validation fails.

Exceptions
ModelConfigErrorif validation fails.

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