![]() |
OGS
|
|
Fixed time stepping algorithm.
This algorithm returns time step size defined by a user priori.
If the prescribed time step sizes are used up before the end time is reached—which happens if the steps actually taken are smaller than the prescribed ones, as in the staggered coupling scheme—the last prescribed time step size taken by the scheme is repeated until the end time.
Definition at line 25 of file FixedTimeStepping.h.
#include <FixedTimeStepping.h>
Public Member Functions | |
| FixedTimeStepping (double t0, double t_end, double dt) | |
| FixedTimeStepping (double t0, double tn, std::vector< RepeatDtPair > const &repeat_dt_pairs, std::vector< double > const &fixed_times_for_output) | |
| double | next (double solution_error, int number_iterations, NumLib::TimeStep &ts_previous, NumLib::TimeStep &ts_current) override |
| Public Member Functions inherited from NumLib::TimeStepAlgorithm | |
| TimeStepAlgorithm (const double t0, const double t_end) | |
| virtual | ~TimeStepAlgorithm ()=default |
| Time | begin () const |
| return the beginning of time steps | |
| Time | end () const |
| return the end of time steps | |
| virtual bool | isSolutionErrorComputationNeeded () const |
| virtual bool | canReduceTimestepSize (NumLib::TimeStep const &, NumLib::TimeStep const &) const |
| Query the timestepper if further time step size reduction is possible. | |
Static Public Member Functions | |
| static bool | areRepeatDtPairsValid (std::vector< RepeatDtPair > const &repeat_dt_pairs) |
Private Attributes | |
| std::vector< double > | dt_vector_ |
| a vector of time step sizes | |
| double | last_prescribed_dt_ = 0.0 |
| bool | reuse_of_last_dt_reported_ = false |
Additional Inherited Members | |
| Protected Attributes inherited from NumLib::TimeStepAlgorithm | |
| const Time | _t_initial |
| initial time | |
| const Time | _t_end |
| end time | |
| NumLib::FixedTimeStepping::FixedTimeStepping | ( | double | t0, |
| double | t_end, | ||
| double | dt ) |
Constructor with homogeneous time step size
A user provides a single time step size \(\Delta t\). Total number of time steps is calculated by
\[ n=\frac{t_{\rm n} - t_0}{\Delta t} \]
.
t_end is larger than t0 and dt is positive; both are required for a non-empty sequence of time steps and are checked with OGS_FATAL.| t0 | start time |
| t_end | end time |
| dt | uniform time step size |
Definition at line 204 of file FixedTimeStepping.cpp.
References NumLib::TimeStepAlgorithm::TimeStepAlgorithm(), dt_vector_, last_prescribed_dt_, and OGS_FATAL.
| NumLib::FixedTimeStepping::FixedTimeStepping | ( | double | t0, |
| double | tn, | ||
| std::vector< RepeatDtPair > const & | repeat_dt_pairs, | ||
| std::vector< double > const & | fixed_times_for_output ) |
Constructor with user-specified time step sizes including additional time steps for output.
tn is larger than t0 and repeat_dt_pairs is valid in the sense of areRepeatDtPairsValid(), i.e. non-empty with positive delta_t and non-zero repeat entries; both are required for a non-empty sequence of time steps and are checked with OGS_FATAL.| t0 | start time |
| tn | end time |
| repeat_dt_pairs | pairs of the number of repetitions and the time step size |
| fixed_times_for_output | times at which output is requested; the time step containing such a time is split at it |
Definition at line 143 of file FixedTimeStepping.cpp.
References NumLib::TimeStepAlgorithm::TimeStepAlgorithm(), NumLib::TimeStepAlgorithm::_t_end, NumLib::TimeStepAlgorithm::_t_initial, areRepeatDtPairsValid(), dt_vector_, NumLib::incorporateFixedTimesForOutput(), last_prescribed_dt_, and OGS_FATAL.
|
static |
Definition at line 292 of file FixedTimeStepping.cpp.
References ERR().
Referenced by FixedTimeStepping(), and NumLib::createFixedTimeStepping().
|
overridevirtual |
Move to the next time step
| solution_error | Solution error \(e_n\) between two successive time steps. |
| number_iterations | Number of non-linear iterations used. |
| ts_previous | the previous time step used to compute the size of the next step |
| ts_current | the current time step used to compute the size of the next step |
Implements NumLib::TimeStepAlgorithm.
Definition at line 247 of file FixedTimeStepping.cpp.
References NumLib::TimeStep::current(), dt_vector_, NumLib::TimeStepAlgorithm::end(), last_prescribed_dt_, reuse_of_last_dt_reported_, NumLib::TimeStep::timeStepNumber(), and WARN().
|
private |
a vector of time step sizes
Definition at line 76 of file FixedTimeStepping.h.
Referenced by FixedTimeStepping(), FixedTimeStepping(), and next().
|
private |
The size of the last time step the scheme takes as prescribed by the user. Kept separately from dt_vector_ because the latter's last entry is not necessarily a prescribed size: incorporateFixedTimesForOutput() splits the interval containing a fixed output time into two smaller ones. It is not the last (repeat, delta_t) pair's size either, because pairs whose steps start beyond the end time are not part of the scheme.
Definition at line 84 of file FixedTimeStepping.h.
Referenced by FixedTimeStepping(), FixedTimeStepping(), and next().
|
private |
set if it has already been reported that the prescribed time step sizes are used up and the last one is repeated, in order to report it once only.
Definition at line 89 of file FixedTimeStepping.h.
Referenced by next().