Tempus  Version of the Day
Time Integration
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Tempus::TimeStepControlStrategyBasicVS< Scalar > Class Template Reference

StepControlStrategy class for TimeStepControl. More...

#include <Tempus_TimeStepControlStrategyBasicVS.hpp>

Inheritance diagram for Tempus::TimeStepControlStrategyBasicVS< Scalar >:
Tempus::TimeStepControlStrategy< Scalar >

Public Member Functions

 TimeStepControlStrategyBasicVS (Teuchos::RCP< Teuchos::ParameterList > pList=Teuchos::null)
 Constructor. More...
 
virtual ~TimeStepControlStrategyBasicVS ()
 Destructor. More...
 
virtual void getNextTimeStep (const TimeStepControl< Scalar > tsc, Teuchos::RCP< SolutionHistory< Scalar > > solutionHistory, Status &) override
 Determine the time step size. More...
 
virtual Scalar getAmplFactor () const
 
virtual Scalar getReductFactor () const
 
virtual Scalar getMinEta () const
 
virtual Scalar getMaxEta () const
 
virtual void setAmplFactor (Scalar rho)
 
virtual void setReductFactor (Scalar sigma)
 
virtual void setMinEta (Scalar minEta)
 
virtual void setMaxEta (Scalar maxEta)
 
Scalar computeEta (const TimeStepControl< Scalar > tsc, const Teuchos::RCP< SolutionHistory< Scalar > > &solutionHistory)
 
Overridden from Teuchos::ParameterListAcceptor
void setParameterList (const Teuchos::RCP< Teuchos::ParameterList > &pList) override
 
Teuchos::RCP< const
Teuchos::ParameterList > 
getValidParameters () const override
 
Teuchos::RCP
< Teuchos::ParameterList > 
getNonconstParameterList () override
 
Teuchos::RCP
< Teuchos::ParameterList > 
unsetParameterList () override
 
- Public Member Functions inherited from Tempus::TimeStepControlStrategy< Scalar >
 TimeStepControlStrategy ()
 Constructor. More...
 
virtual ~TimeStepControlStrategy ()
 Destructor. More...
 
void setParameterList (const Teuchos::RCP< Teuchos::ParameterList > &)
 
Teuchos::RCP< const
Teuchos::ParameterList > 
getValidParameters () const
 
Teuchos::RCP
< Teuchos::ParameterList > 
getNonconstParameterList ()
 
Teuchos::RCP
< Teuchos::ParameterList > 
unsetParameterList ()
 

Private Attributes

Teuchos::RCP
< Teuchos::ParameterList > 
tscsPL_
 

Detailed Description

template<class Scalar>
class Tempus::TimeStepControlStrategyBasicVS< Scalar >

StepControlStrategy class for TimeStepControl.

This TimeStepControlStrategy primarily tries to maintain a certain level of change in the solution ill-respective of the error involved, e.g., the solution should change between 1% and 3% ( $\eta_{min}=0.01$ and $\eta_{max}=0.03$) every time step. The relative solution change is measured by

\[ \eta_{n-1} = \frac{|| x_{n-1} - x_{n-2} ||}{ || x_{n-2} || + \epsilon } \]

where $\epsilon$ is a small constant to ensure that $\eta_{n-1}$ remains finite. The user can select the desired relative change in the solution by choosing a range for $\eta_{n-1}$

\[ \eta_{min} < \eta_{n-1} < \eta_{max} \]

If the solution change is outside this range, an amplification ( $\rho$) or reduction factor ( $\sigma$) is applied to the timestep to bring the solution change back into the desired range. This can be written as

\[ \Delta t_n = \left\{ \begin{array}{rll} \sigma \Delta t_{n-1} & \mbox{if $\eta_{n-1} > \eta_{max}$} & \mbox{where $0 < \sigma < 1$} \\ \rho \Delta t_{n-1} & \mbox{else if $\eta_{n-1} < \eta_{min}$} & \mbox{where $\rho > 1$} \\ \Delta t_{n-1} & \mbox{else if $\eta_{min}<\eta_{n-1}<\eta_{max}$} \\ \end{array} \right. \]

In the full implementation, several other mechanisms can amplify or reduce the timestep.

  • Stepper fails
  • Maximum Absolute error, $e_{abs}^{max}$
  • Maximum Relative error, $e_{rel}^{max}$
  • Order, $p$

    \[ \Delta t_n = \left\{ \begin{array}{rll} \sigma \Delta t_{n-1} & \mbox{if Stepper fails} & \mbox{where $0 < \sigma < 1$} \\ \rho \Delta t_{n-1} & \mbox{else if $\eta_{n-1} < \eta_{min}$} & \mbox{where $\rho > 1$} \\ \sigma \Delta t_{n-1} & \mbox{else if $\eta_{n-1} > \eta_{max}$} & \mbox{where $0 < \sigma < 1$} \\ \sigma \Delta t_{n-1} & \mbox{else if $e_{abs} > e_{abs}^{max}$} & \mbox{where $0 < \sigma < 1$} \\ \sigma \Delta t_{n-1} & \mbox{else if $e_{rel} > e_{rel}^{max}$} & \mbox{where $0 < \sigma < 1$} \\ \rho \Delta t_{n-1} & \mbox{else if $p < p_{min}$} & \mbox{where $\rho > 1$} \\ \sigma \Delta t_{n-1} & \mbox{else if $p > p_{max}$} & \mbox{where $0 < \sigma < 1$} \\ \Delta t_{n-1} & \mbox{else} & \\ \end{array} \right. \]

Note

  • Only one amplification or reduction is applied each timestep.
  • The priority is specified by the order of list.
  • The timestep, $\Delta t_n$, is still constrained to the maximum and minimum timestep size. $\Delta t_{min} < \Delta t_n < \Delta t_{max}$
  • If $ \eta_{min} < \eta_n < \eta_{max}$, the timestep is unchanged, i.e., constant timestep size.
  • To have constant timesteps, set $\eta_{min}=0$ and $\eta_{max}=10^{16}$. These are the defaults.
  • From (Denner, 2014), amplification factor, $\rho$, is required to be less than 1.91 for stability ( $\rho < 1.91$).
  • Denner (2014) suggests that $\eta_{min} = 0.1*\eta_{max}$ and the numerical tests confirm this for their problems.

References

Section 2.2.1 / Algorithm 2.4 of A. Denner, "Experiments on Temporal Variable Step BDF2 Algorithms", Masters Thesis, U Wisconsin-Madison, 2014.

Definition at line 106 of file Tempus_TimeStepControlStrategyBasicVS.hpp.

Constructor & Destructor Documentation

template<class Scalar >
Tempus::TimeStepControlStrategyBasicVS< Scalar >::TimeStepControlStrategyBasicVS ( Teuchos::RCP< Teuchos::ParameterList >  pList = Teuchos::null)
inline

Constructor.

Definition at line 112 of file Tempus_TimeStepControlStrategyBasicVS.hpp.

template<class Scalar >
virtual Tempus::TimeStepControlStrategyBasicVS< Scalar >::~TimeStepControlStrategyBasicVS ( )
inlinevirtual

Destructor.

Definition at line 118 of file Tempus_TimeStepControlStrategyBasicVS.hpp.

Member Function Documentation

template<class Scalar >
Scalar Tempus::TimeStepControlStrategyBasicVS< Scalar >::computeEta ( const TimeStepControl< Scalar >  tsc,
const Teuchos::RCP< SolutionHistory< Scalar > > &  solutionHistory 
)
inline

Definition at line 299 of file Tempus_TimeStepControlStrategyBasicVS.hpp.

template<class Scalar >
virtual Scalar Tempus::TimeStepControlStrategyBasicVS< Scalar >::getAmplFactor ( ) const
inlinevirtual

Definition at line 281 of file Tempus_TimeStepControlStrategyBasicVS.hpp.

template<class Scalar >
virtual Scalar Tempus::TimeStepControlStrategyBasicVS< Scalar >::getMaxEta ( ) const
inlinevirtual

Definition at line 287 of file Tempus_TimeStepControlStrategyBasicVS.hpp.

template<class Scalar >
virtual Scalar Tempus::TimeStepControlStrategyBasicVS< Scalar >::getMinEta ( ) const
inlinevirtual

Definition at line 285 of file Tempus_TimeStepControlStrategyBasicVS.hpp.

template<class Scalar >
virtual void Tempus::TimeStepControlStrategyBasicVS< Scalar >::getNextTimeStep ( const TimeStepControl< Scalar >  tsc,
Teuchos::RCP< SolutionHistory< Scalar > >  solutionHistory,
Status  
)
inlineoverridevirtual

Determine the time step size.

Reimplemented from Tempus::TimeStepControlStrategy< Scalar >.

Definition at line 121 of file Tempus_TimeStepControlStrategyBasicVS.hpp.

template<class Scalar >
Teuchos::RCP<Teuchos::ParameterList> Tempus::TimeStepControlStrategyBasicVS< Scalar >::getNonconstParameterList ( )
inlineoverride

Definition at line 270 of file Tempus_TimeStepControlStrategyBasicVS.hpp.

template<class Scalar >
virtual Scalar Tempus::TimeStepControlStrategyBasicVS< Scalar >::getReductFactor ( ) const
inlinevirtual

Definition at line 283 of file Tempus_TimeStepControlStrategyBasicVS.hpp.

template<class Scalar >
Teuchos::RCP<const Teuchos::ParameterList> Tempus::TimeStepControlStrategyBasicVS< Scalar >::getValidParameters ( ) const
inlineoverride

Definition at line 255 of file Tempus_TimeStepControlStrategyBasicVS.hpp.

template<class Scalar >
virtual void Tempus::TimeStepControlStrategyBasicVS< Scalar >::setAmplFactor ( Scalar  rho)
inlinevirtual

Definition at line 290 of file Tempus_TimeStepControlStrategyBasicVS.hpp.

template<class Scalar >
virtual void Tempus::TimeStepControlStrategyBasicVS< Scalar >::setMaxEta ( Scalar  maxEta)
inlinevirtual

Definition at line 296 of file Tempus_TimeStepControlStrategyBasicVS.hpp.

template<class Scalar >
virtual void Tempus::TimeStepControlStrategyBasicVS< Scalar >::setMinEta ( Scalar  minEta)
inlinevirtual

Definition at line 294 of file Tempus_TimeStepControlStrategyBasicVS.hpp.

template<class Scalar >
void Tempus::TimeStepControlStrategyBasicVS< Scalar >::setParameterList ( const Teuchos::RCP< Teuchos::ParameterList > &  pList)
inlineoverride

Definition at line 225 of file Tempus_TimeStepControlStrategyBasicVS.hpp.

template<class Scalar >
virtual void Tempus::TimeStepControlStrategyBasicVS< Scalar >::setReductFactor ( Scalar  sigma)
inlinevirtual

Definition at line 292 of file Tempus_TimeStepControlStrategyBasicVS.hpp.

template<class Scalar >
Teuchos::RCP<Teuchos::ParameterList> Tempus::TimeStepControlStrategyBasicVS< Scalar >::unsetParameterList ( )
inlineoverride

Definition at line 274 of file Tempus_TimeStepControlStrategyBasicVS.hpp.

Member Data Documentation

template<class Scalar >
Teuchos::RCP<Teuchos::ParameterList> Tempus::TimeStepControlStrategyBasicVS< Scalar >::tscsPL_
private

Definition at line 349 of file Tempus_TimeStepControlStrategyBasicVS.hpp.


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