hydrobricks
Loading...
Searching...
No Matches
Process Class Referenceabstract
Inheritance diagram for Process:
ProcessET ProcessInfiltration ProcessLateral ProcessMelt ProcessOutflow ProcessTransform ProcessETSocont ProcessInfiltrationSocont ProcessLateralSnowSlide ProcessMeltDegreeDay ProcessMeltDegreeDayAspect ProcessMeltTemperatureIndex ProcessOutflowDirect ProcessOutflowLinear ProcessOutflowOverflow ProcessOutflowPercolation ProcessOutflowRestDirect ProcessRunoffSocont ProcessTransformSnowToIceConstant ProcessTransformSnowToIceSwat

Public Member Functions

 Process (WaterContainer *container)
 
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 (const string &name)
 
const string & GetName () const
 
void SetName (const string &name)
 
WaterContainerGetWaterContainer () const
 
virtual void SetTargetBrick (Brick *)
 
virtual bool IsLateralProcess () const
 
bool HasOutputFluxes () const
 
bool HasWaterContainer () const
 

Static Public Member Functions

static ProcessFactory (const ProcessSettings &processSettings, Brick *brick)
 
static bool RegisterParametersAndForcing (SettingsModel *modelSettings, const string &processType)
 
static bool HasParameter (const ProcessSettings &processSettings, const string &name)
 
static const float * GetParameterValuePointer (const ProcessSettings &processSettings, const string &name)
 

Protected Member Functions

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

Protected Attributes

string _name
 
WaterContainer_container
 
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

Attach forcing to the process.

Parameters
forcingforcing to attach.

Reimplemented in ProcessETSocont, ProcessMeltDegreeDay, ProcessMeltDegreeDayAspect, and ProcessMeltTemperatureIndex.

◆ Factory()

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.

◆ GetChangeRates()

vecDouble Process::GetChangeRates ( )
virtual

Get the change rates of the process.

Returns
vector of change rates.

◆ GetConnectionCount()

virtual int Process::GetConnectionCount ( ) const
pure 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,
const string & 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
protected

Get the sum of change rates from other processes.

Returns
sum of change rates from other processes.

◆ GetValuePointer()

double * Process::GetValuePointer ( const string & name)
virtual

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, 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
inlinenodiscard

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,
const string & 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
inlinenodiscard

Check if the process has a water container.

Returns
true if the process has a water container.

◆ IsLateralProcess()

virtual bool Process::IsLateralProcess ( ) const
inlinenodiscardvirtual

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

Check that everything is correctly defined.

Returns
true if everything is correctly defined.

Implemented in ProcessET, ProcessETSocont, ProcessInfiltration, ProcessLateral, ProcessLateralSnowSlide, ProcessMelt, ProcessMeltDegreeDay, ProcessMeltDegreeDayAspect, ProcessMeltTemperatureIndex, ProcessOutflow, and ProcessTransform.

◆ 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.

◆ RegisterParametersAndForcing()

bool Process::RegisterParametersAndForcing ( 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 ( )

Reset all the fluxes connected to the process.

◆ 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.

◆ 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: