|
| void | AddHydroUnit (int id, double area, double elevation=-9999, int subbasinId=1) |
| |
| void | AddSubbasin (int id, int downstreamId=0, const string &name="") |
| |
| void | AddSubbasinPropertyDouble (const string &name, double value, const string &unit="") |
| |
| void | AddSubbasinPropertyString (const string &name, const string &value) |
| |
| void | SelectSubbasin (int index) |
| |
| ModelResult | ValidateNetwork () const |
| |
| void | AddLandCover (const string &name, const string &type="", double fraction=1.0) |
| |
| void | AddHydroUnitPropertyDouble (const string &name, double value, const string &unit="") |
| |
| void | AddHydroUnitPropertyString (const string &name, const string &value) |
| |
| void | AddLateralConnection (int giverHydroUnitId, int receiverHydroUnitId, double fraction, const string &type="") |
| |
| void | Clear () |
| |
| void | SelectUnit (int index) |
| |
| bool | Parse (const string &path) |
| |
| HydroUnitSettings | GetHydroUnitSettings (int index) const |
| |
| const SubbasinSettings & | GetSubbasinSettings (int index) const |
| |
| const vector< SubbasinSettings > & | GetSubbasins () const |
| |
| int | GetSubbasinCount () const |
| |
| LandCoverSettings | GetLandCoverSettings (int index) const |
| |
| SurfaceComponentSettings | GetSurfaceComponentSettings (int index) const |
| |
| vector< LateralConnectionSettings > | GetLateralConnections () const |
| |
| int | GetHydroUnitCount () const |
| |
| int | GetLandCoverCount () const |
| |
| int | GetSurfaceComponentCount () const |
| |
| int | GetLateralConnectionCount () const |
| |
| double | GetTotalArea () const |
| |
◆ AddHydroUnit()
| void SettingsBasin::AddHydroUnit |
( |
int | id, |
|
|
double | area, |
|
|
double | elevation = -9999, |
|
|
int | subbasinId = 1 ) |
Add a new hydro unit.
- Parameters
-
| id | ID of the hydro unit. |
| area | area of the hydro unit. |
| elevation | elevation of the hydro unit. |
| subbasinId | ID of the subbasin the unit drains to (1 when no network is declared). |
◆ AddHydroUnitPropertyDouble()
| void SettingsBasin::AddHydroUnitPropertyDouble |
( |
const string & | name, |
|
|
double | value, |
|
|
const string & | unit = "" ) |
Add a numeric property to the selected hydro unit.
- Parameters
-
| name | name of the property. |
| value | value of the property. |
| unit | unit of the property. |
◆ AddHydroUnitPropertyString()
| void SettingsBasin::AddHydroUnitPropertyString |
( |
const string & | name, |
|
|
const string & | value ) |
Add a string property to the selected hydro unit.
- Parameters
-
| name | name of the property. |
| value | value of the property. |
◆ AddLandCover()
| void SettingsBasin::AddLandCover |
( |
const string & | name, |
|
|
const string & | type = "", |
|
|
double | fraction = 1.0 ) |
Add a new land cover to the selected hydro unit.
- Parameters
-
| name | name of the land cover. |
| type | type of the land cover. |
| fraction | fraction of the land cover. |
◆ AddLateralConnection()
| void SettingsBasin::AddLateralConnection |
( |
int | giverHydroUnitId, |
|
|
int | receiverHydroUnitId, |
|
|
double | fraction, |
|
|
const string & | type = "" ) |
Add a lateral connection between two hydro units.
- Parameters
-
| giverHydroUnitId | ID of the hydro unit giving the connection. |
| receiverHydroUnitId | ID of the hydro unit receiving the 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). |
◆ AddSubbasin()
| void SettingsBasin::AddSubbasin |
( |
int | id, |
|
|
int | downstreamId = 0, |
|
|
const string & | name = "" ) |
Add a subbasin to the river network and select it for the following property additions.
- Parameters
-
| id | ID of the subbasin (> 0). |
| downstreamId | ID of the downstream subbasin (0: terminal outlet). |
| name | name of the subbasin (optional, e.g. the gauge name). |
◆ AddSubbasinPropertyDouble()
| void SettingsBasin::AddSubbasinPropertyDouble |
( |
const string & | name, |
|
|
double | value, |
|
|
const string & | unit = "" ) |
Add a numeric property to the selected subbasin (e.g. the reach length or slope).
- Parameters
-
| name | name of the property. |
| value | value of the property. |
| unit | unit of the property. |
◆ AddSubbasinPropertyString()
| void SettingsBasin::AddSubbasinPropertyString |
( |
const string & | name, |
|
|
const string & | value ) |
Add a string property to the selected subbasin.
- Parameters
-
| name | name of the property. |
| value | value of the property. |
◆ Clear()
| void SettingsBasin::Clear |
( |
| ) |
|
◆ GetHydroUnitCount()
| int SettingsBasin::GetHydroUnitCount |
( |
| ) |
const |
|
inline |
Get the number of hydro units.
- Returns
- number of hydro units.
◆ GetHydroUnitSettings()
Get hydro unit settings.
- Parameters
-
| index | index of the hydro unit. |
- Returns
- pointer to the selected hydro unit.
◆ GetLandCoverCount()
| int SettingsBasin::GetLandCoverCount |
( |
| ) |
const |
|
inline |
Get the number of land covers for the selected hydro unit.
- Returns
- number of land covers.
◆ GetLandCoverSettings()
Get land cover settings for the selected hydro unit.
- Parameters
-
| index | index of the land cover. |
- Returns
- pointer to the selected land cover.
◆ GetLateralConnectionCount()
| int SettingsBasin::GetLateralConnectionCount |
( |
| ) |
const |
|
inline |
Get the number of lateral connections.
- Returns
- number of lateral connections.
◆ GetLateralConnections()
Get the lateral connections settings.
- Returns
- vector of lateral connection settings.
◆ GetSubbasinCount()
| int SettingsBasin::GetSubbasinCount |
( |
| ) |
const |
|
inline |
Get the number of declared subbasins (0 when no network is declared).
- Returns
- number of subbasins.
◆ GetSubbasins()
Get the settings of all the declared subbasins (empty when no network is declared).
- Returns
- vector of subbasin settings.
◆ GetSubbasinSettings()
Get the settings of a subbasin.
- Parameters
-
| index | The index of the subbasin. |
- Returns
- the subbasin settings.
◆ GetSurfaceComponentCount()
| int SettingsBasin::GetSurfaceComponentCount |
( |
| ) |
const |
|
inline |
Get the number of surface components for the selected hydro unit.
- Returns
- number of surface components.
◆ GetSurfaceComponentSettings()
Get surface component settings for the selected hydro unit.
- Parameters
-
| index | index of the surface component. |
- Returns
- pointer to the selected surface component.
◆ GetTotalArea()
| double SettingsBasin::GetTotalArea |
( |
| ) |
const |
|
nodiscard |
Get the total area of the subbasin (all hydro units).
- Returns
- total area of the subbasin.
◆ Parse()
| bool SettingsBasin::Parse |
( |
const string & | path | ) |
|
Parse a NetCDF file to get the hydro unit settings.
- Parameters
-
| path | path to the NetCDF file. |
- Returns
- true if the file was parsed successfully.
◆ SelectSubbasin()
| void SettingsBasin::SelectSubbasin |
( |
int | index | ) |
|
Select a subbasin by index.
- Parameters
-
| index | index of the subbasin. |
◆ SelectUnit()
| void SettingsBasin::SelectUnit |
( |
int | index | ) |
|
Select a hydro unit.
- Parameters
-
| index | index of the hydro unit to select. |
◆ ValidateNetwork()
| ModelResult SettingsBasin::ValidateNetwork |
( |
| ) |
const |
|
nodiscard |
Check the river network: unique subbasin IDs, one terminal outlet, no cycle, every hydro unit assigned to a declared subbasin and every subbasin holding at least one hydro unit. A model without declared subbasins is valid when all its units drain to subbasin 1 (the implicit single subbasin).
- Returns
- an empty result when valid, else the description of the first problem found.
The documentation for this class was generated from the following files:
- /github/workspace/core/src/base/SettingsBasin.h
- /github/workspace/core/src/base/SettingsBasin.cpp