OGS
|
Fixed time stepping algorithm.
This algorithm returns time step size defined by a user priori.
Definition at line 27 of file FixedTimeStepping.h.
#include <FixedTimeStepping.h>
Public Member Functions | |
FixedTimeStepping (double t0, double tn, double dt) | |
FixedTimeStepping (double t0, double tn, const std::vector< double > &vec_all_dt) | |
std::tuple< bool, double > | next (double solution_error, int number_iterations) override |
bool | accepted () const override |
return if current time step is accepted or not More... | |
Public Member Functions inherited from NumLib::TimeStepAlgorithm | |
TimeStepAlgorithm (const double t0, const double t_end) | |
TimeStepAlgorithm (const double t0, const double t_end, const double dt) | |
TimeStepAlgorithm (const double t0, const double t_end, const std::vector< double > &all_step_sizes) | |
virtual | ~TimeStepAlgorithm ()=default |
double | begin () const |
return the beginning of time steps More... | |
double | end () const |
return the end of time steps More... | |
const TimeStep | getTimeStep () const |
return current time step More... | |
void | resetCurrentTimeStep (const double dt) |
reset the current step size from the previous time More... | |
virtual void | setAcceptedOrNot (const bool accepted) |
const std::vector< double > & | getTimeStepSizeHistory () const |
return a history of time step sizes More... | |
virtual bool | isSolutionErrorComputationNeeded () const |
virtual bool | canReduceTimestepSize () const |
Query the timestepper if further time step size reduction is possible. More... | |
Static Private Member Functions | |
static double | computeEnd (double t_initial, double t_end, const std::vector< double > &dt_vector) |
determine true end time More... | |
Additional Inherited Members | |
Protected Attributes inherited from NumLib::TimeStepAlgorithm | |
const double | _t_initial |
initial time More... | |
const double | _t_end |
end time More... | |
TimeStep | _ts_prev |
previous time step information More... | |
TimeStep | _ts_current |
current time step information More... | |
std::vector< double > | _dt_vector |
a vector of time step sizes More... | |
NumLib::FixedTimeStepping::FixedTimeStepping | ( | double | t0, |
double | tn, | ||
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} \]
.
t0 | start time |
tn | finish time |
dt | uniform time step size |
Definition at line 29 of file FixedTimeStepping.cpp.
NumLib::FixedTimeStepping::FixedTimeStepping | ( | double | t0, |
double | tn, | ||
const std::vector< double > & | vec_all_dt | ||
) |
Constructor with user-specified time step sizes
A user can specify \(\Delta t\) for each time step (i.e. \(\Delta t_1, \Delta t_2, ..., \Delta t_n\)). Time at \(m\) th step is given as
\[ t_{m}=\sum_{i=1}^m \Delta t_i + t_0 \]
.
t0 | start time |
tn | finish time |
vec_all_dt | a vector of all time steps |
Definition at line 22 of file FixedTimeStepping.cpp.
|
inlineoverridevirtual |
return if current time step is accepted or not
Implements NumLib::TimeStepAlgorithm.
Definition at line 64 of file FixedTimeStepping.h.
|
staticprivate |
determine true end time
Definition at line 54 of file FixedTimeStepping.cpp.
|
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. |
Implements NumLib::TimeStepAlgorithm.
Definition at line 34 of file FixedTimeStepping.cpp.
References NumLib::TimeStepAlgorithm::_dt_vector, NumLib::TimeStepAlgorithm::_t_end, NumLib::TimeStepAlgorithm::_ts_current, NumLib::TimeStep::current(), and NumLib::TimeStep::steps().