Tempus Version of the Day
Time Integration
|
Partitioned Implicit-Explicit Runge-Kutta (IMEX-RK) time stepper. More...
#include <Tempus_StepperIMEX_RK_Partition_decl.hpp>
Public Member Functions | |
StepperIMEX_RK_Partition (std::string stepperType="Partitioned IMEX RK SSP2") | |
Default constructor. | |
StepperIMEX_RK_Partition (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 to for all member data. | |
![]() | |
Teuchos::RCP< Teuchos::ParameterList > | getValidParametersBasicImplicit () const |
void | setStepperImplicitValues (Teuchos::RCP< Teuchos::ParameterList > pl) |
Set StepperImplicit member data from the ParameterList. | |
void | setStepperSolverValues (Teuchos::RCP< Teuchos::ParameterList > pl) |
Set solver from ParameterList. | |
void | setSolverName (std::string i) |
Set the Solver Name. | |
std::string | getSolverName () const |
Get the Solver Name. | |
virtual Teuchos::RCP< const WrapperModelEvaluator< Scalar > > | getWrapperModel () |
virtual void | setDefaultSolver () |
virtual void | setSolver (Teuchos::RCP< Thyra::NonlinearSolverBase< Scalar > > solver) override |
Set solver. | |
virtual Teuchos::RCP< Thyra::NonlinearSolverBase< Scalar > > | getSolver () const override |
Get solver. | |
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, const Teuchos::RCP< Thyra::VectorBase< Scalar > > &y=Teuchos::null, const int index=0) |
Solve implicit ODE, f(x, xDot, t, p) = 0. | |
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). | |
virtual void | setInitialGuess (Teuchos::RCP< const Thyra::VectorBase< Scalar > > initialGuess) override |
Pass initial guess to Newton solver (only relevant for implicit solvers) | |
virtual void | setZeroInitialGuess (bool zIG) |
Set parameter so that the initial guess is set to zero (=True) or use last timestep (=False). | |
virtual bool | getZeroInitialGuess () const |
virtual Scalar | getInitTimeStep (const Teuchos::RCP< SolutionHistory< Scalar > > &) const override |
![]() | |
virtual std::string | description () const |
void | setStepperValues (const Teuchos::RCP< Teuchos::ParameterList > pl) |
Set Stepper member data from ParameterList. | |
Teuchos::RCP< Teuchos::ParameterList > | getValidParametersBasic () const |
Add basic parameters to Steppers ParameterList. | |
virtual bool | isInitialized () |
True if stepper's member data is initialized. | |
virtual void | checkInitialized () |
Check initialization, and error out on failure. | |
void | setStepperName (std::string s) |
Set the stepper name. | |
std::string | getStepperName () const |
Get the stepper name. | |
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. | |
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. | |
virtual Teuchos::RCP< Thyra::VectorBase< Scalar > > | getStepperXDot () |
Get Stepper xDot. | |
virtual Teuchos::RCP< Thyra::VectorBase< Scalar > > | getStepperXDotDot () |
Get Stepper xDotDot. | |
virtual Teuchos::RCP< Thyra::VectorBase< Scalar > > | getStepperXDotDot (Teuchos::RCP< SolutionState< Scalar > > state) |
Get xDotDot from SolutionState or Stepper storage. | |
![]() | |
virtual Teuchos::RCP< const RKButcherTableau< Scalar > > | getTableau () const |
virtual Scalar | getOrder () const |
virtual Scalar | getOrderMin () const |
virtual Scalar | getOrderMax () const |
virtual int | getNumberOfStages () const |
virtual int | getStageNumber () const |
virtual void | setStageNumber (int s) |
virtual void | setUseEmbedded (bool a) |
virtual bool | getUseEmbedded () const |
virtual void | setErrorNorm (const Teuchos::RCP< Stepper_ErrorNorm< Scalar > > &errCalculator=Teuchos::null) |
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. | |
virtual Teuchos::RCP< RKButcherTableau< Scalar > > | createTableau (Teuchos::RCP< Teuchos::ParameterList > pl) |
Overridden from Teuchos::Describable | |
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 > > > | stageGx_ |
Teuchos::RCP< Thyra::VectorBase< Scalar > > | xTilde_ |
virtual void | describe (Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) const |
virtual bool | isValidSetup (Teuchos::FancyOStream &out) const |
void | evalImplicitModelExplicitly (const Teuchos::RCP< const Thyra::VectorBase< Scalar > > &X, const Teuchos::RCP< const Thyra::VectorBase< Scalar > > &Y, 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) |
Basic stepper methods | |
virtual Teuchos::RCP< const RKButcherTableau< Scalar > > | getTableau () const |
Returns the explicit tableau! | |
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. | |
virtual void | setTableausPartition (Teuchos::RCP< Teuchos::ParameterList > pl, std::string stepperType) |
virtual Teuchos::RCP< const RKButcherTableau< Scalar > > | getExplicitTableau () const |
Return explicit tableau. | |
virtual void | setExplicitTableau (Teuchos::RCP< const RKButcherTableau< Scalar > > explicitTableau) |
Set the explicit tableau from tableau. | |
virtual Teuchos::RCP< const RKButcherTableau< Scalar > > | getImplicitTableau () const |
Return implicit tableau. | |
virtual void | setImplicitTableau (Teuchos::RCP< const RKButcherTableau< Scalar > > implicitTableau) |
Set the implicit tableau from tableau. | |
virtual void | setModel (const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &appModel) |
Set the model. | |
virtual Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > | getModel () const |
virtual void | setModelPair (const Teuchos::RCP< WrapperModelEvaluatorPairPartIMEX_Basic< Scalar > > &modelPair) |
Create WrapperModelPairIMEX from user-supplied ModelEvaluator pair. | |
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. | |
virtual void | initialize () |
Initialize during construction and after changing input parameters. | |
virtual void | setInitialConditions (const Teuchos::RCP< SolutionHistory< Scalar > > &solutionHistory) |
Set the initial conditions and make them consistent. | |
virtual void | takeStep (const Teuchos::RCP< SolutionHistory< Scalar > > &solutionHistory) |
Take the specified timestep, dt, and return true if successful. | |
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. | |
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 |
std::vector< Teuchos::RCP< Thyra::VectorBase< Scalar > > > & | getStageF () |
std::vector< Teuchos::RCP< Thyra::VectorBase< Scalar > > > & | getStageGx () |
Teuchos::RCP< Thyra::VectorBase< Scalar > > & | getXTilde () |
virtual Scalar | getAlpha (const Scalar dt) const |
Return alpha = d(xDot)/dx. | |
virtual Scalar | getBeta (const Scalar) const |
Return beta = d(x)/dx. | |
Teuchos::RCP< const Teuchos::ParameterList > | getValidParameters () const |
Additional Inherited Members | |
![]() | |
virtual void | setStepperX (Teuchos::RCP< Thyra::VectorBase< Scalar > > x) |
Set x for Stepper storage. | |
virtual void | setStepperXDot (Teuchos::RCP< Thyra::VectorBase< Scalar > > xDot) |
Set xDot for Stepper storage. | |
virtual void | setStepperXDotDot (Teuchos::RCP< Thyra::VectorBase< Scalar > > xDotDot) |
Set x for Stepper storage. | |
void | setStepperType (std::string s) |
Set the stepper type. | |
![]() | |
virtual void | setEmbeddedMemory () |
![]() | |
Teuchos::RCP< WrapperModelEvaluator< Scalar > > | wrapperModel_ |
Teuchos::RCP< Thyra::NonlinearSolverBase< Scalar > > | solver_ |
Teuchos::RCP< const Thyra::VectorBase< Scalar > > | initialGuess_ |
bool | zeroInitialGuess_ |
std::string | solverName_ |
![]() | |
bool | useFSAL_ = false |
Use First-Same-As-Last (FSAL) principle. | |
bool | isInitialized_ = false |
True if stepper's member data is initialized. | |
![]() | |
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 |
Teuchos::RCP< Stepper_ErrorNorm< Scalar > > | stepperErrorNormCalculator_ |
int | stageNumber_ |
The current Runge-Kutta stage number, {0,...,s-1}. -1 indicates outside stage loop. | |
Teuchos::RCP< StepperRKAppAction< Scalar > > | stepperRKAppAction_ |
Partitioned Implicit-Explicit Runge-Kutta (IMEX-RK) time stepper.
Partitioned IMEX-RK is similar to the IMEX-RK (StepperIMEX_RK), except a portion of the solution only requires explicit integration, and should not be part of the implicit solution to reduce computational costs. Again our implicit ODE can be written as
but now
where
or
where
or
where
respectively, the basic scheme for this partitioned,
or expanded
where
where
or in expanded form as
where
and note that
Noting that we will be solving the implicit ODE for
where we have defined a pseudo time derivative,
that can be used with the implicit solve but is not the stage time derivative for the IMEX equations,
To obtain the stage time derivative,
The above time derivative,
Iteration Matrix,
where
where
and we can determine that
Explicit Stage in the Implicit Tableau. For general DIRK methods, we need to also handle the case when
and the time derivative of the stage solution is
but again note that the explicit term,
Algorithm The single-timestep algorithm for the partitioned IMEX-RK is
The following table contains the pre-coded IMEX-RK tableaus.
Name | Order | Implicit Tableau | Explicit Tableau |
---|---|---|---|
Partitioned IMEX RK 1st order | 1st |
|
|
Partitioned IMEX RK SSP2![]() | 2nd |
|
|
Partitioned IMEX RK ARS 233![]() | 3rd |
|
|
The First-Same-As-Last (FSAL) principle is not valid for IMEX RK Partition. The default is to set useFSAL=false, and useFSAL=true will result in a warning.
Definition at line 320 of file Tempus_StepperIMEX_RK_Partition_decl.hpp.
Tempus::StepperIMEX_RK_Partition< Scalar >::StepperIMEX_RK_Partition | ( | std::string | stepperType = "Partitioned IMEX RK SSP2" | ) |
Default constructor.
Requires subsequent setModel(), setSolver() and initialize() calls before calling takeStep().
Definition at line 22 of file Tempus_StepperIMEX_RK_Partition_impl.hpp.
Tempus::StepperIMEX_RK_Partition< Scalar >::StepperIMEX_RK_Partition | ( | 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 to for all member data.
Definition at line 52 of file Tempus_StepperIMEX_RK_Partition_impl.hpp.
|
inlinevirtual |
Returns the explicit tableau!
Reimplemented from Tempus::StepperRKBase< Scalar >.
Definition at line 349 of file Tempus_StepperIMEX_RK_Partition_decl.hpp.
|
virtual |
Set both the explicit and implicit tableau from ParameterList.
Definition at line 104 of file Tempus_StepperIMEX_RK_Partition_impl.hpp.
|
virtual |
Definition at line 302 of file Tempus_StepperIMEX_RK_Partition_impl.hpp.
|
inlinevirtual |
Return explicit tableau.
Definition at line 362 of file Tempus_StepperIMEX_RK_Partition_decl.hpp.
|
virtual |
Set the explicit tableau from tableau.
Definition at line 359 of file Tempus_StepperIMEX_RK_Partition_impl.hpp.
|
inlinevirtual |
Return implicit tableau.
Definition at line 370 of file Tempus_StepperIMEX_RK_Partition_decl.hpp.
|
virtual |
Set the implicit tableau from tableau.
Definition at line 373 of file Tempus_StepperIMEX_RK_Partition_impl.hpp.
|
virtual |
Set the model.
Reimplemented from Tempus::StepperImplicit< Scalar >.
Definition at line 386 of file Tempus_StepperIMEX_RK_Partition_impl.hpp.
|
inlinevirtual |
Reimplemented from Tempus::StepperImplicit< Scalar >.
Definition at line 380 of file Tempus_StepperIMEX_RK_Partition_decl.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 414 of file Tempus_StepperIMEX_RK_Partition_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 438 of file Tempus_StepperIMEX_RK_Partition_impl.hpp.
|
virtual |
Initialize during construction and after changing input parameters.
Reimplemented from Tempus::Stepper< Scalar >.
Definition at line 453 of file Tempus_StepperIMEX_RK_Partition_impl.hpp.
|
virtual |
Set the initial conditions and make them consistent.
Reimplemented from Tempus::StepperImplicit< Scalar >.
Definition at line 486 of file Tempus_StepperIMEX_RK_Partition_impl.hpp.
|
virtual |
Take the specified timestep, dt, and return true if successful.
Implements Tempus::Stepper< Scalar >.
Definition at line 605 of file Tempus_StepperIMEX_RK_Partition_impl.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 767 of file Tempus_StepperIMEX_RK_Partition_impl.hpp.
|
inlinevirtual |
Reimplemented from Tempus::StepperRKBase< Scalar >.
Definition at line 403 of file Tempus_StepperIMEX_RK_Partition_decl.hpp.
|
inlinevirtual |
Reimplemented from Tempus::StepperRKBase< Scalar >.
Definition at line 404 of file Tempus_StepperIMEX_RK_Partition_decl.hpp.
|
inlinevirtual |
Reimplemented from Tempus::StepperRKBase< Scalar >.
Definition at line 405 of file Tempus_StepperIMEX_RK_Partition_decl.hpp.
|
inlinevirtual |
Implements Tempus::Stepper< Scalar >.
Definition at line 407 of file Tempus_StepperIMEX_RK_Partition_decl.hpp.
|
inlinevirtual |
Implements Tempus::Stepper< Scalar >.
Definition at line 408 of file Tempus_StepperIMEX_RK_Partition_decl.hpp.
|
inlinevirtual |
Implements Tempus::Stepper< Scalar >.
Definition at line 409 of file Tempus_StepperIMEX_RK_Partition_decl.hpp.
|
inlinevirtual |
Implements Tempus::Stepper< Scalar >.
Definition at line 411 of file Tempus_StepperIMEX_RK_Partition_decl.hpp.
|
inlinevirtual |
Implements Tempus::Stepper< Scalar >.
Definition at line 412 of file Tempus_StepperIMEX_RK_Partition_decl.hpp.
|
inlinevirtual |
Implements Tempus::Stepper< Scalar >.
Definition at line 413 of file Tempus_StepperIMEX_RK_Partition_decl.hpp.
|
inline |
Definition at line 416 of file Tempus_StepperIMEX_RK_Partition_decl.hpp.
|
inline |
Definition at line 417 of file Tempus_StepperIMEX_RK_Partition_decl.hpp.
|
inline |
Definition at line 418 of file Tempus_StepperIMEX_RK_Partition_decl.hpp.
|
inlinevirtual |
Return alpha = d(xDot)/dx.
Implements Tempus::StepperImplicit< Scalar >.
Definition at line 421 of file Tempus_StepperIMEX_RK_Partition_decl.hpp.
|
inlinevirtual |
Return beta = d(x)/dx.
Implements Tempus::StepperImplicit< Scalar >.
Definition at line 427 of file Tempus_StepperIMEX_RK_Partition_decl.hpp.
|
virtual |
Reimplemented from Tempus::StepperImplicit< Scalar >.
Definition at line 862 of file Tempus_StepperIMEX_RK_Partition_impl.hpp.
|
virtual |
Reimplemented from Tempus::StepperImplicit< Scalar >.
Definition at line 777 of file Tempus_StepperIMEX_RK_Partition_impl.hpp.
|
virtual |
Reimplemented from Tempus::StepperImplicit< Scalar >.
Definition at line 809 of file Tempus_StepperIMEX_RK_Partition_impl.hpp.
void Tempus::StepperIMEX_RK_Partition< Scalar >::evalImplicitModelExplicitly | ( | const Teuchos::RCP< const Thyra::VectorBase< Scalar > > & | X, |
const Teuchos::RCP< const Thyra::VectorBase< Scalar > > & | Y, | ||
Scalar | time, | ||
Scalar | stepSize, | ||
Scalar | stageNumber, | ||
const Teuchos::RCP< Thyra::VectorBase< Scalar > > & | G | ||
) | const |
Definition at line 534 of file Tempus_StepperIMEX_RK_Partition_impl.hpp.
void Tempus::StepperIMEX_RK_Partition< 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 569 of file Tempus_StepperIMEX_RK_Partition_impl.hpp.
|
inline |
Definition at line 450 of file Tempus_StepperIMEX_RK_Partition_decl.hpp.
|
protected |
Definition at line 454 of file Tempus_StepperIMEX_RK_Partition_decl.hpp.
|
protected |
Definition at line 455 of file Tempus_StepperIMEX_RK_Partition_decl.hpp.
|
protected |
Definition at line 457 of file Tempus_StepperIMEX_RK_Partition_decl.hpp.
|
protected |
Definition at line 459 of file Tempus_StepperIMEX_RK_Partition_decl.hpp.
|
protected |
Definition at line 460 of file Tempus_StepperIMEX_RK_Partition_decl.hpp.
|
protected |
Definition at line 462 of file Tempus_StepperIMEX_RK_Partition_decl.hpp.