A time loop with a check point mechanism. More...
#include <dumux/common/timeloop.hh>
A time loop with a check point mechanism.
Public Member Functions | |
CheckPointTimeLoop (Scalar startTime, Scalar dt, Scalar tEnd, bool verbose=true) | |
void | advanceTimeStep () override |
Advance time step. More... | |
Scalar | maxTimeStepSize () const override |
The current maximum time step size. More... | |
void | setPeriodicCheckPoint (Scalar interval, Scalar offset=0.0) |
Set a periodic check point. More... | |
void | disablePeriodicCheckPoints () |
disable periodic check points More... | |
void | removeAllCheckPoints () |
remove all check points More... | |
bool | isCheckPoint () const |
Whether now is a time checkpoint. More... | |
void | setCheckPoint (Scalar t) |
add a checkpoint to the queue More... | |
void | setCheckPoint (const std::vector< Scalar > &checkPoints) |
add checkpoints to the queue from a vector of time points More... | |
template<class ForwardIterator > | |
void | setCheckPoint (ForwardIterator first, ForwardIterator last) |
add checkpoints to the queue from a container from the first iterator to the last iterator More... | |
Simulated time and time step management | |
void | start () |
Tells the time loop to start tracking the time. More... | |
double | stop () |
Tells the time loop to stop tracking the time. More... | |
void | resetTimer () |
Reset the timer. More... | |
void | reset (Scalar startTime, Scalar dt, Scalar tEnd, bool verbose=true) |
Reset the time loop. More... | |
void | setTime (Scalar t) |
Set the current simulated time, don't change the current time step index. More... | |
void | setTime (Scalar t, int stepIdx) |
Set the current simulated time and the time step index. More... | |
Scalar | time () const final |
Return the time \(\mathrm{[s]}\) before the time integration. To get the time after the time integration you have to add timeStepSize() to time(). More... | |
Scalar | endTime () const |
Returns the number of (simulated) seconds which the simulation runs. More... | |
void | setEndTime (Scalar t) |
Set the time of simulated seconds at which the simulation runs. More... | |
double | wallClockTime () const |
Returns the current wall clock time (cpu time) spend in this time loop. More... | |
void | setTimeStepSize (Scalar dt) final |
Set the current time step size to a given value. More... | |
void | setMaxTimeStepSize (Scalar maxDt) |
Set the maximum time step size to a given value. More... | |
Scalar | timeStepSize () const final |
Returns the suggested time step length \(\mathrm{[s]}\) so that we don't miss the beginning of the next episode or cross the end of the simulation. More... | |
int | timeStepIndex () const |
Returns number of time steps which have been executed since the beginning of the simulation. More... | |
Scalar | previousTimeStepSize () const |
The previous time step size. More... | |
void | setFinished (bool finished=true) |
Specify whether the simulation is finished. More... | |
bool | finished () const override |
Returns true if the simulation is finished. More... | |
bool | willBeFinished () const |
Returns true if the simulation is finished after the time level is incremented by the current time step size. More... | |
void | reportTimeStep () const |
State info on cpu time. More... | |
template<class Communicator = Dune::CollectiveCommunication<typename Dune::MPIHelper::MPICommunicator>> | |
void | finalize (const Communicator &comm=Dune::MPIHelper::getCollectiveCommunication()) |
Print final status and stops tracking the time. More... | |
bool | verbose () const |
If the time loop has verbose output. More... | |
void | setVerbose (bool verbose=true) |
Sets time loop verbosity. More... | |
Dune::Timer | timer_ |
Scalar | time_ |
Scalar | endTime_ |
Scalar | timeStepSize_ |
Scalar | previousTimeStepSize_ |
Scalar | userSetMaxTimeStepSize_ |
Scalar | timeAfterLastTimeStep_ |
Scalar | timeStepWallClockTime_ |
int | timeStepIdx_ |
bool | finished_ |
bool | verbose_ |
|
inline |
|
inlineoverridevirtual |
Advance time step.
Check point management, TimeLoop::isCheckPoint() has to be called after this!
Reimplemented from Dumux::TimeLoop< Scalar >.
|
inline |
disable periodic check points
|
inlineinherited |
Returns the number of (simulated) seconds which the simulation runs.
|
inlineinherited |
Print final status and stops tracking the time.
|
inlineoverridevirtualinherited |
Returns true if the simulation is finished.
This is the case if either setFinished(true) has been called or if the end time is reached.
Implements Dumux::TimeLoopBase< Scalar >.
|
inline |
Whether now is a time checkpoint.
|
inlineoverridevirtual |
The current maximum time step size.
Reimplemented from Dumux::TimeLoop< Scalar >.
|
inlineinherited |
The previous time step size.
|
inline |
remove all check points
|
inlineinherited |
State info on cpu time.
|
inlineinherited |
Reset the time loop.
|
inlineinherited |
Reset the timer.
|
inline |
add checkpoints to the queue from a vector of time points
checkPoints | the vector of check points |
|
inline |
add checkpoints to the queue from a container from the first iterator to the last iterator
first | iterator to the first element to be inserted |
last | iterator to the one-after-last element to be inserted |
|
inline |
add a checkpoint to the queue
t | the check point (in seconds) |
|
inlineinherited |
Set the time of simulated seconds at which the simulation runs.
t | The time \(\mathrm{[s]}\) at which the simulation is finished |
|
inlineinherited |
Specify whether the simulation is finished.
finished | If true the simulation is considered finished before the end time is reached, else it is only considered finished if the end time is reached. |
|
inlineinherited |
Set the maximum time step size to a given value.
maxDt | The new value for the maximum time step size \(\mathrm{[s]}\) |
|
inline |
Set a periodic check point.
interval | Set a periodic checkout every [interval] seconds |
offset | time from which the periodic check points are supposed to start (simulation time) the first checkpoint will be at time = offset. |
|
inlineinherited |
Set the current simulated time, don't change the current time step index.
t | The time \(\mathrm{[s]}\) which should be jumped to |
|
inlineinherited |
Set the current simulated time and the time step index.
t | The time \(\mathrm{[s]}\) which should be jumped to |
stepIdx | The new time step index |
|
inlinefinalvirtualinherited |
Set the current time step size to a given value.
If the step size would exceed the length of the current episode, the timeStep() method will take care that the step size won't exceed the episode or the end of the simulation, though.
dt | The new value for the time step size \(\mathrm{[s]}\) |
Implements Dumux::TimeLoopBase< Scalar >.
|
inlineinherited |
Sets time loop verbosity.
|
inlineinherited |
Tells the time loop to start tracking the time.
|
inlineinherited |
Tells the time loop to stop tracking the time.
|
inlinefinalvirtualinherited |
Return the time \(\mathrm{[s]}\) before the time integration. To get the time after the time integration you have to add timeStepSize() to time().
Implements Dumux::TimeLoopBase< Scalar >.
|
inlineinherited |
Returns number of time steps which have been executed since the beginning of the simulation.
|
inlinefinalvirtualinherited |
Returns the suggested time step length \(\mathrm{[s]}\) so that we don't miss the beginning of the next episode or cross the end of the simulation.
Implements Dumux::TimeLoopBase< Scalar >.
|
inlineinherited |
If the time loop has verbose output.
|
inlineinherited |
Returns the current wall clock time (cpu time) spend in this time loop.
|
inlineinherited |
Returns true if the simulation is finished after the time level is incremented by the current time step size.
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |