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

Public Member Functions

void InitContainers (int timeSize, SubBasin *subBasin, SettingsModel &modelSettings)
 
void Reset ()
 
void SetSubBasinValuePointer (int iLabel, double *valPt)
 
void SetHydroUnitValuePointer (int iUnit, int iLabel, double *valPt)
 
void SetHydroUnitFractionPointer (int iUnit, int iLabel, double *valPt)
 
void SetDate (double date)
 
void SaveInitialValues ()
 
void Record ()
 
void Increment ()
 
bool DumpOutputs (const string &path)
 
axd GetOutletDischarge () const
 
vecInt GetIndicesForSubBasinElements (const string &item) const
 
vecInt GetIndicesForHydroUnitElements (const string &item) const
 
double GetTotalSubBasin (const string &item) const
 
double GetTotalHydroUnits (const string &item, bool needsAreaWeighting=false) const
 
double GetTotalOutletDischarge () const
 
double GetTotalET () const
 
double GetSubBasinInitialStorageState (const string &tag) const
 
double GetSubBasinFinalStorageState (const string &tag) const
 
double GetHydroUnitsInitialStorageState (const string &tag) const
 
double GetHydroUnitsFinalStorageState (const string &tag) const
 
double GetTotalWaterStorageChanges () const
 
double GetTotalSnowStorageChanges () const
 
double GetTotalGlacierStorageChanges () const
 
const vecAxd & GetSubBasinValues () const
 
const vecAxxd & GetHydroUnitValues () const
 
const axd & GetTime () const
 
const vecInt & GetHydroUnitIds () const
 
const axd & GetHydroUnitAreas () const
 
const vecStr & GetSubBasinLabels () const
 
const vecStr & GetHydroUnitLabels () const
 
const vecStr & GetHydroUnitFractionLabels () const
 
const vecAxxd & GetHydroUnitFractions () const
 
void RecordFractions ()
 

Protected Attributes

int _cursor
 
axd _time
 
bool _recordFractions
 
vecStr _subBasinLabels
 
axd _subBasinInitialValues
 
vecAxd _subBasinValues
 
vecDoublePt _subBasinValuesPt
 
vecInt _hydroUnitIds
 
axd _hydroUnitAreas
 
vecStr _hydroUnitLabels
 
vecAxd _hydroUnitInitialValues
 
vecAxxd _hydroUnitValues
 
vector< vecDoublePt > _hydroUnitValuesPt
 
vecStr _hydroUnitFractionLabels
 
vecAxxd _hydroUnitFractions
 
vector< vecDoublePt > _hydroUnitFractionsPt
 

Member Function Documentation

◆ DumpOutputs()

bool Logger::DumpOutputs ( const string & path)

Dump the outputs to a file.

Parameters
pathpath to the output file.
Returns
true if the dump was successful, false otherwise.

◆ GetHydroUnitAreas()

const axd & Logger::GetHydroUnitAreas ( ) const
inline

Get the hydro unit areas.

Returns
vector of hydro unit areas.

◆ GetHydroUnitFractionLabels()

const vecStr & Logger::GetHydroUnitFractionLabels ( ) const
inline

Get the hydro unit fraction labels.

Returns
vector of fraction labels.

◆ GetHydroUnitFractions()

const vecAxxd & Logger::GetHydroUnitFractions ( ) const
inline

Get the hydro unit fractions.

Returns
vector of fraction arrays.

◆ GetHydroUnitIds()

const vecInt & Logger::GetHydroUnitIds ( ) const
inline

Get the hydro unit IDs.

Returns
vector of hydro unit IDs.

◆ GetHydroUnitLabels()

const vecStr & Logger::GetHydroUnitLabels ( ) const
inline

Get the hydro unit labels.

Returns
vector of hydro unit labels.

◆ GetHydroUnitsFinalStorageState()

double Logger::GetHydroUnitsFinalStorageState ( const string & tag) const

Get the final storage state of a hydro unit for a given tag.

Parameters
tagtag to search for.
Returns
final storage state.

◆ GetHydroUnitsInitialStorageState()

double Logger::GetHydroUnitsInitialStorageState ( const string & tag) const

Get the initial storage state of a hydro unit for a given tag.

Parameters
tagtag to search for.
Returns
initial storage state.

◆ GetHydroUnitValues()

const vecAxxd & Logger::GetHydroUnitValues ( ) const
inline

Get all the hydro unit values.

Returns
vector of hydro unit values.

◆ GetIndicesForHydroUnitElements()

vecInt Logger::GetIndicesForHydroUnitElements ( const string & item) const

Get the indices of the hydro unit elements for a given item.

Parameters
itemitem to search for.
Returns
vector of indices.

◆ GetIndicesForSubBasinElements()

vecInt Logger::GetIndicesForSubBasinElements ( const string & item) const

Get the indices of the sub-basin elements for a given item.

Parameters
itemitem to search for.
Returns
vector of indices.

◆ GetOutletDischarge()

axd Logger::GetOutletDischarge ( ) const

Get the outlet discharge series.

Returns
outlet discharge series.

◆ GetSubBasinFinalStorageState()

double Logger::GetSubBasinFinalStorageState ( const string & tag) const

Get the final storage state of a sub-basin for a given tag.

Parameters
tagtag to search for.
Returns
final storage state.

◆ GetSubBasinInitialStorageState()

double Logger::GetSubBasinInitialStorageState ( const string & tag) const

Get the initial storage state of a sub-basin for a given tag.

Parameters
tagtag to search for.
Returns
initial storage state.

◆ GetSubBasinLabels()

const vecStr & Logger::GetSubBasinLabels ( ) const
inline

Get the sub-basin labels.

Returns
vector of sub-basin labels.

◆ GetSubBasinValues()

const vecAxd & Logger::GetSubBasinValues ( ) const
inline

Get all the sub-basin values.

Returns
vector of sub-basin values.

◆ GetTime()

const axd & Logger::GetTime ( ) const
inline

Get the time series.

Returns
time series vector.

◆ GetTotalET()

double Logger::GetTotalET ( ) const

Get the total ET over time.

Returns
total ET.

◆ GetTotalGlacierStorageChanges()

double Logger::GetTotalGlacierStorageChanges ( ) const

Get the total glacier storage changes.

Returns
the total glacier storage changes.

◆ GetTotalHydroUnits()

double Logger::GetTotalHydroUnits ( const string & item,
bool needsAreaWeighting = false ) const

Get the sum of hydro unit values for a given item.

Parameters
itemitem to search for.
needsAreaWeightingif true, area weighting is applied.
Returns
total value.

◆ GetTotalOutletDischarge()

double Logger::GetTotalOutletDischarge ( ) const

Get the total outlet discharge over time.

Returns
total outlet discharge.

◆ GetTotalSnowStorageChanges()

double Logger::GetTotalSnowStorageChanges ( ) const

Get the total snow storage changes.

Returns
the total snow storage changes.

◆ GetTotalSubBasin()

double Logger::GetTotalSubBasin ( const string & item) const

Get the sum of a sub-basin values for a given item.

Parameters
itemitem to search for.
Returns
total value.

◆ GetTotalWaterStorageChanges()

double Logger::GetTotalWaterStorageChanges ( ) const

Get the total water storage changes.

Returns
the total water storage changes.

◆ Increment()

void Logger::Increment ( )

Increment the cursor to the next time step.

◆ InitContainers()

void Logger::InitContainers ( int timeSize,
SubBasin * subBasin,
SettingsModel & modelSettings )

Initialize the logger with the size of the time vector and the sub-basin object.

Parameters
timeSizesize of the time vector.
subBasinpointer to the sub-basin object.
modelSettingssettings of the model.

◆ Record()

void Logger::Record ( )

Record the current values in the logger.

◆ RecordFractions()

void Logger::RecordFractions ( )
inline

Activate the recording of fractions.

◆ Reset()

void Logger::Reset ( )

Reset the logger.

◆ SaveInitialValues()

void Logger::SaveInitialValues ( )

Save the current values as initial values.

◆ SetDate()

void Logger::SetDate ( double date)

Set the date in the logger.

Parameters
datedate to set.

◆ SetHydroUnitFractionPointer()

void Logger::SetHydroUnitFractionPointer ( int iUnit,
int iLabel,
double * valPt )

Set a hydro unit fraction pointer in the logger array.

Parameters
iUnitindex of the hydro unit.
iLabelindex of the hydro unit label.
valPtpointer to the value.

◆ SetHydroUnitValuePointer()

void Logger::SetHydroUnitValuePointer ( int iUnit,
int iLabel,
double * valPt )

Set a hydro unit value pointer in the logger array.

Parameters
iUnitindex of the hydro unit.
iLabelindex of the hydro unit label.
valPtpointer to the value.

◆ SetSubBasinValuePointer()

void Logger::SetSubBasinValuePointer ( int iLabel,
double * valPt )

Set a sub-basin value pointer in the logger array.

Parameters
iLabelindex of the sub-basin label.
valPtpointer to the value.

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