Tempus
Version of the Day
Time Integration
|
Implicit-Explicit Runge-Kutta (IMEX-RK) time stepper. More...
#include <Tempus_StepperIMEX_RK_decl.hpp>
Public Member Functions | |
StepperIMEX_RK () | |
Default constructor. More... | |
StepperIMEX_RK (const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &appModel, const Teuchos::RCP< StepperObserver< Scalar > > &obs, const Teuchos::RCP< Thyra::NonlinearSolverBase< Scalar > > &solver, bool useFSAL, std::string ICConsistency, bool ICConsistencyCheck, bool zeroInitialGuess, std::string stepperType, Teuchos::RCP< const RKButcherTableau< Scalar > > explicitTableau, Teuchos::RCP< const RKButcherTableau< Scalar > > implicitTableau, Scalar order) | |
Constructor for all member data. More... | |
StepperIMEX_RK (const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &appModel, const Teuchos::RCP< Thyra::NonlinearSolverBase< Scalar > > &solver, bool useFSAL, std::string ICConsistency, bool ICConsistencyCheck, bool zeroInitialGuess, const Teuchos::RCP< StepperRKAppAction< Scalar > > &stepperRKAppAction, std::string stepperType, Teuchos::RCP< const RKButcherTableau< Scalar > > explicitTableau, Teuchos::RCP< const RKButcherTableau< Scalar > > implicitTableau, Scalar order) | |
std::vector< Teuchos::RCP < Thyra::VectorBase< Scalar > > > & | getStageF () |
std::vector< Teuchos::RCP < Thyra::VectorBase< Scalar > > > & | getStageG () |
Teuchos::RCP < Thyra::VectorBase< Scalar > > & | getXTilde () |
virtual Scalar | getAlpha (const Scalar dt) const |
Return alpha = d(xDot)/dx. More... | |
virtual Scalar | getBeta (const Scalar) const |
Return beta = d(x)/dx. More... | |
Teuchos::RCP< const Teuchos::ParameterList > | getValidParameters () const |
virtual bool | isValidSetup (Teuchos::FancyOStream &out) const |
void | evalImplicitModelExplicitly (const Teuchos::RCP< const Thyra::VectorBase< Scalar > > &X, Scalar time, Scalar stepSize, Scalar stageNumber, const Teuchos::RCP< Thyra::VectorBase< Scalar > > &G) const |
void | evalExplicitModel (const Teuchos::RCP< const Thyra::VectorBase< Scalar > > &X, Scalar time, Scalar stepSize, Scalar stageNumber, const Teuchos::RCP< Thyra::VectorBase< Scalar > > &F) const |
virtual bool | getICConsistencyCheckDefault () const |
void | setOrder (Scalar order) |
Basic stepper methods | |
virtual Teuchos::RCP< const RKButcherTableau< Scalar > > | getTableau () const |
Returns the explicit tableau! More... | |
virtual void | setTableaus (std::string stepperType="", Teuchos::RCP< const RKButcherTableau< Scalar > > explicitTableau=Teuchos::null, Teuchos::RCP< const RKButcherTableau< Scalar > > implicitTableau=Teuchos::null) |
Set both the explicit and implicit tableau from ParameterList. More... | |
virtual Teuchos::RCP< const RKButcherTableau< Scalar > > | getExplicitTableau () const |
Return explicit tableau. More... | |
virtual void | setExplicitTableau (Teuchos::RCP< const RKButcherTableau< Scalar > > explicitTableau) |
Set the explicit tableau from tableau. More... | |
virtual Teuchos::RCP< const RKButcherTableau< Scalar > > | getImplicitTableau () const |
Return implicit tableau. More... | |
virtual void | setImplicitTableau (Teuchos::RCP< const RKButcherTableau< Scalar > > implicitTableau) |
Set the implicit tableau from tableau. More... | |
virtual void | setModel (const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &appModel) |
virtual Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > | getModel () |
virtual void | setModelPair (const Teuchos::RCP< WrapperModelEvaluatorPairIMEX_Basic< Scalar > > &mePair) |
Create WrapperModelPairIMEX from user-supplied ModelEvaluator pair. More... | |
virtual void | setModelPair (const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &explicitModel, const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &implicitModel) |
Create WrapperModelPairIMEX from explicit/implicit ModelEvaluators. 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 during construction and after changing input parameters. More... | |
virtual void | setInitialConditions (const Teuchos::RCP< SolutionHistory< Scalar > > &solutionHistory) |
Set the initial conditions and make them consistent. More... | |
virtual void | takeStep (const Teuchos::RCP< SolutionHistory< Scalar > > &solutionHistory) |
Take the specified timestep, dt, and return true if successful. More... | |
virtual Teuchos::RCP < Tempus::StepperState< Scalar > > | getDefaultStepperState () |
Provide a StepperState to the SolutionState. This Stepper does not have any special state data, so just provide the base class StepperState with the Stepper description. This can be checked to ensure that the input StepperState can be used by this Stepper. More... | |
virtual Scalar | getOrder () const |
virtual Scalar | getOrderMin () const |
virtual Scalar | getOrderMax () const |
virtual bool | isExplicit () const |
virtual bool | isImplicit () const |
virtual bool | isExplicitImplicit () const |
virtual bool | isOneStepMethod () const |
virtual bool | isMultiStepMethod () const |
virtual OrderODE | getOrderODE () const |
Overridden from Teuchos::Describable | |
virtual void | describe (Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) const |
Public Member Functions inherited from Tempus::StepperImplicit< Scalar > | |
virtual Teuchos::RCP< const WrapperModelEvaluator< Scalar > > | getWrapperModel () |
virtual void | setDefaultSolver () |
virtual void | setSolver (Teuchos::RCP< Thyra::NonlinearSolverBase< Scalar > > solver) |
Set solver. More... | |
virtual Teuchos::RCP < Thyra::NonlinearSolverBase < Scalar > > | getSolver () const |
Get solver. More... | |
const Thyra::SolveStatus< Scalar > | solveImplicitODE (const Teuchos::RCP< Thyra::VectorBase< Scalar > > &x) |
Solve problem using x in-place. (Needs to be deprecated!) More... | |
const Thyra::SolveStatus< Scalar > | solveImplicitODE (const Teuchos::RCP< Thyra::VectorBase< Scalar > > &x, const Teuchos::RCP< Thyra::VectorBase< Scalar > > &xDot, const Scalar time, const Teuchos::RCP< ImplicitODEParameters< Scalar > > &p) |
Solve implicit ODE, f(x, xDot, t, p) = 0. More... | |
void | evaluateImplicitODE (Teuchos::RCP< Thyra::VectorBase< Scalar > > &f, const Teuchos::RCP< Thyra::VectorBase< Scalar > > &x, const Teuchos::RCP< Thyra::VectorBase< Scalar > > &xDot, const Scalar time, const Teuchos::RCP< ImplicitODEParameters< Scalar > > &p) |
Evaluate implicit ODE residual, f(x, xDot, t, p). More... | |
virtual void | setInitialGuess (Teuchos::RCP< const Thyra::VectorBase< Scalar > > initialGuess) |
Pass initial guess to Newton solver (only relevant for implicit solvers) More... | |
virtual void | setZeroInitialGuess (bool zIG) |
Set parameter so that the initial guess is set to zero (=True) or use last timestep (=False). More... | |
virtual bool | getZeroInitialGuess () const |
virtual Scalar | getInitTimeStep (const Teuchos::RCP< SolutionHistory< Scalar > > &) const |
Public Member Functions inherited from Tempus::Stepper< Scalar > | |
virtual void | setNonConstModel (const Teuchos::RCP< Thyra::ModelEvaluator< Scalar > > &) |
virtual bool | isInitialized () |
True if stepper's member data is initialized. More... | |
virtual void | checkInitialized () |
Check initialization, and error out on failure. More... | |
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 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... | |
virtual std::string | description () const |
virtual void | createSubSteppers (std::vector< Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > >) |
Public Member Functions inherited from Tempus::StepperRKBase< Scalar > | |
virtual int | getNumberOfStages () const |
virtual int | getStageNumber () const |
virtual void | setStageNumber (int s) |
virtual Teuchos::RCP < Thyra::VectorBase< Scalar > > | getStageX () |
virtual Teuchos::RCP< const Thyra::VectorBase< Scalar > > | getStageX () const |
virtual void | setAppAction (Teuchos::RCP< StepperRKAppAction< Scalar > > appAction) |
virtual Teuchos::RCP < StepperRKAppAction< Scalar > > | getAppAction () const |
Protected Attributes | |
Teuchos::RCP< const RKButcherTableau< Scalar > > | explicitTableau_ |
Teuchos::RCP< const RKButcherTableau< Scalar > > | implicitTableau_ |
Scalar | order_ |
std::vector< Teuchos::RCP < Thyra::VectorBase< Scalar > > > | stageF_ |
std::vector< Teuchos::RCP < Thyra::VectorBase< Scalar > > > | stageG_ |
Teuchos::RCP < Thyra::VectorBase< Scalar > > | xTilde_ |
Teuchos::RCP < StepperRKObserverComposite < Scalar > > | stepperObserver_ |
Protected Attributes inherited from Tempus::StepperImplicit< Scalar > | |
Teuchos::RCP < WrapperModelEvaluator < Scalar > > | wrapperModel_ |
Teuchos::RCP < Thyra::NonlinearSolverBase < Scalar > > | solver_ |
Teuchos::RCP< const Thyra::VectorBase< Scalar > > | initialGuess_ |
bool | zeroInitialGuess_ |
Teuchos::RCP< StepperObserver < Scalar > > | stepperObserver_ |
Protected Attributes inherited from Tempus::Stepper< Scalar > | |
bool | isInitialized_ = false |
True if stepper's member data is initialized. More... | |
Protected Attributes inherited from Tempus::StepperRKBase< Scalar > | |
Teuchos::RCP< RKButcherTableau < Scalar > > | tableau_ |
int | stageNumber_ |
The current Runge-Kutta stage number, {0,...,s-1}. -1 indicates outside stage loop. More... | |
Teuchos::RCP < Thyra::VectorBase< Scalar > > | stageX_ |
Teuchos::RCP < StepperRKAppAction< Scalar > > | stepperRKAppAction_ |
Additional Inherited Members | |
Protected Member Functions inherited from Tempus::Stepper< Scalar > | |
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... | |
Implicit-Explicit Runge-Kutta (IMEX-RK) time stepper.
For the implicit ODE system, , we need to specialize this in order to separate the explicit, implicit, and temporal terms for the IMEX-RK time stepper,
or
where , is the mass matrix, is the operator representing the "slow" physics (and is evolved explicitly), and is the operator representing the "fast" physics (and is evolved implicitly). Additionally, we assume that the mass matrix is invertible, so that
where , and . Using Butcher tableaus for the explicit and implicit terms,
respectively, the basic IMEX-RK method for -stages can be written as
where and . Note that the "slow" explicit physics, , is evaluated at the explicit stage time, , and the "fast" implicit physics, , is evaluated at the implicit stage time, . We can write the stage solution, , as
where
Rewriting this in a form for Newton-type solvers, the implicit ODE is
where we have defined a pseudo time derivative, ,
that can be used with the implicit solve but is not the stage time derivative, . (Note that can be interpreted as the rate of change of the solution due to the implicit "fast" physics, and the "mass" version of the implicit ODE, , can also be used to solve for ).
To obtain the stage time derivative, , we can evaluate the governing equation at the implicit stage time, ,
Note that even the explicit term, , is evaluated at the implicit stage time, . Solving for , we find
Iteration Matrix, . Recalling that the definition of the iteration matrix, , is
where and . For the stage solutions, we are solving
where , , and . The time derivative for the implicit solves is
and we can determine that and , and therefore write
Explicit Stage in the Implicit Tableau. For the special case of an explicit stage in the implicit tableau, , we find that the stage solution, , is
and the time derivative of the stage solution, , is
and again note that the explicit term, , is evaluated at the implicit stage time, .
IMEX-RK Algorithm
The single-timestep algorithm for IMEX-RK is
The following table contains the pre-coded IMEX-RK tableaus.
Name | Order | Implicit Tableau | Explicit Tableau |
---|---|---|---|
IMEX RK 1st order | 1st |
|
|
SSP1_111 | 1st |
|
|
IMEX RK SSP2 SSP2_222_L | 2nd |
|
|
SSP2_222 SSP2_222_A | 2nd |
|
|
IMEX RK SSP3 SSP3_332 | 3rd |
|
|
IMEX RK ARS 233 ARS 233 | 3rd |
|
|
The First-Step-As-Last (FSAL) principle is not valid for IMEX RK. The default is to set useFSAL=false, and useFSAL=true will result in an error.
Definition at line 286 of file Tempus_StepperIMEX_RK_decl.hpp.
Tempus::StepperIMEX_RK< Scalar >::StepperIMEX_RK | ( | ) |
Default constructor.
Requires subsequent setModel(), setSolver() and initialize() calls before calling takeStep().
Definition at line 27 of file Tempus_StepperIMEX_RK_impl.hpp.
Tempus::StepperIMEX_RK< Scalar >::StepperIMEX_RK | ( | const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > & | appModel, |
const Teuchos::RCP< StepperObserver< Scalar > > & | obs, | ||
const Teuchos::RCP< Thyra::NonlinearSolverBase< Scalar > > & | solver, | ||
bool | useFSAL, | ||
std::string | ICConsistency, | ||
bool | ICConsistencyCheck, | ||
bool | zeroInitialGuess, | ||
std::string | stepperType, | ||
Teuchos::RCP< const RKButcherTableau< Scalar > > | explicitTableau, | ||
Teuchos::RCP< const RKButcherTableau< Scalar > > | implicitTableau, | ||
Scalar | order | ||
) |
Constructor for all member data.
Definition at line 48 of file Tempus_StepperIMEX_RK_impl.hpp.
Tempus::StepperIMEX_RK< Scalar >::StepperIMEX_RK | ( | const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > & | appModel, |
const Teuchos::RCP< Thyra::NonlinearSolverBase< Scalar > > & | solver, | ||
bool | useFSAL, | ||
std::string | ICConsistency, | ||
bool | ICConsistencyCheck, | ||
bool | zeroInitialGuess, | ||
const Teuchos::RCP< StepperRKAppAction< Scalar > > & | stepperRKAppAction, | ||
std::string | stepperType, | ||
Teuchos::RCP< const RKButcherTableau< Scalar > > | explicitTableau, | ||
Teuchos::RCP< const RKButcherTableau< Scalar > > | implicitTableau, | ||
Scalar | order | ||
) |
Definition at line 83 of file Tempus_StepperIMEX_RK_impl.hpp.
|
virtual |
Reimplemented from Tempus::StepperImplicit< Scalar >.
Definition at line 816 of file Tempus_StepperIMEX_RK_impl.hpp.
void Tempus::StepperIMEX_RK< Scalar >::evalExplicitModel | ( | const Teuchos::RCP< const Thyra::VectorBase< Scalar > > & | X, |
Scalar | time, | ||
Scalar | stepSize, | ||
Scalar | stageNumber, | ||
const Teuchos::RCP< Thyra::VectorBase< Scalar > > & | F | ||
) | const |
Definition at line 615 of file Tempus_StepperIMEX_RK_impl.hpp.
void Tempus::StepperIMEX_RK< Scalar >::evalImplicitModelExplicitly | ( | const Teuchos::RCP< const Thyra::VectorBase< Scalar > > & | X, |
Scalar | time, | ||
Scalar | stepSize, | ||
Scalar | stageNumber, | ||
const Teuchos::RCP< Thyra::VectorBase< Scalar > > & | G | ||
) | const |
Definition at line 583 of file Tempus_StepperIMEX_RK_impl.hpp.
|
inlinevirtual |
Return alpha = d(xDot)/dx.
Implements Tempus::StepperImplicit< Scalar >.
Definition at line 405 of file Tempus_StepperIMEX_RK_decl.hpp.
|
inlinevirtual |
Return beta = d(x)/dx.
Implements Tempus::StepperImplicit< Scalar >.
Definition at line 411 of file Tempus_StepperIMEX_RK_decl.hpp.
|
virtual |
Provide a StepperState to the SolutionState. This Stepper does not have any special state data, so just provide the base class StepperState with the Stepper description. This can be checked to ensure that the input StepperState can be used by this Stepper.
Implements Tempus::Stepper< Scalar >.
Definition at line 807 of file Tempus_StepperIMEX_RK_impl.hpp.
|
inlinevirtual |
Return explicit tableau.
Definition at line 339 of file Tempus_StepperIMEX_RK_decl.hpp.
|
inlinevirtual |
Reimplemented from Tempus::Stepper< Scalar >.
Definition at line 433 of file Tempus_StepperIMEX_RK_decl.hpp.
|
inlinevirtual |
Return implicit tableau.
Definition at line 347 of file Tempus_StepperIMEX_RK_decl.hpp.
|
inlinevirtual |
Reimplemented from Tempus::StepperImplicit< Scalar >.
Definition at line 357 of file Tempus_StepperIMEX_RK_decl.hpp.
|
inlinevirtual |
Get Observer.
Reimplemented from Tempus::Stepper< Scalar >.
Definition at line 371 of file Tempus_StepperIMEX_RK_decl.hpp.
|
inlinevirtual |
Reimplemented from Tempus::StepperRKBase< Scalar >.
Definition at line 386 of file Tempus_StepperIMEX_RK_decl.hpp.
|
inlinevirtual |
Reimplemented from Tempus::StepperRKBase< Scalar >.
Definition at line 388 of file Tempus_StepperIMEX_RK_decl.hpp.
|
inlinevirtual |
Reimplemented from Tempus::StepperRKBase< Scalar >.
Definition at line 387 of file Tempus_StepperIMEX_RK_decl.hpp.
|
inlinevirtual |
Implements Tempus::Stepper< Scalar >.
Definition at line 397 of file Tempus_StepperIMEX_RK_decl.hpp.
|
inline |
Definition at line 400 of file Tempus_StepperIMEX_RK_decl.hpp.
|
inline |
Definition at line 401 of file Tempus_StepperIMEX_RK_decl.hpp.
|
inlinevirtual |
Returns the explicit tableau!
Reimplemented from Tempus::StepperRKBase< Scalar >.
Definition at line 330 of file Tempus_StepperIMEX_RK_decl.hpp.
|
virtual |
Implements Tempus::Stepper< Scalar >.
Definition at line 903 of file Tempus_StepperIMEX_RK_impl.hpp.
|
inline |
Definition at line 402 of file Tempus_StepperIMEX_RK_decl.hpp.
|
virtual |
Initialize during construction and after changing input parameters.
Reimplemented from Tempus::Stepper< Scalar >.
Definition at line 510 of file Tempus_StepperIMEX_RK_impl.hpp.
|
inlinevirtual |
Implements Tempus::Stepper< Scalar >.
Definition at line 390 of file Tempus_StepperIMEX_RK_decl.hpp.
|
inlinevirtual |
Implements Tempus::Stepper< Scalar >.
Definition at line 392 of file Tempus_StepperIMEX_RK_decl.hpp.
|
inlinevirtual |
Implements Tempus::Stepper< Scalar >.
Definition at line 391 of file Tempus_StepperIMEX_RK_decl.hpp.
|
inlinevirtual |
Implements Tempus::Stepper< Scalar >.
Definition at line 395 of file Tempus_StepperIMEX_RK_decl.hpp.
|
inlinevirtual |
Implements Tempus::Stepper< Scalar >.
Definition at line 394 of file Tempus_StepperIMEX_RK_decl.hpp.
|
virtual |
Reimplemented from Tempus::StepperImplicit< Scalar >.
Definition at line 851 of file Tempus_StepperIMEX_RK_impl.hpp.
|
virtual |
Set the explicit tableau from tableau.
Definition at line 373 of file Tempus_StepperIMEX_RK_impl.hpp.
|
virtual |
Set the implicit tableau from tableau.
Definition at line 387 of file Tempus_StepperIMEX_RK_impl.hpp.
|
virtual |
Set the initial conditions and make them consistent.
Reimplemented from Tempus::StepperImplicit< Scalar >.
Definition at line 536 of file Tempus_StepperIMEX_RK_impl.hpp.
|
virtual |
Reimplemented from Tempus::StepperImplicit< Scalar >.
Definition at line 400 of file Tempus_StepperIMEX_RK_impl.hpp.
|
virtual |
Create WrapperModelPairIMEX from user-supplied ModelEvaluator pair.
The user-supplied ME pair can contain any user-specific IMEX interactions between explicit and implicit MEs.
Definition at line 433 of file Tempus_StepperIMEX_RK_impl.hpp.
|
virtual |
Create WrapperModelPairIMEX from explicit/implicit ModelEvaluators.
Use the supplied explicit/implicit MEs to create a WrapperModelPairIMEX with basic IMEX interactions between explicit and implicit MEs.
Definition at line 463 of file Tempus_StepperIMEX_RK_impl.hpp.
|
virtual |
Set Observer.
Reimplemented from Tempus::Stepper< Scalar >.
Definition at line 479 of file Tempus_StepperIMEX_RK_impl.hpp.
|
inline |
Definition at line 435 of file Tempus_StepperIMEX_RK_decl.hpp.
|
virtual |
Set both the explicit and implicit tableau from ParameterList.
Definition at line 121 of file Tempus_StepperIMEX_RK_impl.hpp.
|
virtual |
Take the specified timestep, dt, and return true if successful.
Implements Tempus::Stepper< Scalar >.
Definition at line 650 of file Tempus_StepperIMEX_RK_impl.hpp.
|
protected |
Definition at line 439 of file Tempus_StepperIMEX_RK_decl.hpp.
|
protected |
Definition at line 440 of file Tempus_StepperIMEX_RK_decl.hpp.
|
protected |
Definition at line 442 of file Tempus_StepperIMEX_RK_decl.hpp.
|
protected |
Definition at line 444 of file Tempus_StepperIMEX_RK_decl.hpp.
|
protected |
Definition at line 445 of file Tempus_StepperIMEX_RK_decl.hpp.
|
protected |
Definition at line 450 of file Tempus_StepperIMEX_RK_decl.hpp.
|
protected |
Definition at line 447 of file Tempus_StepperIMEX_RK_decl.hpp.