OGS
NumLib::TimeStepAlgorithm Class Referenceabstract

Detailed Description

Interface of time stepping algorithms.

Definition at line 27 of file TimeStepAlgorithm.h.

#include <TimeStepAlgorithm.h>

Inheritance diagram for NumLib::TimeStepAlgorithm:
[legend]

Public Member Functions

 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 void resetCurrentTimeStep (const double, TimeStep &, TimeStep &)
 reset the current step size from the previous time
 
virtual std::tuple< bool, double > next (const double solution_error, int number_iterations, NumLib::TimeStep &ts_previous, NumLib::TimeStep &ts_current)=0
 
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.
 

Protected Attributes

const double _t_initial
 initial time
 
const double _t_end
 end time
 

Constructor & Destructor Documentation

◆ TimeStepAlgorithm()

NumLib::TimeStepAlgorithm::TimeStepAlgorithm ( const double t0,
const double t_end )
inline

Definition at line 30 of file TimeStepAlgorithm.h.

31 : _t_initial(t0), _t_end(t_end)
32 {
33 }
const double _t_initial
initial time
const double _t_end
end time

◆ ~TimeStepAlgorithm()

virtual NumLib::TimeStepAlgorithm::~TimeStepAlgorithm ( )
virtualdefault

Member Function Documentation

◆ begin()

double NumLib::TimeStepAlgorithm::begin ( ) const
inline

return the beginning of time steps

Definition at line 38 of file TimeStepAlgorithm.h.

38{ return _t_initial; }

References _t_initial.

Referenced by ProcessLib::computationOfChangeNeeded().

◆ canReduceTimestepSize()

virtual bool NumLib::TimeStepAlgorithm::canReduceTimestepSize ( NumLib::TimeStep const & ,
NumLib::TimeStep const &  ) const
inlinevirtual

Query the timestepper if further time step size reduction is possible.

Reimplemented in NumLib::EvolutionaryPIDcontroller, and NumLib::IterationNumberBasedTimeStepping.

Definition at line 67 of file TimeStepAlgorithm.h.

70 {
71 return false;
72 }

◆ end()

double NumLib::TimeStepAlgorithm::end ( ) const
inline

return the end of time steps

Definition at line 40 of file TimeStepAlgorithm.h.

40{ return _t_end; }

References _t_end.

Referenced by NumLib::FixedTimeStepping::next().

◆ isSolutionErrorComputationNeeded()

virtual bool NumLib::TimeStepAlgorithm::isSolutionErrorComputationNeeded ( ) const
inlinevirtual

Get a flag to indicate whether this algorithm needs to compute solution error. The default return value is false.

Reimplemented in NumLib::EvolutionaryPIDcontroller, and NumLib::IterationNumberBasedTimeStepping.

Definition at line 64 of file TimeStepAlgorithm.h.

64{ return false; }

Referenced by ProcessLib::computationOfChangeNeeded().

◆ next()

virtual std::tuple< bool, double > NumLib::TimeStepAlgorithm::next ( const double solution_error,
int number_iterations,
NumLib::TimeStep & ts_previous,
NumLib::TimeStep & ts_current )
pure virtual

Move to the next time step

Parameters
solution_errorSolution error \(e_n\) between two successive time steps.
number_iterationsNumber of non-linear iterations used.
ts_previousthe previous time step used to compute the size of the next step
ts_currentthe current time step used to compute the size of the next step
Returns
A step acceptance flag and the computed step size.

Implemented in NumLib::EvolutionaryPIDcontroller, NumLib::FixedTimeStepping, and NumLib::IterationNumberBasedTimeStepping.

◆ resetCurrentTimeStep()

virtual void NumLib::TimeStepAlgorithm::resetCurrentTimeStep ( const double ,
TimeStep & ,
TimeStep &  )
inlinevirtual

reset the current step size from the previous time

Reimplemented in NumLib::FixedTimeStepping.

Definition at line 42 of file TimeStepAlgorithm.h.

45 {
46 }

Member Data Documentation

◆ _t_end

const double NumLib::TimeStepAlgorithm::_t_end
protected

end time

Definition at line 78 of file TimeStepAlgorithm.h.

Referenced by NumLib::FixedTimeStepping::FixedTimeStepping(), and end().

◆ _t_initial

const double NumLib::TimeStepAlgorithm::_t_initial
protected

initial time

Definition at line 76 of file TimeStepAlgorithm.h.

Referenced by NumLib::FixedTimeStepping::FixedTimeStepping(), and begin().


The documentation for this class was generated from the following file: