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 (std::unique_ptr< Process > process)
 
virtual void Reset ()
 
virtual void SaveAsInitialState ()
 
virtual bool IsValid (bool checkProcesses=true) const
 
virtual void Validate () const
 
bool NeedsSolver () const
 
BrickCategory GetCategory () const
 
virtual bool CanHaveAreaFraction () const
 
virtual bool IsLandCover () const
 
virtual bool IsNull () const
 
bool HasProcesses () const
 
bool HasHydroUnit () const
 
virtual void Finalize ()
 
virtual void SetInitialState (double value, ContentType type)
 
virtual double GetContent (ContentType type) const
 
virtual void UpdateContent (double value, ContentType type)
 
virtual void UpdateContentFromInputs ()
 
virtual void ApplyConstraints (double timeStep)
 
WaterContainerGetWaterContainer () const
 
size_t GetProcessCount () const
 
ProcessGetProcess (size_t index) const
 
const string & GetName () const
 
void SetName (const string &name)
 
HydroUnitGetHydroUnit () const
 
void SetHydroUnit (HydroUnit *hydroUnit)
 
virtual vecDoublePt GetDynamicContentChanges ()
 
vecDoublePt GetStateVariableChangesFromProcesses ()
 
int GetProcessConnectionCount () const
 
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 const float * GetParameterValuePointer (const BrickSettings &brickSettings, const string &name)
 

Protected Attributes

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

Member Function Documentation

◆ AddProcess()

void Brick::AddProcess ( std::unique_ptr< Process > process)
inline

Add a process to the brick.

Parameters
processprocess to add (ownership transferred).

◆ 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 (non-owning reference, owned by process)

Reimplemented in Glacier, and Snowpack.

◆ CanHaveAreaFraction()

virtual bool Brick::CanHaveAreaFraction ( ) const
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").

◆ GetCategory()

BrickCategory Brick::GetCategory ( ) const
inlinenodiscard

Get the category of the brick.

Returns
the category of the brick.

◆ GetContent()

double Brick::GetContent ( ContentType type) const
virtual

Get the content of the water container.

Parameters
typethe type of content to get.
Returns
the 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()

const string & Brick::GetName ( ) const
inline

Get the name of the brick.

Returns
name of the brick.

◆ GetParameterValuePointer()

const 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 ( size_t index) const

Get a process by its index.

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

◆ GetProcessConnectionCount()

int Brick::GetProcessConnectionCount ( ) const

Get the number of process connections in the brick.

Returns
number of process connections.

◆ GetProcessCount()

size_t Brick::GetProcessCount ( ) const
inlinenodiscard

Get the number of processes in the brick.

Returns
number of 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 ( ) const

Get the water container.

Returns
pointer to the water container.

◆ HasHydroUnit()

bool Brick::HasHydroUnit ( ) const
inlinenodiscard

Check if the brick has a hydro unit associated with it.

Returns
true if the brick has a hydro unit.

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

◆ HasProcesses()

bool Brick::HasProcesses ( ) const
inlinenodiscard

Check if the brick has any processes.

Returns
true if the brick has at least one process.

◆ IsLandCover()

virtual bool Brick::IsLandCover ( ) const
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 ( ) const
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.

◆ IsValid()

bool Brick::IsValid ( bool checkProcesses = true) const
nodiscardvirtual

Check that everything is correctly defined.

Returns
true if everything is correctly defined.

Reimplemented in Glacier, and 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.

◆ Validate()

void Brick::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: