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::TimeStepControlStrategyIntegralController< Scalar > Class Template Reference

StepControlStrategy class for TimeStepControl. More...

#include <Tempus_TimeStepControlStrategyIntegralController.hpp>

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

Public Member Functions

 TimeStepControlStrategyIntegralController ()
 Default Constructor. More...
 
 TimeStepControlStrategyIntegralController (std::string controller, Scalar KI, Scalar KP, Scalar KD, Scalar safetyFactor, Scalar safetyFactorAfterReject, Scalar facMax, Scalar facMin, std::string name="Integral Controller")
 Full Constructor. More...
 
virtual ~TimeStepControlStrategyIntegralController ()
 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 std::string getController () const
 
virtual Scalar getKI () const
 
virtual Scalar getKP () const
 
virtual Scalar getKD () const
 
virtual Scalar getSafetyFactor () const
 
virtual Scalar getSafetyFactorAfterReject () const
 
virtual Scalar getFacMax () const
 
virtual Scalar getFacMin () const
 
virtual void setController (std::string c)
 
virtual void setKI (Scalar k)
 
virtual void setKP (Scalar k)
 
virtual void setKD (Scalar k)
 
virtual void setSafetyFactor (Scalar f)
 
virtual void setSafetyFactorAfterReject (Scalar f)
 
virtual void setFacMax (Scalar f)
 
virtual void setFacMin (Scalar f)
 
- 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

std::string controller_
 Control type ['I', 'PI', 'PID']. More...
 
Scalar KI_
 Integral gain. More...
 
Scalar KP_
 Proportional gain. More...
 
Scalar KD_
 Derivative gain. More...
 
Scalar safetyFactor_
 Safety Factor. More...
 
Scalar safetyFactorAfterReject_
 Safety Factor Following Step Rejection. More...
 
Scalar facMaxINPUT_
 Maximum Safety Factor from input. More...
 
Scalar facMax_
 Maximum Safety Factor. More...
 
Scalar facMin_
 Minimum Safety Factor. More...
 
bool firstSuccessfulStep_ = false
 
bool lastStepRejected_ = false
 

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::TimeStepControlStrategyIntegralController< Scalar >

StepControlStrategy class for TimeStepControl.

Gustaf Soderlind. Automatic control and adaptive time-stepping. Numerical Algorithms, 31(1):281–310, Dec 2002.

The step size is chosen based on "Controller Type":

PID = Proportional-Integral-Derivative Controller

\[ (\Delta t)_{n+1} = (\Delta t)_n \left( \epsilon_n ^{-k_I / p} \epsilon_{n-1}^{k_P / p} \epsilon_{n-2}^{-k_D / p} \right) \]

PI = Proportional-Integral Controller

\[ (\Delta t)_{n+1} = (\Delta t)_n \left( \epsilon_n ^{-k_I / p} \epsilon_{n-1}^{k_P / p} \right) \]

I = Integral Controller

\[ (\Delta t)_{n+1} = (\Delta t)_n \left( \epsilon_n ^{-k_I / p} \right) \]

where $\epsilon_n $ is the error at time step $n$ and $p$ is the order of the embedded solution, which is assumed to be the low order solution (i.e., the time step order minus one).

Appropriate for Explicit Methods

Definition at line 59 of file Tempus_TimeStepControlStrategyIntegralController.hpp.

Constructor & Destructor Documentation

Default Constructor.

Definition at line 63 of file Tempus_TimeStepControlStrategyIntegralController.hpp.

template<class Scalar >
Tempus::TimeStepControlStrategyIntegralController< Scalar >::TimeStepControlStrategyIntegralController ( std::string  controller,
Scalar  KI,
Scalar  KP,
Scalar  KD,
Scalar  safetyFactor,
Scalar  safetyFactorAfterReject,
Scalar  facMax,
Scalar  facMin,
std::string  name = "Integral Controller" 
)
inline

Full Constructor.

Definition at line 82 of file Tempus_TimeStepControlStrategyIntegralController.hpp.

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

Destructor.

Definition at line 104 of file Tempus_TimeStepControlStrategyIntegralController.hpp.

Member Function Documentation

template<class Scalar >
virtual void Tempus::TimeStepControlStrategyIntegralController< 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 107 of file Tempus_TimeStepControlStrategyIntegralController.hpp.

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

Reimplemented from Teuchos::Describable.

Definition at line 182 of file Tempus_TimeStepControlStrategyIntegralController.hpp.

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

Reimplemented from Teuchos::Describable.

Definition at line 187 of file Tempus_TimeStepControlStrategyIntegralController.hpp.

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

Return ParameterList with current values.

Reimplemented from Tempus::TimeStepControlStrategy< Scalar >.

Definition at line 225 of file Tempus_TimeStepControlStrategyIntegralController.hpp.

template<class Scalar >
virtual void Tempus::TimeStepControlStrategyIntegralController< Scalar >::initialize ( ) const
inlineoverridevirtual
template<class Scalar >
virtual std::string Tempus::TimeStepControlStrategyIntegralController< Scalar >::getController ( ) const
inlinevirtual
template<class Scalar >
virtual Scalar Tempus::TimeStepControlStrategyIntegralController< Scalar >::getKI ( ) const
inlinevirtual
template<class Scalar >
virtual Scalar Tempus::TimeStepControlStrategyIntegralController< Scalar >::getKP ( ) const
inlinevirtual
template<class Scalar >
virtual Scalar Tempus::TimeStepControlStrategyIntegralController< Scalar >::getKD ( ) const
inlinevirtual
template<class Scalar >
virtual Scalar Tempus::TimeStepControlStrategyIntegralController< Scalar >::getSafetyFactor ( ) const
inlinevirtual
template<class Scalar >
virtual Scalar Tempus::TimeStepControlStrategyIntegralController< Scalar >::getSafetyFactorAfterReject ( ) const
inlinevirtual
template<class Scalar >
virtual Scalar Tempus::TimeStepControlStrategyIntegralController< Scalar >::getFacMax ( ) const
inlinevirtual
template<class Scalar >
virtual Scalar Tempus::TimeStepControlStrategyIntegralController< Scalar >::getFacMin ( ) const
inlinevirtual
template<class Scalar >
virtual void Tempus::TimeStepControlStrategyIntegralController< Scalar >::setController ( std::string  c)
inlinevirtual
template<class Scalar >
virtual void Tempus::TimeStepControlStrategyIntegralController< Scalar >::setKI ( Scalar  k)
inlinevirtual
template<class Scalar >
virtual void Tempus::TimeStepControlStrategyIntegralController< Scalar >::setKP ( Scalar  k)
inlinevirtual
template<class Scalar >
virtual void Tempus::TimeStepControlStrategyIntegralController< Scalar >::setKD ( Scalar  k)
inlinevirtual
template<class Scalar >
virtual void Tempus::TimeStepControlStrategyIntegralController< Scalar >::setSafetyFactor ( Scalar  f)
inlinevirtual
template<class Scalar >
virtual void Tempus::TimeStepControlStrategyIntegralController< Scalar >::setSafetyFactorAfterReject ( Scalar  f)
inlinevirtual
template<class Scalar >
virtual void Tempus::TimeStepControlStrategyIntegralController< Scalar >::setFacMax ( Scalar  f)
inlinevirtual
template<class Scalar >
virtual void Tempus::TimeStepControlStrategyIntegralController< Scalar >::setFacMin ( Scalar  f)
inlinevirtual

Member Data Documentation

template<class Scalar >
std::string Tempus::TimeStepControlStrategyIntegralController< Scalar >::controller_
private

Control type ['I', 'PI', 'PID'].

Definition at line 333 of file Tempus_TimeStepControlStrategyIntegralController.hpp.

template<class Scalar >
Scalar Tempus::TimeStepControlStrategyIntegralController< Scalar >::KI_
private

Integral gain.

Definition at line 334 of file Tempus_TimeStepControlStrategyIntegralController.hpp.

template<class Scalar >
Scalar Tempus::TimeStepControlStrategyIntegralController< Scalar >::KP_
private

Proportional gain.

Definition at line 335 of file Tempus_TimeStepControlStrategyIntegralController.hpp.

template<class Scalar >
Scalar Tempus::TimeStepControlStrategyIntegralController< Scalar >::KD_
private

Derivative gain.

Definition at line 336 of file Tempus_TimeStepControlStrategyIntegralController.hpp.

template<class Scalar >
Scalar Tempus::TimeStepControlStrategyIntegralController< Scalar >::safetyFactor_
private

Safety Factor.

Definition at line 337 of file Tempus_TimeStepControlStrategyIntegralController.hpp.

template<class Scalar >
Scalar Tempus::TimeStepControlStrategyIntegralController< Scalar >::safetyFactorAfterReject_
private

Safety Factor Following Step Rejection.

Definition at line 338 of file Tempus_TimeStepControlStrategyIntegralController.hpp.

template<class Scalar >
Scalar Tempus::TimeStepControlStrategyIntegralController< Scalar >::facMaxINPUT_
private

Maximum Safety Factor from input.

Definition at line 339 of file Tempus_TimeStepControlStrategyIntegralController.hpp.

template<class Scalar >
Scalar Tempus::TimeStepControlStrategyIntegralController< Scalar >::facMax_
private

Maximum Safety Factor.

Definition at line 340 of file Tempus_TimeStepControlStrategyIntegralController.hpp.

template<class Scalar >
Scalar Tempus::TimeStepControlStrategyIntegralController< Scalar >::facMin_
private

Minimum Safety Factor.

Definition at line 341 of file Tempus_TimeStepControlStrategyIntegralController.hpp.

template<class Scalar >
bool Tempus::TimeStepControlStrategyIntegralController< Scalar >::firstSuccessfulStep_ = false
private
template<class Scalar >
bool Tempus::TimeStepControlStrategyIntegralController< Scalar >::lastStepRejected_ = false
private

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