hydrobricks
Loading...
Searching...
No Matches
Solver Class Referenceabstract
Inheritance diagram for Solver:
SolverEulerExplicit SolverHeunExplicit SolverRK4

Public Member Functions

virtual bool Solve ()=0
 
void Connect (Processor *processor)
 
void InitializeContainers ()
 

Static Public Member Functions

static SolverFactory (const SolverSettings &solverSettings)
 

Protected Member Functions

void SaveStateVariables (int col)
 
void ComputeChangeRates (int col, bool applyConstraints=true)
 
void ApplyConstraintsFor (int col)
 
void ResetStateVariableChanges ()
 
void SetStateVariablesToIteration (int col)
 
void SetStateVariablesToAvgOf (int col1, int col2)
 
void ApplyProcesses (int col) const
 
void ApplyProcesses (const axd &changeRates) const
 
void Finalize () const
 

Protected Attributes

Processorm_processor
 
axxd m_stateVariableChanges
 
axxd m_changeRates
 
int m_nIterations
 

Member Function Documentation

◆ ApplyConstraintsFor()

void Solver::ApplyConstraintsFor ( int  col)
protected

Enforce the constraints for the change rates in the provided column.

Parameters
colThe column (= iteration) of the internal storage containing the change rates.

◆ ApplyProcesses() [1/2]

void Solver::ApplyProcesses ( const axd &  changeRates) const
protected

Apply the changes to the processes using the provided change rates.

Parameters
changeRatesThe change rate values to use.

◆ ApplyProcesses() [2/2]

void Solver::ApplyProcesses ( int  col) const
protected

Apply the changes to the processes.

Parameters
colThe column (= iteration) of the internal storage containing the change rates to use.

◆ ComputeChangeRates()

void Solver::ComputeChangeRates ( int  col,
bool  applyConstraints = true 
)
protected

Compute the change rates of all processes.

Parameters
colThe column of the internal storage where the change rates must be saved (= iteration).
applyConstraintsOption to apply the constraints (e.g., storage max capacity).

◆ Connect()

void Solver::Connect ( Processor processor)
inline

Connect the solver to a processor.

Parameters
processorThe processor to connect with.

◆ Factory()

Solver * Solver::Factory ( const SolverSettings solverSettings)
static

Create the solver based on the provided settings.

Parameters
solverSettingsThe solver settings.
Returns
A new generated solver.

◆ Finalize()

void Solver::Finalize ( ) const
protected

Apply all changes.

◆ InitializeContainers()

void Solver::InitializeContainers ( )

Initialize the internal containers to the needed size.

◆ ResetStateVariableChanges()

void Solver::ResetStateVariableChanges ( )
protected

Reset the stored state variable changes to zero.

◆ SaveStateVariables()

void Solver::SaveStateVariables ( int  col)
protected

Save the state variables.

Parameters
colThe column of the internal storage where the state variables must be saved.

◆ SetStateVariablesToAvgOf()

void Solver::SetStateVariablesToAvgOf ( int  col1,
int  col2 
)
protected

Set the state variables to use to the average values of the selected iterations (columns).

Parameters
col1The first column (= iteration) of the internal storage containing the state variables to use.
col2The second column (= iteration) of the internal storage containing the state variables to use.

◆ SetStateVariablesToIteration()

void Solver::SetStateVariablesToIteration ( int  col)
protected

Set the state variables to use to the values of the selected iteration (column).

Parameters
colThe column (= iteration) of the internal storage containing the state variables to use.

◆ Solve()

virtual bool Solver::Solve ( )
pure virtual

Apply the solver.

Returns
True if success, false otherwise.

Implemented in SolverEulerExplicit, SolverHeunExplicit, and SolverRK4.


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