|
| enum | Types { Distributed
, SemiDistributed
, Lumped
, Undefined
} |
| |
|
|
Types | _type |
| |
|
int | _id |
| |
|
double | _area |
| |
|
std::vector< std::unique_ptr< HydroUnitProperty > > | _properties |
| |
|
std::vector< std::unique_ptr< HydroUnitLateralConnection > > | _lateralConnections |
| |
|
std::vector< std::unique_ptr< Brick > > | _bricks |
| |
|
std::unordered_map< string, Brick * > | _brickMap |
| |
|
std::vector< LandCover * > | _landCoverBricks |
| |
|
std::unordered_map< string, LandCover * > | _landCoverMap |
| |
|
std::vector< std::unique_ptr< Splitter > > | _splitters |
| |
|
std::unordered_map< string, Splitter * > | _splitterMap |
| |
|
std::vector< std::unique_ptr< Forcing > > | _forcing |
| |
|
std::unordered_map< VariableType, Forcing * > | _forcingMap |
| |
◆ AddBrick()
| void HydroUnit::AddBrick |
( |
std::unique_ptr< Brick > | brick | ) |
|
Add a brick to the hydro unit.
- Parameters
-
◆ AddForcing()
| void HydroUnit::AddForcing |
( |
std::unique_ptr< Forcing > | forcing | ) |
|
Attach a forcing to the hydro unit.
- Parameters
-
| forcing | The forcing to attach. |
◆ AddLateralConnection()
| void HydroUnit::AddLateralConnection |
( |
HydroUnit * | receiver, |
|
|
double | fraction, |
|
|
const string & | type = "" ) |
Add a lateral connection to the hydro unit.
- Parameters
-
| receiver | The hydro unit that receives the lateral connection. |
| fraction | The fraction of the flow that is transferred. |
| type | The type of the lateral connection (optional). It is unused in the current implementation, but can be used for future extensions (for example, to differentiate between snow and groundwater). |
◆ AddProperty()
Add a property to the hydro unit.
- Parameters
-
| property | The property to add. |
◆ AddSplitter()
| void HydroUnit::AddSplitter |
( |
std::unique_ptr< Splitter > | splitter | ) |
|
Add a splitter to the hydro unit.
- Parameters
-
| splitter | The 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
-
| name | The name of the land cover to change. |
| fraction | The 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 |
|
inlinenodiscard |
Get the area of the hydro unit.
- Returns
- The area of the hydro unit [m²]
◆ GetBrick() [1/2]
| Brick * HydroUnit::GetBrick |
( |
const string & | name | ) |
const |
Get a brick by its name.
- Parameters
-
| name | The name of the brick to get. |
- Returns
- The brick with the specified name.
◆ GetBrick() [2/2]
| Brick * HydroUnit::GetBrick |
( |
size_t | index | ) |
const |
Get a brick by its index.
- Parameters
-
| index | The index of the brick to get. |
- Returns
- The brick at the specified index.
◆ GetBrickCount()
| int HydroUnit::GetBrickCount |
( |
| ) |
const |
Get the number of bricks in the hydro unit.
- Returns
- The number of bricks.
◆ GetForcing()
| Forcing * HydroUnit::GetForcing |
( |
VariableType | type | ) |
const |
Get a forcing of a specific type.
- Parameters
-
| type | The type of forcing to get. |
- Returns
- The forcing of the specified type.
◆ GetId()
| int HydroUnit::GetId |
( |
| ) |
const |
|
inlinenodiscard |
Get the ID of the hydro unit.
- Returns
- The ID of the hydro unit.
◆ GetLandCover()
| LandCover * HydroUnit::GetLandCover |
( |
const string & | name | ) |
const |
Get a land cover by its name.
- Parameters
-
| name | The name of the land cover to get. |
- Returns
- The land cover with the specified name.
◆ GetLateralConnections()
Get the lateral connections of the hydro unit.
- Returns
- A vector of lateral connections associated with the hydro unit.
◆ GetPropertyDouble()
| double HydroUnit::GetPropertyDouble |
( |
const string & | name, |
|
|
const string & | unit = "" ) const |
Get a numeric property of the hydro unit.
- Parameters
-
| name | The name of the property to get. |
| unit | The unit of the property to get. |
- Returns
- The value of the property.
◆ GetPropertyFloat()
| float HydroUnit::GetPropertyFloat |
( |
const string & | name, |
|
|
const string & | unit = "" ) const |
Get a float property of the hydro unit.
- Parameters
-
| name | The name of the property to get. |
| unit | The unit of the property to get. |
- Returns
- The value of the property.
◆ GetPropertyString()
| string HydroUnit::GetPropertyString |
( |
const string & | name | ) |
const |
Get a property of the hydro unit as a string.
- Parameters
-
| name | The name of the property to get. |
- Returns
- The value of the property as a string.
◆ GetSnowpacks()
| std::vector< Brick * > HydroUnit::GetSnowpacks |
( |
| ) |
const |
|
inlinenodiscard |
Get a vector of all snowpack bricks in the hydro unit.
- Returns
- A vector of pointers to the snowpack bricks.
◆ GetSplitter() [1/2]
| Splitter * HydroUnit::GetSplitter |
( |
const string & | name | ) |
const |
Get a splitter by its name.
- Parameters
-
| name | The name of the splitter to get. |
- Returns
- The splitter with the specified name.
◆ GetSplitter() [2/2]
| Splitter * HydroUnit::GetSplitter |
( |
size_t | index | ) |
const |
Get a splitter by its index.
- Parameters
-
| index | The index of the splitter to get. |
- Returns
- The splitter at the specified index.
◆ GetSplitterCount()
| int HydroUnit::GetSplitterCount |
( |
| ) |
const |
Get the number of splitters in the hydro unit.
- Returns
- The number of splitters.
◆ GetType()
| Types HydroUnit::GetType |
( |
| ) |
const |
|
inline |
Get the type of the hydro unit.
- Returns
- The type of the hydro unit.
◆ HasBrick()
| bool HydroUnit::HasBrick |
( |
const string & | name | ) |
const |
|
nodiscard |
Check if the hydro unit has a brick with a specific name.
- Parameters
-
| name | The name of the brick to check for. |
- Returns
- True if the hydro unit has the brick, false otherwise.
◆ HasForcing()
| bool HydroUnit::HasForcing |
( |
VariableType | type | ) |
|
|
nodiscard |
Check if the hydro unit has a forcing of a specific type.
- Parameters
-
| type | The type of forcing to check for. |
- Returns
- True if the hydro unit has the forcing, false otherwise.
◆ HasSplitter()
| bool HydroUnit::HasSplitter |
( |
const string & | name | ) |
const |
|
nodiscard |
Check if the hydro unit has a splitter with a specific name.
- Parameters
-
| name | The name of the splitter to check for. |
- Returns
- True if the hydro unit has the splitter, false otherwise.
◆ IsValid()
| bool HydroUnit::IsValid |
( |
bool | checkProcesses = true | ) |
const |
|
nodiscard |
Check if the hydro unit is properly configured.
- Returns
- True if everything is correctly defined, false otherwise.
◆ ReserveBricks()
| void HydroUnit::ReserveBricks |
( |
size_t | count | ) |
|
Reserve space for a number of bricks in the hydro unit.
- Parameters
-
| count | The number of bricks to reserve space for. |
◆ ReserveForcings()
| void HydroUnit::ReserveForcings |
( |
size_t | count | ) |
|
Reserve space for a number of forcings in the hydro unit.
- Parameters
-
| count | The number of forcings to reserve space for. |
◆ ReserveLandCoverBricks()
| void HydroUnit::ReserveLandCoverBricks |
( |
size_t | count | ) |
|
Reserve space for a number of land cover bricks in the hydro unit.
- Parameters
-
| count | The number of land cover bricks to reserve space for. |
◆ ReserveLateralConnections()
| void HydroUnit::ReserveLateralConnections |
( |
size_t | count | ) |
|
Reserve space for a number of lateral connections in the hydro unit.
- Parameters
-
| count | The number of lateral connections to reserve space for. |
◆ ReserveSplitters()
| void HydroUnit::ReserveSplitters |
( |
size_t | count | ) |
|
Reserve space for a number of splitters in the hydro unit.
- Parameters
-
| count | The number of splitters to reserve space for. |
◆ 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
-
◆ SetProperties()
Set the properties of the hydro unit.
- Parameters
-
| unitSettings | The settings to set. |
◆ TryGetBrick()
| Brick * HydroUnit::TryGetBrick |
( |
const string & | name | ) |
const |
Try to get a brick by its name without throwing.
- Parameters
-
| name | The name of the brick to get. |
- Returns
- The brick with the specified name, or nullptr if not found.
◆ TryGetLandCover()
| LandCover * HydroUnit::TryGetLandCover |
( |
const string & | name | ) |
const |
Try to get a land cover brick by its name without throwing.
- Parameters
-
| name | The name of the land cover to get. |
- Returns
- The land cover with the specified name, or nullptr if not found.
◆ TryGetSplitter()
| Splitter * HydroUnit::TryGetSplitter |
( |
const string & | name | ) |
const |
Try to get a splitter by its name without throwing.
- Parameters
-
| name | The name of the splitter to get. |
- Returns
- The splitter with the specified name, or nullptr if not found.
◆ Validate()
| void HydroUnit::Validate |
( |
| ) |
const |
Validate that the hydro unit is properly configured. Throws an exception if validation fails.
- Exceptions
-
The documentation for this class was generated from the following files:
- /github/workspace/core/src/spatial/HydroUnit.h
- /github/workspace/core/src/spatial/HydroUnit.cpp