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 t_end, double dt) | |
FixedTimeStepping (double t0, double tn, std::vector< std::pair< std::size_t, double > > const &repeat_dt_pairs, std::vector< double > const &fixed_times_for_output) | |
std::tuple< bool, double > | next (double solution_error, int number_iterations, NumLib::TimeStep &ts_previous, NumLib::TimeStep &ts_current) override |
void | resetCurrentTimeStep (const double dt, TimeStep &, TimeStep &) override |
reset the current step size from the previous time | |
Public Member Functions inherited from NumLib::TimeStepAlgorithm | |
TimeStepAlgorithm (const double t0, const double t_end) | |
virtual | ~TimeStepAlgorithm ()=default |
double | begin () const |
return the beginning of time steps | |
double | 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. | |
Private Attributes | |
std::vector< double > | _dt_vector |
a vector of time step sizes | |
Additional Inherited Members | |
Protected Attributes inherited from NumLib::TimeStepAlgorithm | |
const double | _t_initial |
initial time | |
const double | _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} \]
.
t0 | start time |
t_end | end time |
dt | uniform time step size |
Definition at line 181 of file FixedTimeStepping.cpp.
References _dt_vector, and OGS_FATAL.
NumLib::FixedTimeStepping::FixedTimeStepping | ( | double | t0, |
double | tn, | ||
std::vector< std::pair< std::size_t, double > > 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.
Definition at line 143 of file FixedTimeStepping.cpp.
References _dt_vector, NumLib::TimeStepAlgorithm::_t_end, NumLib::TimeStepAlgorithm::_t_initial, NumLib::incorporateFixedTimesForOutput(), and OGS_FATAL.
|
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 213 of file FixedTimeStepping.cpp.
References _dt_vector, NumLib::TimeStep::current(), NumLib::TimeStepAlgorithm::end(), and NumLib::TimeStep::timeStepNumber().
|
inlineoverridevirtual |
reset the current step size from the previous time
Reimplemented from NumLib::TimeStepAlgorithm.
Definition at line 59 of file FixedTimeStepping.h.
References _dt_vector.
|
private |
a vector of time step sizes
Definition at line 67 of file FixedTimeStepping.h.
Referenced by FixedTimeStepping(), FixedTimeStepping(), next(), and resetCurrentTimeStep().