|
hydrobricks
|
Public Member Functions | |
| void | SetSolver (const string &solverName) |
| void | SetTimer (const string &start, const string &end, int timeStep, const string &timeStepUnit) |
| void | AddHydroUnitBrick (const string &name, const std::string &type="storage") |
| void | AddSubBasinBrick (const string &name, const std::string &type="storage") |
| void | AddLandCoverBrick (const string &name, const string &type) |
| void | AddSurfaceComponentBrick (const string &name, const string &type) |
| void | SetSurfaceComponentParent (const string &name) |
| void | AddBrickParameter (const string &name, float value, const std::string &type="constant") |
| void | SetBrickParameterValue (const string &name, float value, const std::string &type="constant") |
| void | SetCurrentBrickComputedDirectly () |
| bool | BrickHasParameter (const string &name) |
| void | AddBrickForcing (const string &name) |
| void | AddBrickProcess (const string &name, const string &type, const string &target="", bool log=false) |
| void | AddProcessParameter (const string &name, float value, const std::string &type="constant") |
| void | SetProcessParameterValue (const string &name, float value, const std::string &type="constant") |
| void | AddProcessForcing (const string &name) |
| void | AddProcessOutput (const string &target, ContentType fluxType=ContentType::Water) |
| void | SetProcessOutputsAsInstantaneous () |
| void | SetProcessOutputsAsStatic () |
| void | OutputProcessToSameBrick () |
| void | AddHydroUnitSplitter (const string &name, const string &type) |
| void | AddSubBasinSplitter (const string &name, const string &type) |
| void | AddSplitterParameter (const string &name, float value, const std::string &type="constant") |
| void | SetSplitterParameterValue (const string &name, float value, const std::string &type="constant") |
| void | AddSplitterForcing (const string &name) |
| void | AddSplitterOutput (const string &target, const ContentType fluxType=ContentType::Water) |
| void | AddLoggingToItem (const string &itemName) |
| void | AddLoggingToItems (std::initializer_list< const string > items) |
| void | AddBrickLogging (const string &itemName) |
| void | AddBrickLogging (std::initializer_list< const string > items) |
| void | AddProcessLogging (const string &itemName) |
| void | AddSplitterLogging (const string &itemName) |
| void | GeneratePrecipitationSplitters (bool withSnow, const string &splitterType="snow_rain:linear") |
| void | GenerateSnowpacks (const string &snowMeltProcess) |
| void | AddSnowIceTransformation (const string &transformationProcess="transform:snow_ice_swat") |
| void | AddSnowRedistribution (const string &redistributionProcess="transport:snow_slide", bool skipGlaciers=false) |
| void | GenerateSnowpacksWithWaterRetention (const string &snowMeltProcess, const string &outflowProcess) |
| bool | SelectStructure (int id) |
| void | SelectHydroUnitBrick (int index) |
| void | SelectSubBasinBrick (int index) |
| bool | SelectHydroUnitBrickIfFound (const string &name) |
| bool | SelectSubBasinBrickIfFound (const string &name) |
| void | SelectHydroUnitBrick (const string &name) |
| void | SelectHydroUnitBrickByName (const string &name) |
| void | SelectSubBasinBrick (const string &name) |
| void | SelectProcess (int index) |
| void | SelectProcess (const string &name) |
| void | SelectProcessWithParameter (const string &name) |
| void | SelectHydroUnitSplitter (int index) |
| void | SelectSubBasinSplitter (int index) |
| bool | SelectHydroUnitSplitterIfFound (const string &name) |
| bool | SelectSubBasinSplitterIfFound (const string &name) |
| void | SelectHydroUnitSplitter (const string &name) |
| void | SelectSubBasinSplitter (const string &name) |
| bool | SetParameterValue (const string &component, const string &name, float value) |
| int | GetStructureCount () const |
| int | GetHydroUnitBrickCount () const |
| int | GetSubBasinBrickCount () const |
| int | GetSurfaceComponentBrickCount () const |
| int | GetProcessCount () const |
| int | GetHydroUnitSplitterCount () const |
| int | GetSubBasinSplitterCount () const |
| SolverSettings | GetSolverSettings () const |
| TimerSettings | GetTimerSettings () const |
| const BrickSettings & | GetHydroUnitBrickSettings (int index) const |
| const BrickSettings & | GetHydroUnitBrickSettings (const string &name) const |
| const BrickSettings & | GetSurfaceComponentBrickSettings (int index) const |
| vecInt | GetSurfaceComponentBricksIndices () const |
| const vecInt & | GetLandCoverBricksIndices () const |
| vecStr | GetLandCoverBricksNames () const |
| const BrickSettings & | GetSubBasinBrickSettings (int index) const |
| const ProcessSettings & | GetProcessSettings (int index) const |
| const SplitterSettings & | GetHydroUnitSplitterSettings (int index) const |
| const SplitterSettings & | GetSubBasinSplitterSettings (int index) const |
| vecStr | GetSubBasinLogLabels () const |
| vecStr | GetSubBasinGenericLogLabels () const |
| vecStr | GetHydroUnitLogLabels () const |
| void | SetLogAll (bool logAll=true) |
| bool | LogAll () const |
| bool | IsValid () const |
| void | Validate () const |
Protected Member Functions | |
| bool | LogAll (const YAML::Node &settings) |
Protected Attributes | |
| bool | _logAll |
| vector< ModelStructure > | _modelStructures |
| SolverSettings | _solver |
| TimerSettings | _timer |
| ModelStructure * | _selectedStructure |
| BrickSettings * | _selectedBrick |
| ProcessSettings * | _selectedProcess |
| SplitterSettings * | _selectedSplitter |
| void SettingsModel::AddBrickForcing | ( | const string & | name | ) |
Add a forcing to the selected brick.
| name | name of the forcing. |
| void SettingsModel::AddBrickLogging | ( | const string & | itemName | ) |
Add logging to the selected brick.
| itemName | name of the item to log. |
| void SettingsModel::AddBrickLogging | ( | std::initializer_list< const string > | items | ) |
Add logging to a list of items in the selected brick.
| items | list of items to log. |
| void SettingsModel::AddBrickParameter | ( | const string & | name, |
| float | value, | ||
| const std::string & | type = "constant" ) |
Add a parameter to the selected brick.
| name | name of the parameter. |
| value | value of the parameter. |
| type | type of the parameter. |
| void SettingsModel::AddBrickProcess | ( | const string & | name, |
| const string & | type, | ||
| const string & | target = "", | ||
| bool | log = false ) |
Add a process to the selected brick.
| name | name of the process. |
| type | type of the process. |
| target | target of the process. |
| log | true if the process should be logged, false otherwise. |
| void SettingsModel::AddHydroUnitBrick | ( | const string & | name, |
| const std::string & | type = "storage" ) |
Add a hydro unit brick to the model (e.g. storage).
| name | name of the hydro unit brick. |
| type | type of the hydro unit brick. |
| void SettingsModel::AddHydroUnitSplitter | ( | const string & | name, |
| const string & | type ) |
Add a hydro unit splitter to the selected structure.
| name | name of the hydro unit splitter. |
| type | type of the hydro unit splitter. |
| void SettingsModel::AddLandCoverBrick | ( | const string & | name, |
| const string & | type ) |
Add a land cover brick to the model (e.g. glacier).
| name | name of the land cover brick. |
| type | type of the land cover brick. |
| void SettingsModel::AddLoggingToItem | ( | const string & | itemName | ) |
Add logging to a given item.
| itemName | name of the item to log. |
| void SettingsModel::AddLoggingToItems | ( | std::initializer_list< const string > | items | ) |
Add logging to a list of items.
| items | list of items to log. |
| void SettingsModel::AddProcessForcing | ( | const string & | name | ) |
Add a forcing to the selected process.
| name | name of the forcing. |
| void SettingsModel::AddProcessLogging | ( | const string & | itemName | ) |
Add logging to the selected process.
| itemName | name of the item to log. |
| void SettingsModel::AddProcessOutput | ( | const string & | target, |
| ContentType | fluxType = ContentType::Water ) |
Add an output to the selected process.
| target | target of the output. |
| fluxType | type of the flux. |
| void SettingsModel::AddProcessParameter | ( | const string & | name, |
| float | value, | ||
| const std::string & | type = "constant" ) |
Add a parameter to the selected process.
| name | name of the parameter. |
| value | value of the parameter. |
| type | type of the parameter. |
| void SettingsModel::AddSnowIceTransformation | ( | const string & | transformationProcess = "transform:snow_ice_swat" | ) |
Add a snow-ice transformation process to the model. This is used for glacier bricks to transform snow into ice.
| transformationProcess | name of the transformation process. |
| void SettingsModel::AddSnowRedistribution | ( | const string & | redistributionProcess = "transport:snow_slide", |
| bool | skipGlaciers = false ) |
Add a snow redistribution process to the model.
| redistributionProcess | name of the redistribution process. |
| skipGlaciers | if true, do not redistribute snow for snowpacks on glaciers. |
| void SettingsModel::AddSplitterForcing | ( | const string & | name | ) |
Add a forcing to the selected splitter.
| name | name of the forcing. |
| void SettingsModel::AddSplitterLogging | ( | const string & | itemName | ) |
Add logging to the selected splitter.
| itemName | name of the item to log. |
| void SettingsModel::AddSplitterOutput | ( | const string & | target, |
| const ContentType | fluxType = ContentType::Water ) |
Add an output to the selected splitter.
| target | target of the output. |
| fluxType | type of the flux. |
| void SettingsModel::AddSplitterParameter | ( | const string & | name, |
| float | value, | ||
| const std::string & | type = "constant" ) |
Add a parameter to the selected splitter.
| name | name of the parameter. |
| value | value of the parameter. |
| type | type of the parameter. |
| void SettingsModel::AddSubBasinBrick | ( | const string & | name, |
| const std::string & | type = "storage" ) |
Add a sub-basin brick to the model (e.g. lumped storage).
| name | name of the sub-basin brick. |
| type | type of the sub-basin brick. |
| void SettingsModel::AddSubBasinSplitter | ( | const string & | name, |
| const string & | type ) |
Add a sub-basin splitter to the selected structure.
| name | name of the sub-basin splitter. |
| type | type of the sub-basin splitter. |
| void SettingsModel::AddSurfaceComponentBrick | ( | const string & | name, |
| const string & | type ) |
Add a surface component brick to the model (e.g. snowpack).
| name | name of the surface component brick. |
| type | type of the surface component brick. |
| bool SettingsModel::BrickHasParameter | ( | const string & | name | ) |
Check if the selected brick has a parameter.
| name | name of the parameter. |
| void SettingsModel::GeneratePrecipitationSplitters | ( | bool | withSnow, |
| const string & | splitterType = "snow_rain:linear" ) |
Generate precipitation splitters (rain/snow).
| withSnow | true if snow is included, false otherwise. |
| splitterType | type of the rain/snow splitter (default: "snow_rain:linear"). |
| void SettingsModel::GenerateSnowpacks | ( | const string & | snowMeltProcess | ) |
Generate snowpacks.
| snowMeltProcess | name of the snow melt process. |
| void SettingsModel::GenerateSnowpacksWithWaterRetention | ( | const string & | snowMeltProcess, |
| const string & | outflowProcess ) |
Generate snowpacks with water retention.
| snowMeltProcess | name of the snow melt process. |
| outflowProcess | name of the outflow process. |
|
inline |
Get the number of hydro unit bricks in the selected structure.
|
inline |
Get the hydro unit brick settings by name.
| name | name of the hydro unit brick. |
|
inline |
Get the hydro unit brick settings by index.
| index | index of the hydro unit brick. |
| vecStr SettingsModel::GetHydroUnitLogLabels | ( | ) | const |
Get the logging labels for the hydro unit components
|
inline |
Get the number of hydro unit splitters in the selected structure.
|
inline |
Get the splitter settings by index.
| index | index of the splitter. |
|
inline |
Get the indices of the land cover bricks.
| vecStr SettingsModel::GetLandCoverBricksNames | ( | ) | const |
Get the names of the land cover bricks.
|
inline |
Get the number of processes in the selected brick.
|
inline |
Get the process settings by index.
| index | index of the process. |
|
inline |
Get the solver settings.
|
inline |
Get the number of structures in the model.
|
inline |
Get the number of sub-basin bricks in the selected structure.
|
inline |
Get the sub basin brick settings by index.
| index | index of the sub basin brick. |
| vecStr SettingsModel::GetSubBasinGenericLogLabels | ( | ) | const |
Get the generic logging labels for the sub basin components
| vecStr SettingsModel::GetSubBasinLogLabels | ( | ) | const |
Get the logging labels for the sub basin components
|
inline |
Get the number of sub-basin splitters in the selected structure.
|
inline |
Get the sub basin splitter settings by index.
| index | index of the sub basin splitter. |
|
inline |
Get the number of surface component bricks in the selected structure.
|
inline |
Get the surface component brick settings by index.
| index | index of the surface component brick. |
|
inline |
Get the indices of the surface component bricks.
|
inline |
Get the timer settings.
|
nodiscard |
Check if the settings model is valid. Verifies that critical settings are configured (solver, timer, structures).
|
inline |
Check if all components are logged.
| void SettingsModel::OutputProcessToSameBrick | ( | ) |
Set the outputs of the selected process to the same brick.
| void SettingsModel::SelectHydroUnitBrick | ( | const string & | name | ) |
Select a hydro unit brick by its name. Raise an exception if the brick is not found.
| name | name of the hydro unit brick. |
| void SettingsModel::SelectHydroUnitBrick | ( | int | index | ) |
Select a hydro unit brick by its index.
| index | index of the hydro unit brick. |
| void SettingsModel::SelectHydroUnitBrickByName | ( | const string & | name | ) |
Select a hydro unit brick by its name. Raise an exception if the brick is not found. Same as SelectHydroUnitBrick, but used in the Python bindings.
| name | name of the hydro unit brick. |
| bool SettingsModel::SelectHydroUnitBrickIfFound | ( | const string & | name | ) |
Select a hydro unit brick by its name. Tolerate if the brick is not found.
| name | name of the hydro unit brick. |
| void SettingsModel::SelectHydroUnitSplitter | ( | const string & | name | ) |
Select a hydro unit splitter by its name. Raise an exception if the splitter is not found.
| name | name of the hydro unit splitter. |
| void SettingsModel::SelectHydroUnitSplitter | ( | int | index | ) |
Select a hydro unit splitter by its index.
| index | index of the hydro unit splitter. |
| bool SettingsModel::SelectHydroUnitSplitterIfFound | ( | const string & | name | ) |
Select a hydro unit splitter by its name. Tolerate if the splitter is not found.
| name | name of the hydro unit splitter. |
| void SettingsModel::SelectProcess | ( | const string & | name | ) |
Select a process by its name.
| name | name of the process. |
| void SettingsModel::SelectProcess | ( | int | index | ) |
Select a process by its index.
| index | index of the process. |
| void SettingsModel::SelectProcessWithParameter | ( | const string & | name | ) |
Select a process by one of its parameter name.
| name | name of the process. |
| bool SettingsModel::SelectStructure | ( | int | id | ) |
Select a structure by its ID.
| id | ID of the structure. |
| void SettingsModel::SelectSubBasinBrick | ( | const string & | name | ) |
Select a sub-basin brick by its name. Raise an exception if the brick is not found.
| name | name of the sub-basin brick. |
| void SettingsModel::SelectSubBasinBrick | ( | int | index | ) |
Select a sub-basin brick by its index.
| index | index of the sub-basin brick. |
| bool SettingsModel::SelectSubBasinBrickIfFound | ( | const string & | name | ) |
Select a sub-basin brick by its name. Tolerate if the brick is not found.
| name | name of the sub-basin brick. |
| void SettingsModel::SelectSubBasinSplitter | ( | const string & | name | ) |
Select a sub-basin splitter by its name. Raise an exception if the splitter is not found.
| name | name of the sub-basin splitter. |
| void SettingsModel::SelectSubBasinSplitter | ( | int | index | ) |
Select a sub-basin splitter by its index.
| index | index of the sub-basin splitter. |
| bool SettingsModel::SelectSubBasinSplitterIfFound | ( | const string & | name | ) |
Select a sub-basin splitter by its name. Tolerate if the splitter is not found.
| name | name of the sub-basin splitter. |
| void SettingsModel::SetBrickParameterValue | ( | const string & | name, |
| float | value, | ||
| const std::string & | type = "constant" ) |
Set the value of a parameter of the selected brick.
| name | name of the parameter. |
| value | value of the parameter. |
| type | type of the parameter. |
| void SettingsModel::SetCurrentBrickComputedDirectly | ( | ) |
Mark the selected brick as computed directly (explicitly, without the ODE solver). Used for fully explicit formulations such as the GR4J production store and routing, where processes apply an exact discrete update each time step.
|
inline |
Flag to log all components.
| logAll | true to log all components, false to log only the selected ones. |
| bool SettingsModel::SetParameterValue | ( | const string & | component, |
| const string & | name, | ||
| float | value ) |
Set parameter value for a component.
| component | name of the component. |
| name | name of the parameter. |
| value | value of the parameter. |
| void SettingsModel::SetProcessOutputsAsInstantaneous | ( | ) |
Set the outputs of the selected process as instantaneous.
| void SettingsModel::SetProcessOutputsAsStatic | ( | ) |
Set the outputs of the selected process as static.
| void SettingsModel::SetProcessParameterValue | ( | const string & | name, |
| float | value, | ||
| const std::string & | type = "constant" ) |
Set the value of the selected process parameter.
| name | name of the parameter. |
| value | value of the parameter. |
| type | type of the parameter. |
| void SettingsModel::SetSolver | ( | const string & | solverName | ) |
Set the solver name.
| solverName | name of the solver. |
| void SettingsModel::SetSplitterParameterValue | ( | const string & | name, |
| float | value, | ||
| const std::string & | type = "constant" ) |
Set the value of the selected splitter parameter.
| name | name of the parameter. |
| value | value of the parameter. |
| type | type of the parameter. |
| void SettingsModel::SetSurfaceComponentParent | ( | const string & | name | ) |
Set the parent of the selected surface component brick.
| name | name of the parent brick. |
| void SettingsModel::SetTimer | ( | const string & | start, |
| const string & | end, | ||
| int | timeStep, | ||
| const string & | timeStepUnit ) |
Set the timer settings.
| start | start date. |
| end | end date. |
| timeStep | time step. |
| timeStepUnit | time step unit. |
| void SettingsModel::Validate | ( | ) | const |
Validate the settings model. Throws an exception if the settings are invalid.
| ModelConfigError | if validation fails. |