hydrobricks
Loading...
Searching...
No Matches
Brick Class Reference
Inheritance diagram for Brick:
LandCover Storage SurfaceComponent GenericLandCover Glacier Urban Vegetation Snowpack

Public Member Functions

virtual void SetParameters (const BrickSettings &brickSettings)
 
virtual void AttachFluxIn (Flux *flux)
 
void AddProcess (Process *process)
 
virtual void Reset ()
 
virtual void SaveAsInitialState ()
 
virtual bool IsOk ()
 
bool NeedsSolver () const
 
virtual bool CanHaveAreaFraction ()
 
virtual bool IsSnowpack ()
 
virtual bool IsGlacier ()
 
virtual bool IsLandCover ()
 
virtual bool IsNull ()
 
virtual void Finalize ()
 
virtual void SetInitialState (double value, ContentType type)
 
virtual double GetContent (ContentType type)
 
virtual void UpdateContent (double value, ContentType type)
 
virtual void UpdateContentFromInputs ()
 
virtual void ApplyConstraints (double timeStep)
 
WaterContainerGetWaterContainer ()
 
ProcessGetProcess (int index)
 
vector< Process * > & GetProcesses ()
 
string GetName () const
 
void SetName (const string &name)
 
HydroUnitGetHydroUnit () const
 
void SetHydroUnit (HydroUnit *hydroUnit)
 
virtual vecDoublePt GetDynamicContentChanges ()
 
vecDoublePt GetStateVariableChangesFromProcesses ()
 
int GetProcessesConnectionsNb ()
 
double * GetBaseValuePointer (const string &name)
 
virtual double * GetValuePointer (const string &name)
 

Static Public Member Functions

static BrickFactory (const BrickSettings &brickSettings)
 
static BrickFactory (BrickType type)
 
static bool HasParameter (const BrickSettings &brickSettings, const string &name)
 
static float * GetParameterValuePointer (const BrickSettings &brickSettings, const string &name)
 

Protected Attributes

string _name
 
bool _needsSolver
 
std::unique_ptr< WaterContainer_water
 
vector< Process * > _processes
 
HydroUnit_hydroUnit
 

Member Function Documentation

◆ AddProcess()

void Brick::AddProcess ( Process * process)
inline

Add a process to the brick.

Parameters
processprocess to add.

◆ ApplyConstraints()

void Brick::ApplyConstraints ( double timeStep)
virtual

Apply the constraints to the water container.

Parameters
timeSteptime step for the simulation.

Reimplemented in GenericLandCover, Glacier, Snowpack, Urban, and Vegetation.

◆ AttachFluxIn()

void Brick::AttachFluxIn ( Flux * flux)
virtual

Attach incoming flux.

Parameters
fluxincoming flux

Reimplemented in Glacier, and Snowpack.

◆ CanHaveAreaFraction()

virtual bool Brick::CanHaveAreaFraction ( )
inlinenodiscardvirtual

Check if the brick can have an area fraction.

Returns
true if the brick can have an area fraction.

Reimplemented in LandCover, and SurfaceComponent.

◆ Factory() [1/2]

Brick * Brick::Factory ( BrickType type)
static

Factory method to create a brick.

Parameters
typetype of the brick.
Returns
the created brick.

◆ Factory() [2/2]

Brick * Brick::Factory ( const BrickSettings & brickSettings)
static

Factory method to create a brick.

Parameters
brickSettingssettings of the brick.
Returns
the created brick.

◆ Finalize()

void Brick::Finalize ( )
virtual

Finalize the water transfer.

Reimplemented in GenericLandCover, Glacier, Snowpack, Urban, and Vegetation.

◆ GetBaseValuePointer()

double * Brick::GetBaseValuePointer ( const string & name)

Get the pointer to the water container content.

Parameters
namename of the container type (e.g., "water", "ice", or "snow").

◆ GetContent()

double Brick::GetContent ( ContentType type)
virtual

Get the content of the water container.

Parameters
typetype of the content.
Returns
content of the water container.

Reimplemented in Glacier, and Snowpack.

◆ GetDynamicContentChanges()

vecDoublePt Brick::GetDynamicContentChanges ( )
virtual

Get pointers to the state variables.

Returns
vector of pointers to the state variables.

Reimplemented in Glacier, and Snowpack.

◆ GetHydroUnit()

HydroUnit * Brick::GetHydroUnit ( ) const
inline

Get the hydro unit associated with the brick.

Returns
pointer to the hydro unit.

◆ GetName()

string Brick::GetName ( ) const
inline

Get the name of the brick.

Returns
name of the brick.

◆ GetParameterValuePointer()

float * Brick::GetParameterValuePointer ( const BrickSettings & brickSettings,
const string & name )
static

Get the pointer to the parameter value.

Parameters
brickSettingssettings of the brick containing the parameters.
namename of the parameter.
Returns
pointer to the parameter value.

◆ GetProcess()

Process * Brick::GetProcess ( int index)

Get a process by its index.

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

◆ GetProcesses()

vector< Process * > & Brick::GetProcesses ( )
inline

Get all processes of the brick.

Returns
vector of pointers to the processes.

◆ GetProcessesConnectionsNb()

int Brick::GetProcessesConnectionsNb ( )

Get the number of connections of the processes.

Returns
number of connections of the processes.

◆ GetStateVariableChangesFromProcesses()

vecDoublePt Brick::GetStateVariableChangesFromProcesses ( )

Get the changes in state variables from processes.

Returns
vector of pointers to the changes in state variables.

◆ GetValuePointer()

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

Get the pointer to the water container content.

Parameters
namename of the container type (e.g., "water", "ice", or "snow").

Reimplemented in Glacier, and Snowpack.

◆ GetWaterContainer()

WaterContainer * Brick::GetWaterContainer ( )

Get the water container.

Returns
pointer to the water container.

◆ HasParameter()

bool Brick::HasParameter ( const BrickSettings & brickSettings,
const string & name )
static

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

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

◆ IsGlacier()

virtual bool Brick::IsGlacier ( )
inlinenodiscardvirtual

Check if the brick is a glacier.

Returns
true if the brick is a glacier.

Reimplemented in Glacier.

◆ IsLandCover()

virtual bool Brick::IsLandCover ( )
inlinenodiscardvirtual

Check if the brick is a land cover.

Returns
true if the brick is a land cover.

Reimplemented in LandCover.

◆ IsNull()

virtual bool Brick::IsNull ( )
inlinenodiscardvirtual

Check if the brick is null (e.g., if the area fraction is null).

Returns
true if the brick is null.

Reimplemented in LandCover, and SurfaceComponent.

◆ IsOk()

bool Brick::IsOk ( )
nodiscardvirtual

Check that everything is correctly defined.

Returns
true is everything is correctly defined.

Reimplemented in Glacier, and Snowpack.

◆ IsSnowpack()

virtual bool Brick::IsSnowpack ( )
inlinenodiscardvirtual

Check if the brick is a snowpack.

Returns
true if the brick is a snowpack.

Reimplemented in Snowpack.

◆ NeedsSolver()

bool Brick::NeedsSolver ( ) const
inlinenodiscard

Define if the brick needs to be handled by the solver.

Returns
true if the brick needs to be handled by the solver.

◆ Reset()

void Brick::Reset ( )
virtual

Reset the brick to its initial state.

Reimplemented in Glacier, and Snowpack.

◆ SaveAsInitialState()

void Brick::SaveAsInitialState ( )
virtual

Save the current state of the brick as the initial state.

Reimplemented in Glacier, and Snowpack.

◆ SetHydroUnit()

void Brick::SetHydroUnit ( HydroUnit * hydroUnit)
inline

Set the hydro unit associated with the brick.

Parameters
hydroUnitpointer to the hydro unit.

◆ SetInitialState()

void Brick::SetInitialState ( double value,
ContentType type )
virtual

Set the initial state of the water container.

Parameters
valueinitial state value.
typetype of the content.

Reimplemented in Glacier, and Snowpack.

◆ SetName()

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

Set the name of the brick.

Parameters
namenew name of the brick.

◆ SetParameters()

void Brick::SetParameters ( const BrickSettings & brickSettings)
virtual

Assign the parameters to the brick element.

Parameters
brickSettingssettings of the brick containing the parameters.

Reimplemented in GenericLandCover, Glacier, Snowpack, Storage, Urban, and Vegetation.

◆ UpdateContent()

void Brick::UpdateContent ( double value,
ContentType type )
virtual

Update the content of the water container.

Parameters
valuenew content value.
typetype of the content

Reimplemented in Glacier, and Snowpack.

◆ UpdateContentFromInputs()

void Brick::UpdateContentFromInputs ( )
virtual

Update the content of the water container from the inputs.

Reimplemented in Glacier, and Snowpack.


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