OGS
|
Interface of time stepping algorithms.
Definition at line 27 of file TimeStepAlgorithm.h.
#include <TimeStepAlgorithm.h>
Public Member Functions | |
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 std::tuple< bool, double > | next (const double solution_error, int number_iterations)=0 |
virtual bool | accepted () const =0 |
return if current time step is accepted or not 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... | |
Protected Attributes | |
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... | |
|
inline |
Definition at line 30 of file TimeStepAlgorithm.h.
|
inline |
Definition at line 35 of file TimeStepAlgorithm.h.
References _dt_vector, and OGS_FATAL.
|
inline |
Definition at line 67 of file TimeStepAlgorithm.h.
|
virtualdefault |
|
pure virtual |
return if current time step is accepted or not
Implemented in NumLib::IterationNumberBasedTimeStepping, NumLib::FixedTimeStepping, and NumLib::EvolutionaryPIDcontroller.
Referenced by setAcceptedOrNot().
|
inline |
return the beginning of time steps
Definition at line 80 of file TimeStepAlgorithm.h.
References _t_initial.
|
inlinevirtual |
Query the timestepper if further time step size reduction is possible.
Reimplemented in NumLib::IterationNumberBasedTimeStepping, and NumLib::EvolutionaryPIDcontroller.
Definition at line 120 of file TimeStepAlgorithm.h.
|
inline |
|
inline |
|
inline |
return a history of time step sizes
Definition at line 110 of file TimeStepAlgorithm.h.
References _dt_vector.
|
inlinevirtual |
Get a flag to indicate whether this algorithm needs to compute solution error. The default return value is false.
Reimplemented in NumLib::IterationNumberBasedTimeStepping, and NumLib::EvolutionaryPIDcontroller.
Definition at line 117 of file TimeStepAlgorithm.h.
|
pure virtual |
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. |
Implemented in NumLib::IterationNumberBasedTimeStepping, NumLib::FixedTimeStepping, and NumLib::EvolutionaryPIDcontroller.
|
inline |
reset the current step size from the previous time
Definition at line 86 of file TimeStepAlgorithm.h.
References _dt_vector, _ts_current, and _ts_prev.
|
inlinevirtual |
Set the status of the step.
accepted | A boolean parameter is needed to indicated whether the step is accepted or not. |
Reimplemented in NumLib::EvolutionaryPIDcontroller, and NumLib::IterationNumberBasedTimeStepping.
Definition at line 107 of file TimeStepAlgorithm.h.
References accepted().
|
protected |
a vector of time step sizes
Definition at line 134 of file TimeStepAlgorithm.h.
Referenced by TimeStepAlgorithm(), getTimeStepSizeHistory(), NumLib::FixedTimeStepping::next(), and resetCurrentTimeStep().
|
protected |
end time
Definition at line 126 of file TimeStepAlgorithm.h.
Referenced by end(), and NumLib::FixedTimeStepping::next().
|
protected |
|
protected |
current time step information
Definition at line 131 of file TimeStepAlgorithm.h.
Referenced by NumLib::EvolutionaryPIDcontroller::canReduceTimestepSize(), NumLib::IterationNumberBasedTimeStepping::canReduceTimestepSize(), getTimeStep(), NumLib::EvolutionaryPIDcontroller::limitStepSize(), NumLib::EvolutionaryPIDcontroller::next(), NumLib::FixedTimeStepping::next(), NumLib::IterationNumberBasedTimeStepping::next(), and resetCurrentTimeStep().
|
protected |
previous time step information
Definition at line 129 of file TimeStepAlgorithm.h.
Referenced by NumLib::EvolutionaryPIDcontroller::canReduceTimestepSize(), NumLib::IterationNumberBasedTimeStepping::canReduceTimestepSize(), NumLib::IterationNumberBasedTimeStepping::getNextTimeStepSize(), NumLib::IterationNumberBasedTimeStepping::next(), and resetCurrentTimeStep().