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 ()
 
vecInt GetIndicesForSubBasinElements (const string &item)
 
vecInt GetIndicesForHydroUnitElements (const string &item)
 
double GetTotalSubBasin (const string &item)
 
double GetTotalHydroUnits (const string &item, bool needsAreaWeighting=false)
 
double GetTotalOutletDischarge ()
 
double GetTotalET ()
 
double GetSubBasinInitialStorageState (const string &tag)
 
double GetSubBasinFinalStorageState (const string &tag)
 
double GetHydroUnitsInitialStorageState (const string &tag)
 
double GetHydroUnitsFinalStorageState (const string &tag)
 
double GetTotalWaterStorageChanges ()
 
double GetTotalSnowStorageChanges ()
 
double GetTotalGlacierStorageChanges ()
 
const vecAxd & GetSubBasinValues ()
 
const vecAxxd & GetHydroUnitValues ()
 
void RecordFractions ()
 

Protected Attributes

int m_cursor
 
axd m_time
 
bool m_recordFractions
 
vecStr m_subBasinLabels
 
axd m_subBasinInitialValues
 
vecAxd m_subBasinValues
 
vecDoublePt m_subBasinValuesPt
 
vecInt m_hydroUnitIds
 
axd m_hydroUnitAreas
 
vecStr m_hydroUnitLabels
 
vecAxd m_hydroUnitInitialValues
 
vecAxxd m_hydroUnitValues
 
vector< vecDoublePt > m_hydroUnitValuesPt
 
vecStr m_hydroUnitFractionLabels
 
vecAxxd m_hydroUnitFractions
 
vector< vecDoublePt > m_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.

◆ GetHydroUnitsFinalStorageState()

double Logger::GetHydroUnitsFinalStorageState ( const string & tag)

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)

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 ( )
inline

Get all the hydro unit values.

Returns
vector of hydro unit values.

◆ GetIndicesForHydroUnitElements()

vecInt Logger::GetIndicesForHydroUnitElements ( const string & item)

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)

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 ( )

Get the outlet discharge series.

Returns
outlet discharge series.

◆ GetSubBasinFinalStorageState()

double Logger::GetSubBasinFinalStorageState ( const string & tag)

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)

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

Parameters
tagtag to search for.
Returns
initial storage state.

◆ GetSubBasinValues()

const vecAxd & Logger::GetSubBasinValues ( )
inline

Get all the sub-basin values.

Returns
vector of sub-basin values.

◆ GetTotalET()

double Logger::GetTotalET ( )

Get the total ET over time.

Returns
total ET.

◆ GetTotalGlacierStorageChanges()

double Logger::GetTotalGlacierStorageChanges ( )

Get the total glacier storage changes over time.

Returns
total glacier storage changes.

◆ GetTotalHydroUnits()

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

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 ( )

Get the total outlet discharge over time.

Returns
total outlet discharge.

◆ GetTotalSnowStorageChanges()

double Logger::GetTotalSnowStorageChanges ( )

Get the total snow storage changes over time.

Returns
total snow storage changes.

◆ GetTotalSubBasin()

double Logger::GetTotalSubBasin ( const string & item)

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

Parameters
itemitem to search for.
Returns
total value.

◆ GetTotalWaterStorageChanges()

double Logger::GetTotalWaterStorageChanges ( )

Get the total water storage changes over time.

Returns
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: