The default time loop for instationary simulations. More...
#include <dumux/common/timeloop.hh>
The default time loop for instationary simulations.
Public Member Functions | |
TimeLoop (Scalar startTime, Scalar dt, Scalar tEnd, bool verbose=true) | |
Simulated time and time step management | |
Dune::Timer | timer_ |
Scalar | time_ |
Scalar | endTime_ |
Scalar | timeStepSize_ |
Scalar | previousTimeStepSize_ |
Scalar | userSetMaxTimeStepSize_ |
Scalar | timeAfterLastTimeStep_ |
Scalar | timeStepWallClockTime_ |
int | timeStepIdx_ |
bool | finished_ |
bool | verbose_ |
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 | advanceTimeStep () override |
Advance time step. 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... | |
Scalar | maxTimeStepSize () const override |
The current maximum time step size. More... | |
void | reportTimeStep () const |
State info on cpu time. More... | |
template<class Communicator = Dune::Communication<typename Dune::MPIHelper::MPICommunicator>> | |
void | finalize (const Communicator &comm=Dune::MPIHelper::getCommunication()) |
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... | |
|
inline |
|
inlineoverridevirtual |
Advance time step.
Implements Dumux::TimeLoopBase< Scalar >.
Reimplemented in Dumux::CheckPointTimeLoop< Scalar >.
|
inline |
Returns the number of (simulated) seconds which the simulation runs.
|
inline |
Print final status and stops tracking the time.
|
inlineoverridevirtual |
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 >.
|
inlineoverridevirtual |
The current maximum time step size.
Implements Dumux::TimeLoopBase< Scalar >.
Reimplemented in Dumux::CheckPointTimeLoop< Scalar >.
|
inline |
The previous time step size.
|
inline |
State info on cpu time.
|
inline |
Reset the time loop.
|
inline |
Reset the timer.
|
inline |
Set the time of simulated seconds at which the simulation runs.
t | The time \(\mathrm{[s]}\) at which the simulation is finished |
|
inline |
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. |
|
inline |
Set the maximum time step size to a given value.
maxDt | The new value for the maximum time step size \(\mathrm{[s]}\) |
|
inline |
Set the current simulated time, don't change the current time step index.
t | The time \(\mathrm{[s]}\) which should be jumped to |
|
inline |
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 |
|
inlinefinalvirtual |
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 >.
|
inline |
Sets time loop verbosity.
|
inline |
Tells the time loop to start tracking the time.
|
inline |
Tells the time loop to stop tracking the time.
|
inlinefinalvirtual |
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 >.
|
inline |
Returns number of time steps which have been executed since the beginning of the simulation.
|
inlinefinalvirtual |
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 >.
|
inline |
If the time loop has verbose output.
|
inline |
Returns the current wall clock time (cpu time) spend in this time loop.
|
inline |
Returns true if the simulation is finished after the time level is incremented by the current time step size.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |