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

Public Member Functions

bool Initialize (SettingsBasin &basinSettings)
 
void BuildBasin (SettingsBasin &basinSettings)
 
bool AssignFractions (SettingsBasin &basinSettings)
 
void Reset ()
 
void SaveAsInitialState ()
 
bool IsOk ()
 
void AddBrick (Brick *brick)
 
void AddSplitter (Splitter *splitter)
 
void AddHydroUnit (HydroUnit *unit)
 
int GetHydroUnitsNb ()
 
HydroUnitGetHydroUnit (int index)
 
HydroUnitGetHydroUnitById (int id)
 
vecInt GetHydroUnitIds ()
 
vecDouble GetHydroUnitAreas ()
 
int GetBricksCount ()
 
int GetSplittersCount ()
 
BrickGetBrick (int index)
 
bool HasBrick (const string &name)
 
BrickGetBrick (const string &name)
 
SplitterGetSplitter (int index)
 
bool HasSplitter (const string &name)
 
SplitterGetSplitter (const string &name)
 
bool HasIncomingFlow ()
 
void AddInputConnector (Connector *connector)
 
void AddOutputConnector (Connector *connector)
 
void AttachOutletFlux (Flux *pFlux)
 
double * GetValuePointer (const string &name)
 
bool ComputeOutletDischarge ()
 
double GetArea ()
 

Protected Attributes

double m_area
 
double m_outletTotal
 
bool m_needsCleanup
 
vector< Brick * > m_bricks
 
vector< Splitter * > m_splitters
 
vector< HydroUnit * > m_hydroUnits
 
vector< Connector * > m_inConnectors
 
vector< Connector * > m_outConnectors
 
vector< Flux * > m_outletFluxes
 

Member Function Documentation

◆ AddBrick()

void SubBasin::AddBrick ( Brick * brick)

Add a brick to the sub-basin.

Parameters
brickThe brick to add.

◆ AddHydroUnit()

void SubBasin::AddHydroUnit ( HydroUnit * unit)

Check a hydro unit to the sub-basin.

Parameters
unitThe hydro unit to add.

◆ AddInputConnector()

void SubBasin::AddInputConnector ( Connector * connector)

Add an input connector to the sub-basin.

Parameters
connectorThe input connector to add.

◆ AddOutputConnector()

void SubBasin::AddOutputConnector ( Connector * connector)

Add an output connector to the sub-basin.

Parameters
connectorThe output connector to add.

◆ AddSplitter()

void SubBasin::AddSplitter ( Splitter * splitter)

Add a splitter to the sub-basin.

Parameters
splitterThe splitter to add.

◆ AssignFractions()

bool SubBasin::AssignFractions ( SettingsBasin & basinSettings)

Assign the fractions of the basin.

Parameters
basinSettingsThe settings to assign the fractions with.
Returns
True if the assignment was successful, false otherwise.

◆ AttachOutletFlux()

void SubBasin::AttachOutletFlux ( Flux * pFlux)

Attach an outlet flux to the sub-basin.

Parameters
pFluxThe outlet flux to attach.

◆ BuildBasin()

void SubBasin::BuildBasin ( SettingsBasin & basinSettings)

Build the basin with the given settings.

Parameters
basinSettingsThe settings to build the basin with.

◆ ComputeOutletDischarge()

bool SubBasin::ComputeOutletDischarge ( )

GCompute the outlet discharge for the sub-basin.

Returns
True if the computation was successful, false otherwise.

◆ GetArea()

double SubBasin::GetArea ( )
inline

Get the area of the sub-basin.

Returns
The area of the sub-basin in square meters.

◆ GetBrick() [1/2]

Brick * SubBasin::GetBrick ( const string & name)

Get a brick by its name.

Parameters
nameThe name of the brick to get.
Returns
The brick with the specified name.

◆ GetBrick() [2/2]

Brick * SubBasin::GetBrick ( int index)

Get a brick by its index.

Parameters
indexThe index of the brick to get.
Returns
The brick at the specified index.

◆ GetBricksCount()

int SubBasin::GetBricksCount ( )

Get the number of bricks in the sub-basin.

Returns
The number of bricks.

◆ GetHydroUnit()

HydroUnit * SubBasin::GetHydroUnit ( int index)

Get a hydro unit by its index.

Parameters
indexThe index of the hydro unit to get.
Returns
The hydro unit at the specified index.

◆ GetHydroUnitAreas()

vecDouble SubBasin::GetHydroUnitAreas ( )

Get the areas of all hydro units in the sub-basin.

Returns
A vector of hydro unit areas.

◆ GetHydroUnitById()

HydroUnit * SubBasin::GetHydroUnitById ( int id)

Get a hydro unit by its ID.

Parameters
idThe ID of the hydro unit to get.
Returns
The hydro unit with the specified ID.

◆ GetHydroUnitIds()

vecInt SubBasin::GetHydroUnitIds ( )

Get the IDs of all hydro units in the sub-basin.

Returns
A vector of hydro unit IDs.

◆ GetHydroUnitsNb()

int SubBasin::GetHydroUnitsNb ( )

Get the number of hydro units in the sub-basin.

Returns
The number of hydro units.

◆ GetSplitter() [1/2]

Splitter * SubBasin::GetSplitter ( const string & name)

Get a splitter by its name.

Parameters
nameThe name of the splitter to get.
Returns
The splitter with the specified name.

◆ GetSplitter() [2/2]

Splitter * SubBasin::GetSplitter ( int index)

Get a splitter by its index.

Parameters
indexThe index of the splitter to get.
Returns
The splitter at the specified index.

◆ GetSplittersCount()

int SubBasin::GetSplittersCount ( )

Get the number of splitters in the sub-basin.

Returns
The number of splitters.

◆ GetValuePointer()

double * SubBasin::GetValuePointer ( const string & name)

Get the value pointer for a specific variable.

Parameters
nameThe name of the variable to get the pointer for.
Returns
A pointer to the variable's value.

◆ HasBrick()

bool SubBasin::HasBrick ( const string & name)

Check if the sub-basin has a brick with a specific name.

Parameters
nameThe name of the brick to check for.
Returns
True if the sub-basin has the brick, false otherwise.

◆ HasIncomingFlow()

bool SubBasin::HasIncomingFlow ( )

Check if the sub-basin has an incoming flow.

Returns
True if the sub-basin has an incoming flow, false otherwise.

◆ HasSplitter()

bool SubBasin::HasSplitter ( const string & name)

Check if the sub-basin has a splitter with a specific name.

Parameters
nameThe name of the splitter to check for.
Returns
True if the sub-basin has the splitter, false otherwise.

◆ Initialize()

bool SubBasin::Initialize ( SettingsBasin & basinSettings)

Initialize the sub-basin with the given settings.

Parameters
basinSettingsThe settings to initialize the sub-basin with.
Returns
True if the initialization was successful, false otherwise.

◆ IsOk()

bool SubBasin::IsOk ( )

Check if the sub-basin is valid.

Returns
True if the sub-basin is valid, false otherwise.

◆ Reset()

void SubBasin::Reset ( )

Reset the sub-basin to its initial state.

◆ SaveAsInitialState()

void SubBasin::SaveAsInitialState ( )

Save the current state of the sub-basin as the initial state.


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