hydrobricks
Loading...
Searching...
No Matches
HydroUnit Class Reference
Inheritance diagram for HydroUnit:

Public Types

enum  Types { Distributed , SemiDistributed , Lumped , Undefined }
 

Public Member Functions

 HydroUnit (double area=UNDEFINED, Types type=Undefined)
 
void Reset ()
 
void SaveAsInitialState ()
 
void SetProperties (HydroUnitSettings &unitSettings)
 
void AddProperty (HydroUnitProperty *property)
 
double GetPropertyDouble (const string &name, const string &unit="")
 
string GetPropertyString (const string &name)
 
void AddBrick (Brick *brick)
 
void AddSplitter (Splitter *splitter)
 
bool HasForcing (VariableType type)
 
void AddForcing (Forcing *forcing)
 
ForcingGetForcing (VariableType type)
 
int GetBricksCount ()
 
int GetSplittersCount ()
 
BrickGetBrick (int index)
 
bool HasBrick (const string &name)
 
BrickGetBrick (const string &name)
 
LandCoverGetLandCover (const string &name)
 
SplitterGetSplitter (int index)
 
bool HasSplitter (const string &name)
 
SplitterGetSplitter (const string &name)
 
bool IsOk ()
 
bool ChangeLandCoverAreaFraction (const string &name, double fraction)
 
bool FixLandCoverFractionsTotal ()
 
Types GetType ()
 
void SetId (int id)
 
double GetArea () const
 
int GetId () const
 

Protected Attributes

Types m_type
 
int m_id
 
double m_area
 
vector< HydroUnitProperty * > m_properties
 
vector< Brick * > m_bricks
 
vector< LandCover * > m_landCoverBricks
 
vector< Splitter * > m_splitters
 
vector< Forcing * > m_forcing
 

Member Function Documentation

◆ AddBrick()

void HydroUnit::AddBrick ( Brick * brick)

Add a brick to the hydro unit.

Parameters
brickThe brick to add.

◆ AddForcing()

void HydroUnit::AddForcing ( Forcing * forcing)

Attach a forcing to the hydro unit.

Parameters
forcingThe forcing to attach.

◆ AddProperty()

void HydroUnit::AddProperty ( HydroUnitProperty * property)

Add a property to the hydro unit.

Parameters
propertyThe property to add.

◆ AddSplitter()

void HydroUnit::AddSplitter ( Splitter * splitter)

Add a splitter to the hydro unit.

Parameters
splitterThe splitter to add.

◆ ChangeLandCoverAreaFraction()

bool HydroUnit::ChangeLandCoverAreaFraction ( const string & name,
double fraction )

Change the area fraction of a land cover in the hydro unit. Ensure that the sum of all land cover fractions is equal to 1.

Parameters
nameThe name of the land cover to change.
fractionThe new area fraction of the land cover.

◆ FixLandCoverFractionsTotal()

bool HydroUnit::FixLandCoverFractionsTotal ( )

Fix the land cover fractions to ensure that they sum to 1.

Returns
True if the fractions were fixed successfully, false otherwise.

◆ GetArea()

double HydroUnit::GetArea ( ) const
inline

Get the area of the hydro unit.

Returns
The area of the hydro unit in square meters.

◆ GetBrick() [1/2]

Brick * HydroUnit::GetBrick ( const string & name)

Get a brick by its name.

Parameters
nameThe name of the brick to get.
Returns
The brick with the specified name.

◆ GetBrick() [2/2]

Brick * HydroUnit::GetBrick ( int index)

Get a brick by its index.

Parameters
indexThe index of the brick to get.
Returns
The brick at the specified index.

◆ GetBricksCount()

int HydroUnit::GetBricksCount ( )

Get the number of bricks in the hydro unit.

Returns
The number of bricks.

◆ GetForcing()

Forcing * HydroUnit::GetForcing ( VariableType type)

Get a forcing of a specific type.

Parameters
typeThe type of forcing to get.
Returns
The forcing of the specified type.

◆ GetId()

int HydroUnit::GetId ( ) const
inline

Get the ID of the hydro unit.

Returns
The ID of the hydro unit.

◆ GetLandCover()

LandCover * HydroUnit::GetLandCover ( const string & name)

Get a land cover by its name.

Parameters
nameThe name of the land cover to get.
Returns
The land cover with the specified name.

◆ GetPropertyDouble()

double HydroUnit::GetPropertyDouble ( const string & name,
const string & unit = "" )

Get a numeric property of the hydro unit.

Parameters
nameThe name of the property to get.
unitThe unit of the property to get.
Returns
The value of the property.

◆ GetPropertyString()

string HydroUnit::GetPropertyString ( const string & name)

Get a property of the hydro unit as a string.

Parameters
nameThe name of the property to get.
Returns
The value of the property as a string.

◆ GetSplitter() [1/2]

Splitter * HydroUnit::GetSplitter ( const string & name)

Get a splitter by its name.

Parameters
nameThe name of the splitter to get.
Returns
The splitter with the specified name.

◆ GetSplitter() [2/2]

Splitter * HydroUnit::GetSplitter ( int index)

Get a splitter by its index.

Parameters
indexThe index of the splitter to get.
Returns
The splitter at the specified index.

◆ GetSplittersCount()

int HydroUnit::GetSplittersCount ( )

Get the number of splitters in the hydro unit.

Returns
The number of splitters.

◆ GetType()

Types HydroUnit::GetType ( )
inline

Get the type of the hydro unit.

Returns
The type of the hydro unit.

◆ HasBrick()

bool HydroUnit::HasBrick ( const string & name)

Check if the hydro unit has a brick with a specific name.

Parameters
nameThe name of the brick to check for.
Returns
True if the hydro unit has the brick, false otherwise.

◆ HasForcing()

bool HydroUnit::HasForcing ( VariableType type)

Check if the hydro unit has a forcing of a specific type.

Parameters
typeThe type of forcing to check for.
Returns
True if the hydro unit has the forcing, false otherwise.

◆ HasSplitter()

bool HydroUnit::HasSplitter ( const string & name)

Check if the hydro unit has a splitter with a specific name.

Parameters
nameThe name of the splitter to check for.
Returns
True if the hydro unit has the splitter, false otherwise.

◆ IsOk()

bool HydroUnit::IsOk ( )

Check if everything is ok with the hydro unit.

Returns
True if everything is ok, false otherwise.

◆ Reset()

void HydroUnit::Reset ( )

Reset the hydro unit to its initial state.

◆ SaveAsInitialState()

void HydroUnit::SaveAsInitialState ( )

Save the current state of the hydro unit as the initial state.

◆ SetId()

void HydroUnit::SetId ( int id)
inline

Set the ID of the hydro unit.

Parameters
idThe ID to set.

◆ SetProperties()

void HydroUnit::SetProperties ( HydroUnitSettings & unitSettings)

Set the properties of the hydro unit.

Parameters
unitSettingsThe settings to set.

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