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

Thyra Base interface for time steppers. More...

#include <Tempus_Integrator.hpp>

Inheritance diagram for Tempus::Stepper< Scalar >:
Tempus::StepperExplicit< Scalar > Tempus::StepperImplicit< Scalar > Tempus::StepperOperatorSplit< Scalar > Tempus::StepperRKBase< Scalar > Tempus::StepperStaggeredForwardSensitivity< Scalar > Tempus::StepperSubcycling< Scalar > Tempus::StepperExplicitRK< Scalar > Tempus::StepperForwardEuler< Scalar > Tempus::StepperLeapfrog< Scalar > Tempus::StepperNewmarkExplicitAForm< Scalar > Tempus_Test::StepperPhysicsStateTest< Scalar > Tempus::StepperBackwardEuler< Scalar > Tempus::StepperBDF2< Scalar > Tempus::StepperDIRK< Scalar > Tempus::StepperHHTAlpha< Scalar > Tempus::StepperIMEX_RK< Scalar > Tempus::StepperIMEX_RK_Partition< Scalar > Tempus::StepperNewmarkImplicitAForm< Scalar > Tempus::StepperNewmarkImplicitDForm< Scalar > Tempus::StepperTrapezoidal< Scalar > Tempus::StepperDIRK< Scalar > Tempus::StepperExplicitRK< Scalar > Tempus::StepperIMEX_RK< Scalar > Tempus::StepperIMEX_RK_Partition< Scalar >

Public Member Functions

virtual bool isValidSetup (Teuchos::FancyOStream &out) const
 
virtual Teuchos::RCP< const
Teuchos::ParameterList > 
getValidParameters () const =0
 
Basic stepper methods
virtual void setModel (const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &appModel)
 
virtual void setNonConstModel (const Teuchos::RCP< Thyra::ModelEvaluator< Scalar > > &)
 
virtual Teuchos::RCP< const
Thyra::ModelEvaluator< Scalar > > 
getModel ()
 
virtual void setSolver (Teuchos::RCP< Thyra::NonlinearSolverBase< Scalar > > solver)
 Set solver. More...
 
virtual Teuchos::RCP
< Thyra::NonlinearSolverBase
< Scalar > > 
getSolver () const
 Get solver. More...
 
virtual void setObserver (Teuchos::RCP< StepperObserver< Scalar > > obs=Teuchos::null)
 Set Observer. More...
 
virtual Teuchos::RCP
< StepperObserver< Scalar > > 
getObserver () const
 Get Observer. More...
 
virtual void initialize ()
 Initialize after construction and changing input parameters. More...
 
virtual bool isInitialized ()
 True if stepper's member data is initialized. More...
 
virtual void checkInitialized ()
 Check initialization, and error out on failure. More...
 
virtual void setInitialConditions (const Teuchos::RCP< SolutionHistory< Scalar > > &solutionHistory)=0
 Set initial conditions, make them consistent, and set stepper memory. More...
 
virtual void takeStep (const Teuchos::RCP< SolutionHistory< Scalar > > &solutionHistory)=0
 Take the specified timestep, dt, and return true if successful. More...
 
virtual void setInitialGuess (Teuchos::RCP< const Thyra::VectorBase< Scalar > > initialGuess=Teuchos::null)=0
 Pass initial guess to Newton solver (for implicit schemes) More...
 
virtual Teuchos::RCP
< Tempus::StepperState< Scalar > > 
getDefaultStepperState ()=0
 
virtual Scalar getOrder () const =0
 
virtual Scalar getOrderMin () const =0
 
virtual Scalar getOrderMax () const =0
 
virtual Scalar getInitTimeStep (const Teuchos::RCP< SolutionHistory< Scalar > > &solutionHistory) const =0
 
virtual bool isExplicit () const =0
 
virtual bool isImplicit () const =0
 
virtual bool isExplicitImplicit () const =0
 
virtual bool isOneStepMethod () const =0
 
virtual bool isMultiStepMethod () const =0
 
void setStepperType (std::string s)
 
std::string getStepperType () const
 
void setUseFSAL (bool a)
 
bool getUseFSAL () const
 
virtual bool getUseFSALDefault () const
 
void setICConsistency (std::string s)
 
std::string getICConsistency () const
 
virtual std::string getICConsistencyDefault () const
 
void setICConsistencyCheck (bool c)
 
bool getICConsistencyCheck () const
 
virtual bool getICConsistencyCheckDefault () const
 
virtual OrderODE getOrderODE () const =0
 
virtual Teuchos::RCP
< Thyra::VectorBase< Scalar > > 
getStepperX (Teuchos::RCP< SolutionState< Scalar > > state)
 Get x from SolutionState or Stepper storage. More...
 
virtual Teuchos::RCP
< Thyra::VectorBase< Scalar > > 
getStepperXDot (Teuchos::RCP< SolutionState< Scalar > > state)
 Get xDot from SolutionState or Stepper storage. More...
 
virtual Teuchos::RCP
< Thyra::VectorBase< Scalar > > 
getStepperXDotDot (Teuchos::RCP< SolutionState< Scalar > > state)
 Get xDotDot from SolutionState or Stepper storage. More...
 
Overridden from Teuchos::Describable
virtual std::string description () const
 
virtual void describe (Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) const
 
Functions for Steppers with subSteppers (e.g., OperatorSplit)
virtual void createSubSteppers (std::vector< Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > >)
 

Protected Member Functions

virtual void setStepperX (Teuchos::RCP< Thyra::VectorBase< Scalar > > x)
 Set x for Stepper storage. More...
 
virtual void setStepperXDot (Teuchos::RCP< Thyra::VectorBase< Scalar > > xDot)
 Set xDot for Stepper storage. More...
 
virtual void setStepperXDotDot (Teuchos::RCP< Thyra::VectorBase< Scalar > > xDotDot)
 Set x for Stepper storage. More...
 

Protected Attributes

bool isInitialized_ = false
 True if stepper's member data is initialized. More...
 

Private Attributes

std::string stepperType_
 Name of stepper type. More...
 
bool useFSAL_ = false
 Use First-Step-As-Last (FSAL) principle. More...
 
std::string ICConsistency_ = std::string("None")
 Type of consistency to apply to ICs. More...
 
bool ICConsistencyCheck_ = true
 Check if the initial condition is consistent. More...
 
Teuchos::RCP
< Thyra::VectorBase< Scalar > > 
stepperX_
 
Teuchos::RCP
< Thyra::VectorBase< Scalar > > 
stepperXDot_
 
Teuchos::RCP
< Thyra::VectorBase< Scalar > > 
stepperXDotDot_
 

Detailed Description

template<typename Scalar>
class Tempus::Stepper< Scalar >

Thyra Base interface for time steppers.

Design Considerations

  • Time steppers are designed to take a single time step.
    • a single implicit solve for a time step
    • a single solve for a IMEX time step
  • Multiple time steps should be managed by Integrators.
  • Steppers can be built from other Sub-Steppers.
    • An operator-split Stepper is possible with interoperable Steppers.
  • For explicit steppers, only one ModelEvaluator and one solution vector are required.
  • For implicit steppers, only one ModelEvaluator, one solution vector, and one solver are required.
  • Steppers will PASS/FAIL the time step based on Solver, error and order requirements, and not adjust the time step size.
  • Steppers can provide a suggested time step size for the next time step.
  • For more complex steppers, multiple ModelEvaluators, solution vectors, and solvers are possible when a common single time-integration method is desired for all solutions. Examples:
    • Solution A with ModelEvaluator A and Solution B with ModelEvaluator B using the same solver
    • Solution A with ModelEvaluator A using Solver A and Solution B with ModelEvaluator B using Solver B
    • Solution A with ModelEvaluator A using Solver A and Solutions A and B with ModelEvaluator C using Solver B
  • Steppers may maintain their own time history of the solution, e.g., BDF steppers.

Definition at line 24 of file Tempus_Integrator.hpp.

Member Function Documentation

template<class Scalar >
void Tempus::Stepper< Scalar >::checkInitialized ( )
virtual

Check initialization, and error out on failure.

Definition at line 165 of file Tempus_Stepper_impl.hpp.

template<typename Scalar>
virtual void Tempus::Stepper< Scalar >::createSubSteppers ( std::vector< Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > >  )
inlinevirtual

Definition at line 180 of file Tempus_Stepper_decl.hpp.

template<typename Scalar>
virtual std::string Tempus::Stepper< Scalar >::description ( ) const
inlinevirtual
template<typename Scalar>
std::string Tempus::Stepper< Scalar >::getICConsistency ( ) const
inline

Definition at line 142 of file Tempus_Stepper_decl.hpp.

template<typename Scalar>
bool Tempus::Stepper< Scalar >::getICConsistencyCheck ( ) const
inline

Definition at line 147 of file Tempus_Stepper_decl.hpp.

template<typename Scalar>
virtual std::string Tempus::Stepper< Scalar >::getICConsistencyDefault ( ) const
inlinevirtual
template<typename Scalar>
virtual Teuchos::RCP<Thyra::NonlinearSolverBase<Scalar> > Tempus::Stepper< Scalar >::getSolver ( ) const
inlinevirtual
template<typename Scalar>
std::string Tempus::Stepper< Scalar >::getStepperType ( ) const
inline

Definition at line 134 of file Tempus_Stepper_decl.hpp.

template<class Scalar >
Teuchos::RCP< Thyra::VectorBase< Scalar > > Tempus::Stepper< Scalar >::getStepperX ( Teuchos::RCP< SolutionState< Scalar > >  state)
virtual

Get x from SolutionState or Stepper storage.

Definition at line 178 of file Tempus_Stepper_impl.hpp.

template<class Scalar >
Teuchos::RCP< Thyra::VectorBase< Scalar > > Tempus::Stepper< Scalar >::getStepperXDot ( Teuchos::RCP< SolutionState< Scalar > >  state)
virtual

Get xDot from SolutionState or Stepper storage.

Definition at line 193 of file Tempus_Stepper_impl.hpp.

template<class Scalar >
Teuchos::RCP< Thyra::VectorBase< Scalar > > Tempus::Stepper< Scalar >::getStepperXDotDot ( Teuchos::RCP< SolutionState< Scalar > >  state)
virtual

Get xDotDot from SolutionState or Stepper storage.

Definition at line 208 of file Tempus_Stepper_impl.hpp.

template<typename Scalar>
bool Tempus::Stepper< Scalar >::getUseFSAL ( ) const
inline

Definition at line 137 of file Tempus_Stepper_decl.hpp.

template<typename Scalar>
virtual bool Tempus::Stepper< Scalar >::getUseFSALDefault ( ) const
inlinevirtual
template<typename Scalar>
virtual Teuchos::RCP<const Teuchos::ParameterList> Tempus::Stepper< Scalar >::getValidParameters ( ) const
pure virtual

Implemented in Tempus::StepperDIRK_General< Scalar >, Tempus::StepperSDIRK_21Pair< Scalar >, Tempus::StepperSDIRK_5Stage5thOrder< Scalar >, Tempus::StepperSDIRK_3Stage4thOrder< Scalar >, Tempus::StepperSDIRK_5Stage4thOrder< Scalar >, Tempus::StepperDIRK_2Stage2ndOrderLobattoIIIB< Scalar >, Tempus::StepperDIRK_1Stage1stOrderRadauIA< Scalar >, Tempus::StepperSDIRK_SSPDIRK33< Scalar >, Tempus::StepperSDIRK_SSPDIRK23< Scalar >, Tempus::StepperSDIRK_SSPDIRK32< Scalar >, Tempus::StepperSDIRK_SSPDIRK22< Scalar >, Tempus::StepperSDIRK_ImplicitMidpoint< Scalar >, Tempus::StepperEDIRK_TrapezoidalRule< Scalar >, Tempus::StepperEDIRK_2StageTheta< Scalar >, Tempus::StepperDIRK_1StageTheta< Scalar >, Tempus::StepperEDIRK_2Stage3rdOrder< Scalar >, Tempus::StepperSDIRK_2Stage3rdOrder< Scalar >, Tempus::StepperSDIRK_3Stage2ndOrder< Scalar >, Tempus::StepperSDIRK_2Stage2ndOrder< Scalar >, Tempus::StepperDIRK_BackwardEuler< Scalar >, Tempus::StepperERK_General< Scalar >, Tempus::StepperIMEX_RK_Partition< Scalar >, Tempus::StepperIMEX_RK< Scalar >, Tempus::StepperDIRK< Scalar >, Tempus::StepperOperatorSplit< Scalar >, Tempus::StepperBackwardEuler< Scalar >, Tempus::StepperBDF2< Scalar >, Tempus::StepperStaggeredForwardSensitivity< Scalar >, Tempus::StepperNewmarkImplicitAForm< Scalar >, Tempus::StepperExplicitRK< Scalar >, Tempus::StepperSubcycling< Scalar >, Tempus::StepperLeapfrog< Scalar >, Tempus::StepperTrapezoidal< Scalar >, Tempus::StepperNewmarkImplicitDForm< Scalar >, Tempus::StepperForwardEuler< Scalar >, Tempus::StepperNewmarkExplicitAForm< Scalar >, Tempus::StepperHHTAlpha< Scalar >, and Tempus_Test::StepperPhysicsStateTest< Scalar >.

template<typename Scalar>
virtual bool Tempus::Stepper< Scalar >::isInitialized ( )
inlinevirtual

True if stepper's member data is initialized.

Definition at line 100 of file Tempus_Stepper_decl.hpp.

template<typename Scalar>
void Tempus::Stepper< Scalar >::setICConsistency ( std::string  s)
inline

Definition at line 140 of file Tempus_Stepper_decl.hpp.

template<typename Scalar>
void Tempus::Stepper< Scalar >::setICConsistencyCheck ( bool  c)
inline

Definition at line 145 of file Tempus_Stepper_decl.hpp.

template<typename Scalar>
virtual void Tempus::Stepper< Scalar >::setInitialGuess ( Teuchos::RCP< const Thyra::VectorBase< Scalar > >  initialGuess = Teuchos::null)
pure virtual
template<typename Scalar>
virtual void Tempus::Stepper< Scalar >::setNonConstModel ( const Teuchos::RCP< Thyra::ModelEvaluator< Scalar > > &  )
inlinevirtual

Reimplemented in Tempus::StepperSubcycling< Scalar >.

Definition at line 73 of file Tempus_Stepper_decl.hpp.

template<typename Scalar>
virtual void Tempus::Stepper< Scalar >::setSolver ( Teuchos::RCP< Thyra::NonlinearSolverBase< Scalar > >  solver)
inlinevirtual
template<typename Scalar>
void Tempus::Stepper< Scalar >::setStepperType ( std::string  s)
inline

Definition at line 132 of file Tempus_Stepper_decl.hpp.

template<typename Scalar>
virtual void Tempus::Stepper< Scalar >::setStepperX ( Teuchos::RCP< Thyra::VectorBase< Scalar > >  x)
inlineprotectedvirtual

Set x for Stepper storage.

Definition at line 201 of file Tempus_Stepper_decl.hpp.

template<typename Scalar>
virtual void Tempus::Stepper< Scalar >::setStepperXDot ( Teuchos::RCP< Thyra::VectorBase< Scalar > >  xDot)
inlineprotectedvirtual

Set xDot for Stepper storage.

Definition at line 205 of file Tempus_Stepper_decl.hpp.

template<typename Scalar>
virtual void Tempus::Stepper< Scalar >::setStepperXDotDot ( Teuchos::RCP< Thyra::VectorBase< Scalar > >  xDotDot)
inlineprotectedvirtual

Set x for Stepper storage.

Definition at line 209 of file Tempus_Stepper_decl.hpp.

template<typename Scalar>
void Tempus::Stepper< Scalar >::setUseFSAL ( bool  a)
inline

Definition at line 136 of file Tempus_Stepper_decl.hpp.

Member Data Documentation

template<typename Scalar>
std::string Tempus::Stepper< Scalar >::ICConsistency_ = std::string("None")
private

Type of consistency to apply to ICs.

Definition at line 190 of file Tempus_Stepper_decl.hpp.

template<typename Scalar>
bool Tempus::Stepper< Scalar >::ICConsistencyCheck_ = true
private

Check if the initial condition is consistent.

Definition at line 191 of file Tempus_Stepper_decl.hpp.

template<typename Scalar>
bool Tempus::Stepper< Scalar >::isInitialized_ = false
protected

True if stepper's member data is initialized.

Definition at line 212 of file Tempus_Stepper_decl.hpp.

template<typename Scalar>
std::string Tempus::Stepper< Scalar >::stepperType_
private

Name of stepper type.

Definition at line 188 of file Tempus_Stepper_decl.hpp.

template<typename Scalar>
Teuchos::RCP<Thyra::VectorBase<Scalar> > Tempus::Stepper< Scalar >::stepperX_
private

Definition at line 194 of file Tempus_Stepper_decl.hpp.

template<typename Scalar>
Teuchos::RCP<Thyra::VectorBase<Scalar> > Tempus::Stepper< Scalar >::stepperXDot_
private

Definition at line 195 of file Tempus_Stepper_decl.hpp.

template<typename Scalar>
Teuchos::RCP<Thyra::VectorBase<Scalar> > Tempus::Stepper< Scalar >::stepperXDotDot_
private

Definition at line 196 of file Tempus_Stepper_decl.hpp.

template<typename Scalar>
bool Tempus::Stepper< Scalar >::useFSAL_ = false
private

Use First-Step-As-Last (FSAL) principle.

Definition at line 189 of file Tempus_Stepper_decl.hpp.


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