10 #ifndef Tempus_StepperDIRK_decl_hpp
11 #define Tempus_StepperDIRK_decl_hpp
13 #include "Tempus_config.hpp"
15 #include "Tempus_StepperImplicit.hpp"
143 template <
class Scalar>
179 const int numStages = this->
tableau_->numStages();
182 for (
int i = 0; i < numStages; ++i)
183 if (A(i, i) == 0.0) isExplicit =
true;
184 return isExplicit && this->
tableau_->isDIRK();
206 virtual Scalar
getAlpha(
const Scalar dt)
const override
209 const int numStages = this->
tableau_->numStages();
211 (i < 0 || i > numStages - 1), std::logic_error,
212 "Invalid stage number, "
213 << i <<
". Valid range is 0 to " << (numStages - 1) <<
"\n"
214 <<
"(-1 indicates not currently in the stage loop). Try calling\n"
215 <<
"getAlpha(dt, i) directly with a valid stage number.\n");
221 virtual Scalar
getBeta(
const Scalar)
const override {
return Scalar(1.0); }
224 virtual Scalar
getAlpha(
const Scalar dt,
int i)
const
227 return (A(i, i) == 0.0) ? std::numeric_limits<Scalar>::infinity()
228 : Scalar(1.0) / (dt * A(i, i));
248 if (pl != Teuchos::null) {
268 bool useFSAL, std::string ICConsistency,
bool ICConsistencyCheck,
269 bool useEmbedded,
bool zeroInitialGuess,
276 std::vector<Teuchos::RCP<Thyra::VectorBase<Scalar> > >
stageXDot_;
294 template <
typename Scalar>
314 xDotDot = Teuchos::null;
315 Thyra::V_StVpStV(xDot.ptr(),
s_, *x, -
s_, *
xTilde_);
332 #endif // Tempus_StepperDIRK_decl_hpp
Teuchos::RCP< Thyra::VectorBase< Scalar > > xTilde_
Teuchos::RCP< const Thyra::VectorBase< Scalar > > xTilde_
virtual bool isMultiStepMethod() const override
virtual Scalar getBeta(const Scalar) const override
Return beta = d(x)/dx.
Teuchos::RCP< Teuchos::ParameterList > getValidParametersBasicDIRK() const
virtual bool isImplicit() const override
virtual bool isExplicitImplicit() const override
virtual void setModel(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &appModel) override
Set the model.
Teuchos::RCP< RKButcherTableau< Scalar > > tableau_
T & get(const std::string &name, T def_value)
virtual Scalar getAlpha(const Scalar dt) const override
Return alpha = d(xDot)/dx.
virtual void setUseEmbedded(bool a)
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
virtual void setupTableau()=0
virtual ~StepperDIRKTimeDerivative()
Destructor.
virtual void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) const override
virtual bool isExplicit() const override
virtual void compute(Teuchos::RCP< const Thyra::VectorBase< Scalar > > x, Teuchos::RCP< Thyra::VectorBase< Scalar > > xDot, Teuchos::RCP< Thyra::VectorBase< Scalar > > xDotDot=Teuchos::null)
Compute the time derivative.
virtual void setResetInitialGuess(bool reset_guess)
Base class for Runge-Kutta methods, ExplicitRK, DIRK and IMEX.
virtual OrderODE getOrderODE() const override
bool isParameter(const std::string &name) const
Diagonally Implicit Runge-Kutta (DIRK) time stepper.
Thyra Base interface for implicit time steppers.
Application Action for StepperRKBase.
virtual bool isOneStepMethod() const override
Time-derivative interface for DIRK.
virtual void setupDefault()
Default setup for constructor.
virtual void setStepperDIRKValues(Teuchos::RCP< Teuchos::ParameterList > pl)
Set StepperDIRK member data from the ParameterList.
virtual Scalar getAlpha(const Scalar dt, int i) const
Return alpha = d(xDot)/dx for stage i.
virtual Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const override
void setStepperSolverValues(Teuchos::RCP< Teuchos::ParameterList > pl)
Set solver from ParameterList.
virtual void setZeroInitialGuess(bool zIG)
virtual int getStageNumber() const
SolutionHistory is basically a container of SolutionStates. SolutionHistory maintains a collection of...
virtual bool isValidSetup(Teuchos::FancyOStream &out) const override
void setStepperValues(const Teuchos::RCP< Teuchos::ParameterList > pl)
Set Stepper member data from ParameterList.
std::vector< Teuchos::RCP< Thyra::VectorBase< Scalar > > > & getStageXDot()
Stepper integrates first-order ODEs.
virtual void initialize() override
Initialize after construction and changing input parameters.
virtual std::string getDescription() const =0
virtual void setInitialConditions(const Teuchos::RCP< SolutionHistory< Scalar > > &solutionHistory) override
Set the initial conditions and make them consistent.
This interface defines the time derivative connection between an implicit Stepper and WrapperModelEva...
virtual void setEmbeddedMemory() override
virtual void setup(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &wrapperModel, const Teuchos::RCP< Thyra::NonlinearSolverBase< Scalar > > &solver, bool useFSAL, std::string ICConsistency, bool ICConsistencyCheck, bool useEmbedded, bool zeroInitialGuess, const Teuchos::RCP< StepperRKAppAction< Scalar > > &stepperRKAppAction)
Setup for constructor.
virtual Teuchos::RCP< Tempus::StepperState< Scalar > > getDefaultStepperState() override
Get a default (initial) StepperState.
std::vector< Teuchos::RCP< Thyra::VectorBase< Scalar > > > stageXDot_
virtual void initialize(Scalar s, Teuchos::RCP< const Thyra::VectorBase< Scalar > > xTilde)
virtual bool getResetInitialGuess() const
virtual void takeStep(const Teuchos::RCP< SolutionHistory< Scalar > > &solutionHistory) override
Take the specified timestep, dt, and return true if successful.
Teuchos::RCP< Thyra::VectorBase< Scalar > > & getXTilde()
StepperDIRKTimeDerivative(Scalar s, Teuchos::RCP< const Thyra::VectorBase< Scalar > > xTilde)
Constructor.