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

Implicit-Explicit Runge-Kutta (IMEX-RK) time stepper. More...

#include <Tempus_StepperIMEX_RK_decl.hpp>

Inheritance diagram for Tempus::StepperIMEX_RK< Scalar >:
Inheritance graph
[legend]

Public Member Functions

 StepperIMEX_RK (std::string stepperType="IMEX RK SSP2")
 Default constructor. 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)
 Constructor for all member data. More...
 
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
 
void setOrder (Scalar order)
 
- Public Member Functions inherited from Tempus::StepperImplicit< Scalar >
Teuchos::RCP
< Teuchos::ParameterList
getValidParametersBasicImplicit () const
 
void setStepperImplicitValues (Teuchos::RCP< Teuchos::ParameterList > pl)
 Set StepperImplicit member data from the ParameterList. More...
 
void setStepperSolverValues (Teuchos::RCP< Teuchos::ParameterList > pl)
 Set solver from ParameterList. More...
 
void setSolverName (std::string i)
 Set the Solver Name. More...
 
std::string getSolverName () const
 Get the Solver Name. More...
 
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 >
void setStepperValues (const Teuchos::RCP< Teuchos::ParameterList > pl)
 Set Stepper member data from ParameterList. More...
 
Teuchos::RCP
< Teuchos::ParameterList
getValidParametersBasic () const
 Add basic parameters to Steppers ParameterList. More...
 
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 setStepperName (std::string s)
 Set the stepper name. More...
 
std::string getStepperName () const
 Get the stepper name. More...
 
std::string getStepperType () const
 Get the stepper type. The stepper type is used as an identifier for the stepper, and can only be set by the derived Stepper class. More...
 
virtual void setUseFSAL (bool a)
 
void setUseFSALTrueOnly (bool a)
 
void setUseFSALFalseOnly (bool a)
 
bool getUseFSAL () const
 
void setICConsistency (std::string s)
 
std::string getICConsistency () const
 
void setICConsistencyCheck (bool c)
 
bool getICConsistencyCheck () const
 
virtual Teuchos::RCP
< Thyra::VectorBase< Scalar > > 
getStepperX ()
 Get Stepper x. More...
 
virtual Teuchos::RCP
< Thyra::VectorBase< Scalar > > 
getStepperXDot ()
 Get Stepper xDot. More...
 
virtual Teuchos::RCP
< Thyra::VectorBase< Scalar > > 
getStepperXDotDot ()
 Get Stepper xDotDot. 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
 
- 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< Stepper< 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
 
- Public Member Functions inherited from Tempus::StepperRKBase< Scalar >
virtual int getNumberOfStages () const
 
virtual int getStageNumber () const
 
virtual void setStageNumber (int s)
 
virtual void setUseEmbedded (bool a)
 
virtual bool getUseEmbedded () const
 
virtual void setAppAction (Teuchos::RCP< StepperRKAppAction< Scalar > > appAction)
 
virtual Teuchos::RCP
< StepperRKAppAction< Scalar > > 
getAppAction () const
 
virtual void setStepperRKValues (Teuchos::RCP< Teuchos::ParameterList > pl)
 Set StepperRK member data from the ParameterList. More...
 
virtual Teuchos::RCP
< RKButcherTableau< Scalar > > 
createTableau (Teuchos::RCP< Teuchos::ParameterList > pl)
 

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_
 
- 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_
 
std::string solverName_
 
- Protected Attributes inherited from Tempus::Stepper< Scalar >
bool useFSAL_ = false
 Use First-Same-As-Last (FSAL) principle. More...
 
bool isInitialized_ = false
 True if stepper's member data is initialized. More...
 
- Protected Attributes inherited from Tempus::StepperRKBase< Scalar >
Teuchos::RCP< RKButcherTableau
< Scalar > > 
tableau_
 
bool useEmbedded_
 
Teuchos::RCP
< Thyra::VectorBase< Scalar > > 
ee_
 
Teuchos::RCP
< Thyra::VectorBase< Scalar > > 
abs_u0
 
Teuchos::RCP
< Thyra::VectorBase< Scalar > > 
abs_u
 
Teuchos::RCP
< Thyra::VectorBase< Scalar > > 
sc
 
int stageNumber_
 The current Runge-Kutta stage number, {0,...,s-1}. -1 indicates outside stage loop. More...
 
Teuchos::RCP
< StepperRKAppAction< Scalar > > 
stepperRKAppAction_
 

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 void setTableaus (Teuchos::RCP< Teuchos::ParameterList > stepperPL, std::string stepperType)
 
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 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
 

Additional Inherited Members

- Static Public Member Functions inherited from Teuchos::VerboseObject< Stepper< 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::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...
 
void setStepperType (std::string s)
 Set the stepper type. More...
 
- Protected Member Functions inherited from Teuchos::VerboseObject< Stepper< 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
 

Detailed Description

template<class Scalar>
class Tempus::StepperIMEX_RK< Scalar >

Implicit-Explicit Runge-Kutta (IMEX-RK) time stepper.

For the implicit ODE system, $ \mathcal{F}(\dot{x},x,t) = 0 $, we need to specialize this in order to separate the explicit, implicit, and temporal terms for the IMEX-RK time stepper,

\[ M(x,t)\, \dot{x}(x,t) + G(x,t) + F(x,t) = 0 \]

or

\[ \mathcal{G}(\dot{x},x,t) + F(x,t) = 0, \]

where $\mathcal{G}(\dot{x},x,t) = M(x,t)\, \dot{x} + G(x,t)$, $M(x,t)$ is the mass matrix, $F(x,t)$ is the operator representing the "slow" physics (and is evolved explicitly), and $G(x,t)$ is the operator representing the "fast" physics (and is evolved implicitly). Additionally, we assume that the mass matrix is invertible, so that

\[ \dot{x}(x,t) + g(x,t) + f(x,t) = 0 \]

where $f(x,t) = M(x,t)^{-1}\, F(x,t)$, and $g(x,t) = M(x,t)^{-1}\, G(x,t)$. Using Butcher tableaus for the explicit and implicit terms,

\[ \begin{array}{c|c} \hat{c} & \hat{a} \\ \hline & \hat{b}^T \end{array} \;\;\;\; \mbox{ and } \;\;\;\; \begin{array}{c|c} c & a \\ \hline & b^T \end{array}, \]

respectively, the basic IMEX-RK method for $s$-stages can be written as

\[ \begin{array}{rcll} X_i & = & x_{n-1} - \Delta t \sum_{j=1}^{i-1} \hat{a}_{ij}\, f(X_j,\hat{t}_j) - \Delta t \sum_{j=1}^i a_{ij}\, g(X_j,t_j) & \mbox{for } i=1\ldots s, \\ x_n & = & x_{n-1} - \Delta t \sum_{i=1}^s \hat{b}_{i}\, f(X_i,\hat{t}_i) - \Delta t \sum_{i=1}^s b_{i}\, g(X_i,t_i) & \end{array} \]

where $\hat{t}_i = t_{n-1}+\hat{c}_i\Delta t$ and $t_i = t_{n-1}+c_i\Delta t$. Note that the "slow" explicit physics, $f(X_j,\hat{t}_j)$, is evaluated at the explicit stage time, $\hat{t}_j$, and the "fast" implicit physics, $g(X_j,t_j)$, is evaluated at the implicit stage time, $t_j$. We can write the stage solution, $X_i$, as

\[ X_i = \tilde{X} - a_{ii} \Delta t\, g(X_i,t_i) \]

where

\[ \tilde{X} = x_{n-1} - \Delta t \sum_{j=1}^{i-1} \left(\hat{a}_{ij}\, f(X_j,\hat{t}_j) + a_{ij}\, g(X_j,t_j)\right) \]

Rewriting this in a form for Newton-type solvers, the implicit ODE is

\[ \mathcal{G}(\tilde{\dot{X}},X_i,t_i) = \tilde{\dot{X}} + g(X_i,t_i) = 0 \]

where we have defined a pseudo time derivative, $\tilde{\dot{X}}$,

\[ \tilde{\dot{X}} \equiv \frac{X_i - \tilde{X}}{a_{ii} \Delta t} \quad \quad \left[ = -g(X_i,t_i)\right] \]

that can be used with the implicit solve but is not the stage time derivative, $\dot{X}_i$. (Note that $\tilde{\dot{X}}$ 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, $\mathcal{G}(\tilde{\dot{X}},X_i,t) = M(X_i,t_i)\, \tilde{\dot{X}} + G(X_i,t_i) = 0$, can also be used to solve for $\tilde{\dot{X}}$).

To obtain the stage time derivative, $\dot{X}_i$, we can evaluate the governing equation at the implicit stage time, $t_i$,

\[ \dot{X}_i(X_i,t_i) + g(X_i,t_i) + f(X_i,t_i) = 0 \]

Note that even the explicit term, $f(X_i,t_i)$, is evaluated at the implicit stage time, $t_i$. Solving for $\dot{X}_i$, we find

\begin{eqnarray*} \dot{X}(X_i,t_i) & = & - g(X_i,t_i) - f(X_i,t_i) \\ \dot{X}(X_i,t_i) & = & \tilde{\dot{X}} - f(X_i,t_i) \end{eqnarray*}

Iteration Matrix, $W$. Recalling that the definition of the iteration matrix, $W$, is

\[ W = \alpha \frac{\partial \mathcal{F}_n}{\partial \dot{x}_n} + \beta \frac{\partial \mathcal{F}_n}{\partial x_n}, \]

where $ \alpha \equiv \frac{\partial \dot{x}_n(x_n) }{\partial x_n}, $ and $ \beta \equiv \frac{\partial x_n}{\partial x_n} = 1$. For the stage solutions, we are solving

\[ \mathcal{G} = \tilde{\dot{X}} + g(X_i,t_i) = 0. \]

where $\mathcal{F}_n \rightarrow \mathcal{G}$, $x_n \rightarrow X_{i}$, and $\dot{x}_n(x_n) \rightarrow \tilde{\dot{X}}(X_{i})$. The time derivative for the implicit solves is

\[ \tilde{\dot{X}} \equiv \frac{X_i - \tilde{X}}{a_{ii} \Delta t} \]

and we can determine that $ \alpha = \frac{1}{a_{ii} \Delta t} $ and $ \beta = 1 $, and therefore write

\[ W = \frac{1}{a_{ii} \Delta t} \frac{\partial \mathcal{G}}{\partial \tilde{\dot{X}}} + \frac{\partial \mathcal{G}}{\partial X_i}. \]

Explicit Stage in the Implicit Tableau. For the special case of an explicit stage in the implicit tableau, $a_{ii}=0$, we find that the stage solution, $X_i$, is

\[ X_i = x_{n-1} - \Delta t\,\sum_{j=1}^{i-1} \left( \hat{a}_{ij}\,f(X_j,\hat{t}_j) + a_{ij}\,g(X_j,t_j) \right) = \tilde{X} \]

and the time derivative of the stage solution, $\dot{X}(X_i,t_i)$, is

\[ \dot{X}_i(X_i,t_i) = - g(X_i,t_i) - f(X_i,t_i) \]

and again note that the explicit term, $f(X_i,t_i)$, is evaluated at the implicit stage time, $t_i$.

IMEX-RK Algorithm

The single-timestep algorithm for IMEX-RK is

\begin{center} \parbox{5in}{ \rule{5in}{0.4pt} \\ {\bf Algorithm} IMEX-RK \\ \rule{5in}{0.4pt} \vspace{-15pt} \begin{enumerate} \setlength{\itemsep}{0pt} \setlength{\parskip}{0pt} \setlength{\parsep}{0pt} \item $X \leftarrow x_{n-1}$ \hfill {\it * Reset initial guess to last timestep.} \item {\it appAction.execute(solutionHistory, stepper, BEGIN\_STEP)} \item {\bf for {$i = 0 \ldots s-1$}} \item \quad $\tilde{X} \leftarrow x_{n-1} - \Delta t\,\sum_{j=1}^{i-1} \left( \hat{a}_{ij}\, f_j + a_{ij}\, g_j \right)$ \item \quad {\it appAction.execute(solutionHistory, stepper, BEGIN\_STAGE)} \item \quad \hfill {\bf Implicit Tableau} \item \quad {\bf if ($a_{ii} = 0$) then} \item \qquad $X \leftarrow \tilde{X}$ \item \qquad {\bf if ($a_{k,i} = 0 \;\forall k = (i+1,\ldots, s-1)$, $b(i) = 0$, $b^\ast(i) = 0$) then} \item \qquad \quad $g_i \leftarrow 0$ \hfill {\it * Not needed for later calculations.} \item \qquad {\bf else} \item \qquad \quad $g_i \leftarrow M(X, t_i)^{-1}\, G(X, t_i)$ \item \qquad {\bf endif} \item \quad {\bf else} \item \qquad {\it appAction.execute(solutionHistory, stepper, BEFORE\_SOLVE)} \item \qquad {\bf if (``Zero initial guess.'') then} \item \qquad \quad $X \leftarrow 0$ \hfill {\it * Else use previous stage value as initial guess.} \item \qquad {\bf endif} \item \qquad {\bf Solve $\mathcal{G}\left(\tilde{\dot{X}} = \frac{X-\tilde{X}}{a_{ii} \Delta t},X,t_i\right) = 0$ for $X$} \item \qquad {\it appAction.execute(solutionHistory, stepper, AFTER\_SOLVE)} \item \qquad $\tilde{\dot{X}} \leftarrow \frac{X - \tilde{X}}{a_{ii} \Delta t}$ \item \qquad $g_i \leftarrow - \tilde{\dot{X}}$ \item \quad {\bf endif} \item \quad \hfill {\bf Explicit Tableau} \item \quad {\it appAction.execute(solutionHistory, stepper, BEFORE\_EXPLICIT\_EVAL)} \item \quad $f_i \leftarrow M(X,\hat{t}_i)^{-1}\, F(X,\hat{t}_i)$ \item \quad $\dot{X} \leftarrow - g_i - f_i$ [Optionally] \item \quad {\it appAction.execute(solutionHistory, stepper, END\_STAGE)} \item {\bf end for} \item $x_n \leftarrow x_{n-1} - \Delta t\,\sum_{i=1}^{s}\hat{b}_i\,f_i - \Delta t\,\sum_{i=1}^{s} b_i \,g_i$ \item {\it appAction.execute(solutionHistory, stepper, END\_STEP)} \end{enumerate} \vspace{-10pt} \rule{5in}{0.4pt} } \end{center}

The following table contains the pre-coded IMEX-RK tableaus.

IMEX-RK Tableaus
Name Order Implicit Tableau Explicit Tableau
IMEX RK 1st order 1st

\[ \begin{array}{c|cc} 0 & 0 & 0 \\ 1 & 0 & 1 \\ \hline & 0 & 1 \end{array} \]

\[ \begin{array}{c|cc} 0 & 0 & 0 \\ 1 & 1 & 0 \\ \hline & 1 & 0 \end{array} \]

SSP1_111 1st

\[ \begin{array}{c|c} 1 & 1 \\ \hline & 1 \end{array} \]

\[ \begin{array}{c|c} 0 & 0 \\ \hline & 1 \end{array} \]

IMEX RK SSP2
SSP2_222_L
$\gamma = 1-1/\sqrt{2}$
2nd

\[ \begin{array}{c|cc} \gamma & \gamma & 0 \\ 1-\gamma & 1-2\gamma & \gamma \\ \hline & 1/2 & 1/2 \end{array} \]

\[ \begin{array}{c|cc} 0 & 0 & 0 \\ 1 & 1 & 0 \\ \hline & 1/2 & 1/2 \end{array} \]

SSP2_222
SSP2_222_A
$\gamma = 1/2$
2nd

\[ \begin{array}{c|cc} \gamma & \gamma & 0 \\ 1-\gamma & 1-2\gamma & \gamma \\ \hline & 1/2 & 1/2 \end{array} \]

\[ \begin{array}{c|cc} 0 & 0 & 0 \\ 1 & 1 & 0 \\ \hline & 1/2 & 1/2 \end{array} \]

IMEX RK SSP3
SSP3_332
$\gamma = 1/ (2 + \sqrt{2})$
3rd

\[ \begin{array}{c|ccc} 0 & 0 & & \\ 1 & 1 & 0 & \\ 1/2 & 1/4 & 1/4 & 0 \\ \hline & 1/6 & 1/6 & 4/6 \end{array} \]

\[ \begin{array}{c|ccc} \gamma & \gamma & & \\ 1-\gamma & 1-2\gamma & \gamma & \\ 1-2 & 1/2 -\gamma & 0 & \gamma \\ \hline & 1/6 & 1/6 & 2/3 \end{array} \]

IMEX RK ARS 233
ARS 233
$\gamma = (3+\sqrt{3})/6$
3rd

\[ \begin{array}{c|ccc} 0 & 0 & 0 & 0 \\ \gamma & 0 & \gamma & 0 \\ 1-\gamma & 0 & 1-2\gamma & \gamma \\ \hline & 0 & 1/2 & 1/2 \end{array} \]

\[ \begin{array}{c|ccc} 0 & 0 & 0 & 0 \\ \gamma & \gamma & 0 & 0 \\ 1-\gamma & \gamma-1 & 2-2\gamma & 0 \\ \hline & 0 & 1/2 & 1/2 \end{array} \]

The First-Same-As-Last (FSAL) principle is not valid for IMEX RK. The default is to set useFSAL=false, and useFSAL=true will result in a warning.

References

  1. Ascher, Ruuth, Spiteri, "Implicit-explicit Runge-Kutta methods for time-dependent partial differential equations", Applied Numerical Mathematics 25 (1997) 151-167.
  2. Cyr, "IMEX Lagrangian Methods", SAND2015-3745C.
  3. Shadid, Cyr, Pawlowski, Widley, Scovazzi, Zeng, Phillips, Conde, Chuadhry, Hensinger, Fischer, Robinson, Rider, Niederhaus, Sanchez, "Towards an IMEX Monolithic ALE Method with Integrated UQ for Multiphysics Shock-hydro", SAND2016-11353, 2016, pp. 21-28.

Definition at line 289 of file Tempus_StepperIMEX_RK_decl.hpp.

Constructor & Destructor Documentation

template<class Scalar >
Tempus::StepperIMEX_RK< Scalar >::StepperIMEX_RK ( std::string  stepperType = "IMEX RK SSP2")

Default constructor.

Requires subsequent setModel(), setSolver() and initialize() calls before calling takeStep().

Definition at line 22 of file Tempus_StepperIMEX_RK_impl.hpp.

template<class Scalar >
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 
)

Constructor for all member data.

Definition at line 66 of file Tempus_StepperIMEX_RK_impl.hpp.

Member Function Documentation

template<class Scalar >
virtual Teuchos::RCP<const RKButcherTableau<Scalar> > Tempus::StepperIMEX_RK< Scalar >::getTableau ( ) const
inlinevirtual

Returns the explicit tableau!

Reimplemented from Tempus::StepperRKBase< Scalar >.

Definition at line 319 of file Tempus_StepperIMEX_RK_decl.hpp.

template<class Scalar >
void Tempus::StepperIMEX_RK< Scalar >::setTableaus ( std::string  stepperType = "",
Teuchos::RCP< const RKButcherTableau< Scalar > >  explicitTableau = Teuchos::null,
Teuchos::RCP< const RKButcherTableau< Scalar > >  implicitTableau = Teuchos::null 
)
virtual

Set both the explicit and implicit tableau from ParameterList.

Definition at line 132 of file Tempus_StepperIMEX_RK_impl.hpp.

template<class Scalar >
void Tempus::StepperIMEX_RK< Scalar >::setTableaus ( Teuchos::RCP< Teuchos::ParameterList stepperPL,
std::string  stepperType 
)
virtual

Definition at line 417 of file Tempus_StepperIMEX_RK_impl.hpp.

template<class Scalar >
virtual Teuchos::RCP<const RKButcherTableau<Scalar> > Tempus::StepperIMEX_RK< Scalar >::getExplicitTableau ( ) const
inlinevirtual

Return explicit tableau.

Definition at line 332 of file Tempus_StepperIMEX_RK_decl.hpp.

template<class Scalar >
void Tempus::StepperIMEX_RK< Scalar >::setExplicitTableau ( Teuchos::RCP< const RKButcherTableau< Scalar > >  explicitTableau)
virtual

Set the explicit tableau from tableau.

Definition at line 471 of file Tempus_StepperIMEX_RK_impl.hpp.

template<class Scalar >
virtual Teuchos::RCP<const RKButcherTableau<Scalar> > Tempus::StepperIMEX_RK< Scalar >::getImplicitTableau ( ) const
inlinevirtual

Return implicit tableau.

Definition at line 340 of file Tempus_StepperIMEX_RK_decl.hpp.

template<class Scalar >
void Tempus::StepperIMEX_RK< Scalar >::setImplicitTableau ( Teuchos::RCP< const RKButcherTableau< Scalar > >  implicitTableau)
virtual

Set the implicit tableau from tableau.

Definition at line 485 of file Tempus_StepperIMEX_RK_impl.hpp.

template<class Scalar >
void Tempus::StepperIMEX_RK< Scalar >::setModel ( const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &  appModel)
virtual

Reimplemented from Tempus::StepperImplicit< Scalar >.

Definition at line 498 of file Tempus_StepperIMEX_RK_impl.hpp.

template<class Scalar >
virtual Teuchos::RCP<const Thyra::ModelEvaluator<Scalar> > Tempus::StepperIMEX_RK< Scalar >::getModel ( )
inlinevirtual

Reimplemented from Tempus::StepperImplicit< Scalar >.

Definition at line 350 of file Tempus_StepperIMEX_RK_decl.hpp.

template<class Scalar >
void Tempus::StepperIMEX_RK< Scalar >::setModelPair ( const Teuchos::RCP< WrapperModelEvaluatorPairIMEX_Basic< Scalar > > &  modelPairIMEX)
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 531 of file Tempus_StepperIMEX_RK_impl.hpp.

template<class Scalar >
void Tempus::StepperIMEX_RK< Scalar >::setModelPair ( const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &  explicitModel,
const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &  implicitModel 
)
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 561 of file Tempus_StepperIMEX_RK_impl.hpp.

template<class Scalar >
void Tempus::StepperIMEX_RK< Scalar >::initialize ( )
virtual

Initialize during construction and after changing input parameters.

Reimplemented from Tempus::Stepper< Scalar >.

Definition at line 576 of file Tempus_StepperIMEX_RK_impl.hpp.

template<class Scalar >
void Tempus::StepperIMEX_RK< Scalar >::setInitialConditions ( const Teuchos::RCP< SolutionHistory< Scalar > > &  solutionHistory)
virtual

Set the initial conditions and make them consistent.

Reimplemented from Tempus::StepperImplicit< Scalar >.

Definition at line 602 of file Tempus_StepperIMEX_RK_impl.hpp.

template<class Scalar >
void Tempus::StepperIMEX_RK< Scalar >::takeStep ( const Teuchos::RCP< SolutionHistory< Scalar > > &  solutionHistory)
virtual

Take the specified timestep, dt, and return true if successful.

Implements Tempus::Stepper< Scalar >.

Definition at line 716 of file Tempus_StepperIMEX_RK_impl.hpp.

template<class Scalar >
Teuchos::RCP< Tempus::StepperState< Scalar > > Tempus::StepperIMEX_RK< Scalar >::getDefaultStepperState ( )
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 849 of file Tempus_StepperIMEX_RK_impl.hpp.

template<class Scalar >
virtual Scalar Tempus::StepperIMEX_RK< Scalar >::getOrder ( ) const
inlinevirtual

Reimplemented from Tempus::StepperRKBase< Scalar >.

Definition at line 372 of file Tempus_StepperIMEX_RK_decl.hpp.

template<class Scalar >
virtual Scalar Tempus::StepperIMEX_RK< Scalar >::getOrderMin ( ) const
inlinevirtual

Reimplemented from Tempus::StepperRKBase< Scalar >.

Definition at line 373 of file Tempus_StepperIMEX_RK_decl.hpp.

template<class Scalar >
virtual Scalar Tempus::StepperIMEX_RK< Scalar >::getOrderMax ( ) const
inlinevirtual

Reimplemented from Tempus::StepperRKBase< Scalar >.

Definition at line 374 of file Tempus_StepperIMEX_RK_decl.hpp.

template<class Scalar >
virtual bool Tempus::StepperIMEX_RK< Scalar >::isExplicit ( ) const
inlinevirtual

Implements Tempus::Stepper< Scalar >.

Definition at line 376 of file Tempus_StepperIMEX_RK_decl.hpp.

template<class Scalar >
virtual bool Tempus::StepperIMEX_RK< Scalar >::isImplicit ( ) const
inlinevirtual

Implements Tempus::Stepper< Scalar >.

Definition at line 377 of file Tempus_StepperIMEX_RK_decl.hpp.

template<class Scalar >
virtual bool Tempus::StepperIMEX_RK< Scalar >::isExplicitImplicit ( ) const
inlinevirtual

Implements Tempus::Stepper< Scalar >.

Definition at line 378 of file Tempus_StepperIMEX_RK_decl.hpp.

template<class Scalar >
virtual bool Tempus::StepperIMEX_RK< Scalar >::isOneStepMethod ( ) const
inlinevirtual

Implements Tempus::Stepper< Scalar >.

Definition at line 380 of file Tempus_StepperIMEX_RK_decl.hpp.

template<class Scalar >
virtual bool Tempus::StepperIMEX_RK< Scalar >::isMultiStepMethod ( ) const
inlinevirtual

Implements Tempus::Stepper< Scalar >.

Definition at line 381 of file Tempus_StepperIMEX_RK_decl.hpp.

template<class Scalar >
virtual OrderODE Tempus::StepperIMEX_RK< Scalar >::getOrderODE ( ) const
inlinevirtual

Implements Tempus::Stepper< Scalar >.

Definition at line 382 of file Tempus_StepperIMEX_RK_decl.hpp.

template<class Scalar >
std::vector<Teuchos::RCP<Thyra::VectorBase<Scalar> > >& Tempus::StepperIMEX_RK< Scalar >::getStageF ( )
inline

Definition at line 385 of file Tempus_StepperIMEX_RK_decl.hpp.

template<class Scalar >
std::vector<Teuchos::RCP<Thyra::VectorBase<Scalar> > >& Tempus::StepperIMEX_RK< Scalar >::getStageG ( )
inline

Definition at line 386 of file Tempus_StepperIMEX_RK_decl.hpp.

template<class Scalar >
Teuchos::RCP<Thyra::VectorBase<Scalar> >& Tempus::StepperIMEX_RK< Scalar >::getXTilde ( )
inline

Definition at line 387 of file Tempus_StepperIMEX_RK_decl.hpp.

template<class Scalar >
virtual Scalar Tempus::StepperIMEX_RK< Scalar >::getAlpha ( const Scalar  dt) const
inlinevirtual

Return alpha = d(xDot)/dx.

Implements Tempus::StepperImplicit< Scalar >.

Definition at line 390 of file Tempus_StepperIMEX_RK_decl.hpp.

template<class Scalar >
virtual Scalar Tempus::StepperIMEX_RK< Scalar >::getBeta ( const Scalar  ) const
inlinevirtual

Return beta = d(x)/dx.

Implements Tempus::StepperImplicit< Scalar >.

Definition at line 396 of file Tempus_StepperIMEX_RK_decl.hpp.

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

Reimplemented from Tempus::StepperImplicit< Scalar >.

Definition at line 935 of file Tempus_StepperIMEX_RK_impl.hpp.

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

Reimplemented from Tempus::StepperImplicit< Scalar >.

Definition at line 858 of file Tempus_StepperIMEX_RK_impl.hpp.

template<class Scalar >
bool Tempus::StepperIMEX_RK< Scalar >::isValidSetup ( Teuchos::FancyOStream out) const
virtual

Reimplemented from Tempus::StepperImplicit< Scalar >.

Definition at line 889 of file Tempus_StepperIMEX_RK_impl.hpp.

template<typename Scalar >
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 649 of file Tempus_StepperIMEX_RK_impl.hpp.

template<typename Scalar >
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 681 of file Tempus_StepperIMEX_RK_impl.hpp.

template<class Scalar >
void Tempus::StepperIMEX_RK< Scalar >::setOrder ( Scalar  order)
inline

Definition at line 418 of file Tempus_StepperIMEX_RK_decl.hpp.

Member Data Documentation

template<class Scalar >
Teuchos::RCP<const RKButcherTableau<Scalar> > Tempus::StepperIMEX_RK< Scalar >::explicitTableau_
protected

Definition at line 422 of file Tempus_StepperIMEX_RK_decl.hpp.

template<class Scalar >
Teuchos::RCP<const RKButcherTableau<Scalar> > Tempus::StepperIMEX_RK< Scalar >::implicitTableau_
protected

Definition at line 423 of file Tempus_StepperIMEX_RK_decl.hpp.

template<class Scalar >
Scalar Tempus::StepperIMEX_RK< Scalar >::order_
protected

Definition at line 425 of file Tempus_StepperIMEX_RK_decl.hpp.

template<class Scalar >
std::vector<Teuchos::RCP<Thyra::VectorBase<Scalar> > > Tempus::StepperIMEX_RK< Scalar >::stageF_
protected

Definition at line 427 of file Tempus_StepperIMEX_RK_decl.hpp.

template<class Scalar >
std::vector<Teuchos::RCP<Thyra::VectorBase<Scalar> > > Tempus::StepperIMEX_RK< Scalar >::stageG_
protected

Definition at line 428 of file Tempus_StepperIMEX_RK_decl.hpp.

template<class Scalar >
Teuchos::RCP<Thyra::VectorBase<Scalar> > Tempus::StepperIMEX_RK< Scalar >::xTilde_
protected

Definition at line 430 of file Tempus_StepperIMEX_RK_decl.hpp.


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