|
hydrobricks
|
#include <SolverSequential.h>
Public Member Functions | |
| void | InitializeContainers () override |
| bool | Solve (double timeStepInDays) final |
Public Member Functions inherited from Solver | |
| void | Connect (Processor *processor) |
Protected Member Functions | |
| virtual void | ComputeBrickRates (Brick *brick, double content, double inflow, double timeStepInDays, int iRateStart)=0 |
Static Protected Member Functions | |
| static double | TotalRateAt (Brick *brick, double *contentDelta, double offset) |
| static void | StoreRatesAtCurrentContent (Brick *brick, vecDouble &rates) |
Protected Attributes | |
| axd | _rates |
Protected Attributes inherited from Solver | |
| Processor * | _processor |
Additional Inherited Members | |
Static Public Member Functions inherited from Solver | |
| static std::unique_ptr< Solver > | Factory (const SolverSettings &solverSettings) |
Base class for the sequential solvers.
The bricks are processed one by one in declaration order (upstream before downstream). Each brick receives its inflows as a constant rate over the time step; the subclass computes the brick's average outflow rates over the step. The resulting rates go through the standard constraint and flux machinery, so water propagates through a cascade within the same step.
|
protectedpure virtual |
Compute the average outflow rates of the brick over the time step and store them in the _rates slice starting at iRateStart (one value per process connection, in process declaration order).
| brick | The brick to solve. |
| content | Start-of-step content [mm], including instantaneous deposits. |
| inflow | Inflows as a constant rate over the step [mm/d]. |
| timeStepInDays | The time step in days. |
| iRateStart | Index of the brick's first connection in _rates. |
Implemented in SolverAnalyticLinear, SolverCrankNicolson, SolverExponentialEuler, and SolverImplicitEuler.
|
overridevirtual |
|
finalvirtual |
Apply the solver.
| timeStepInDays | The time step in days. |
Implements Solver.
|
staticprotected |
Store the per-connection rates of the brick's processes, evaluated at the current content, into the provided vector (resized to the connection count).
| brick | The brick to evaluate. |
| rates | The vector receiving the rates. |
|
staticprotected |
Sum the rates of all processes of the brick, evaluated at the given content offset. Temporarily writes the offset into the container's dynamic change; the caller must restore it to zero before the constraint pass.
| brick | The brick to evaluate. |
| contentDelta | Pointer to the container's dynamic content change. |
| offset | Content offset from the start-of-step content [mm]. |