Tempus  Version of the Day
Time Integration
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Attributes | List of all members
Tempus::TimeStepControlStrategyBasicVS< Scalar > Class Template Reference

StepControlStrategy class for TimeStepControl. More...

#include <Tempus_TimeStepControlStrategyBasicVS.hpp>

Inheritance diagram for Tempus::TimeStepControlStrategyBasicVS< Scalar >:
Tempus::TimeStepControlStrategy< Scalar > Teuchos::Describable Teuchos::VerboseObject< Tempus::TimeStepControlStrategy< Scalar > > Teuchos::LabeledObject Teuchos::VerboseObjectBase

Public Member Functions

 TimeStepControlStrategyBasicVS ()
 Default Constructor. More...
 
 TimeStepControlStrategyBasicVS (Scalar rho, Scalar sigma, Scalar minEta, Scalar maxEta, std::string name="Basic VS")
 Full Constructor. More...
 
virtual ~TimeStepControlStrategyBasicVS ()
 Destructor. More...
 
virtual void setNextTimeStep (const TimeStepControl< Scalar > &tsc, Teuchos::RCP< SolutionHistory< Scalar > > solutionHistory, Status &) override
 Set the time step size. More...
 
virtual Teuchos::RCP< const
Teuchos::ParameterList
getValidParameters () const override
 Return ParameterList with current values. More...
 
virtual void initialize () const override
 
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)
 
- Public Member Functions inherited from Tempus::TimeStepControlStrategy< Scalar >
 TimeStepControlStrategy ()
 Constructor. More...
 
virtual ~TimeStepControlStrategy ()
 Destructor. More...
 
virtual bool isInitialized ()
 
virtual void checkInitialized ()
 
virtual void setName (std::string s)
 
virtual std::string getStrategyType () const
 
virtual std::string getStepType () const
 
virtual std::string getName () const
 
- Public Member Functions inherited from Teuchos::Describable
void describe (std::ostream &out, const EVerbosityLevel verbLevel=verbLevel_default) const
 
virtual ~Describable ()
 
 LabeledObject ()
 
virtual ~LabeledObject ()
 
virtual void setObjectLabel (const std::string &objectLabel)
 
virtual std::string getObjectLabel () const
 
DescribableStreamManipulatorState describe (const Describable &describable, const EVerbosityLevel verbLevel=Describable::verbLevel_default)
 
std::ostream & operator<< (std::ostream &os, const DescribableStreamManipulatorState &d)
 
- Public Member Functions inherited from Teuchos::VerboseObject< Tempus::TimeStepControlStrategy< Scalar > >
 VerboseObject (const EVerbosityLevel verbLevel=VERB_DEFAULT, const RCP< FancyOStream > &oStream=Teuchos::null)
 
virtual const VerboseObjectsetVerbLevel (const EVerbosityLevel verbLevel) const
 
virtual const VerboseObjectsetOverridingVerbLevel (const EVerbosityLevel verbLevel) const
 
virtual EVerbosityLevel getVerbLevel () const
 
TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT
RCP< const ParameterList
getValidVerboseObjectSublist ()
 
TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT
void 
setupVerboseObjectSublist (ParameterList *paramList)
 
TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT
void 
readVerboseObjectSublist (ParameterList *paramList, RCP< FancyOStream > *oStream, EVerbosityLevel *verbLevel)
 
void readVerboseObjectSublist (ParameterList *paramList, VerboseObject< ObjectType > *verboseObject)
 
- Public Member Functions inherited from Teuchos::VerboseObjectBase
virtual ~VerboseObjectBase ()
 
 VerboseObjectBase (const RCP< FancyOStream > &oStream=Teuchos::null)
 
virtual const VerboseObjectBasesetOStream (const RCP< FancyOStream > &oStream) const
 
virtual const VerboseObjectBasesetOverridingOStream (const RCP< FancyOStream > &oStream) const
 
virtual VerboseObjectBasesetLinePrefix (const std::string &linePrefix)
 
virtual RCP< FancyOStreamgetOStream () const
 
virtual RCP< FancyOStreamgetOverridingOStream () const
 
virtual std::string getLinePrefix () const
 
virtual OSTab getOSTab (const int tabs=1, const std::string &linePrefix="") const
 

Private Attributes

Scalar rho_
 Amplification Factor. More...
 
Scalar sigma_
 Reduction Factor. More...
 
Scalar minEta_
 Minimum Value Monitoring Function. More...
 
Scalar maxEta_
 Maximum Value Monitoring Function. More...
 

Overridden from Teuchos::Describable

std::string description () const override
 
void describe (Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) const override
 

Additional Inherited Members

- Static Public Member Functions inherited from Teuchos::VerboseObject< Tempus::TimeStepControlStrategy< Scalar > >
static void setDefaultVerbLevel (const EVerbosityLevel defaultVerbLevel)
 
static EVerbosityLevel getDefaultVerbLevel ()
 
- Static Public Member Functions inherited from Teuchos::VerboseObjectBase
static void setDefaultOStream (const RCP< FancyOStream > &defaultOStream)
 
static RCP< FancyOStreamgetDefaultOStream ()
 
- Static Public Attributes inherited from Teuchos::Describable
static const EVerbosityLevel verbLevel_default
 
- Protected Member Functions inherited from Tempus::TimeStepControlStrategy< Scalar >
virtual void setStrategyType (std::string s)
 
virtual void setStepType (std::string s)
 
- Protected Member Functions inherited from Teuchos::VerboseObject< Tempus::TimeStepControlStrategy< Scalar > >
void initializeVerboseObject (const EVerbosityLevel verbLevel=VERB_DEFAULT, const RCP< FancyOStream > &oStream=Teuchos::null)
 
- Protected Member Functions inherited from Teuchos::VerboseObjectBase
void initializeVerboseObjectBase (const RCP< FancyOStream > &oStream=Teuchos::null)
 
virtual void informUpdatedVerbosityState () const
 
- Protected Attributes inherited from Tempus::TimeStepControlStrategy< Scalar >
std::string strategyType_
 Strategy type. More...
 
std::string stepType_
 Step Type - "Constant" or "Variable". More...
 
std::string name_
 Name of strategy. More...
 
bool isInitialized_
 Bool if strategy is initialized. More...
 

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.

Note

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 104 of file Tempus_TimeStepControlStrategyBasicVS.hpp.

Constructor & Destructor Documentation

template<class Scalar >
Tempus::TimeStepControlStrategyBasicVS< Scalar >::TimeStepControlStrategyBasicVS ( )
inline

Default Constructor.

Definition at line 108 of file Tempus_TimeStepControlStrategyBasicVS.hpp.

template<class Scalar >
Tempus::TimeStepControlStrategyBasicVS< Scalar >::TimeStepControlStrategyBasicVS ( Scalar  rho,
Scalar  sigma,
Scalar  minEta,
Scalar  maxEta,
std::string  name = "Basic VS" 
)
inline

Full Constructor.

Definition at line 118 of file Tempus_TimeStepControlStrategyBasicVS.hpp.

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

Destructor.

Definition at line 129 of file Tempus_TimeStepControlStrategyBasicVS.hpp.

Member Function Documentation

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

Set the time step size.

Reimplemented from Tempus::TimeStepControlStrategy< Scalar >.

Definition at line 132 of file Tempus_TimeStepControlStrategyBasicVS.hpp.

template<class Scalar >
std::string Tempus::TimeStepControlStrategyBasicVS< Scalar >::description ( ) const
inlineoverridevirtual

Reimplemented from Teuchos::Describable.

Definition at line 208 of file Tempus_TimeStepControlStrategyBasicVS.hpp.

template<class Scalar >
void Tempus::TimeStepControlStrategyBasicVS< Scalar >::describe ( Teuchos::FancyOStream out,
const Teuchos::EVerbosityLevel  verbLevel 
) const
inlineoverridevirtual

Reimplemented from Teuchos::Describable.

Definition at line 213 of file Tempus_TimeStepControlStrategyBasicVS.hpp.

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

Return ParameterList with current values.

Reimplemented from Tempus::TimeStepControlStrategy< Scalar >.

Definition at line 241 of file Tempus_TimeStepControlStrategyBasicVS.hpp.

template<class Scalar >
virtual void Tempus::TimeStepControlStrategyBasicVS< Scalar >::initialize ( ) const
inlineoverridevirtual
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 >::getReductFactor ( ) const
inlinevirtual

Definition at line 282 of file Tempus_TimeStepControlStrategyBasicVS.hpp.

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

Definition at line 283 of file Tempus_TimeStepControlStrategyBasicVS.hpp.

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

Definition at line 284 of file Tempus_TimeStepControlStrategyBasicVS.hpp.

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

Definition at line 286 of file Tempus_TimeStepControlStrategyBasicVS.hpp.

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

Definition at line 291 of file Tempus_TimeStepControlStrategyBasicVS.hpp.

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

Definition at line 296 of file Tempus_TimeStepControlStrategyBasicVS.hpp.

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

Definition at line 301 of file Tempus_TimeStepControlStrategyBasicVS.hpp.

Member Data Documentation

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

Amplification Factor.

Definition at line 308 of file Tempus_TimeStepControlStrategyBasicVS.hpp.

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

Reduction Factor.

Definition at line 309 of file Tempus_TimeStepControlStrategyBasicVS.hpp.

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

Minimum Value Monitoring Function.

Definition at line 310 of file Tempus_TimeStepControlStrategyBasicVS.hpp.

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

Maximum Value Monitoring Function.

Definition at line 311 of file Tempus_TimeStepControlStrategyBasicVS.hpp.


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