9 #ifndef Tempus_StepperBDF2_decl_hpp
10 #define Tempus_StepperBDF2_decl_hpp
12 #include "Tempus_StepperImplicit.hpp"
14 #include "Tempus_StepperObserverComposite.hpp"
50 template<
class Scalar>
67 const Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> >& appModel,
69 const Teuchos::RCP<Thyra::NonlinearSolverBase<Scalar> >& solver,
72 std::string ICConsistency,
73 bool ICConsistencyCheck,
74 bool zeroInitialGuess);
81 virtual Teuchos::RCP<StepperObserver<Scalar> >
getObserver()
const
86 "DIRK 1 Stage Theta Method");
118 virtual Scalar
getAlpha(
const Scalar dt,
const Scalar dtOld)
const
119 {
return (Scalar(2.0)*dt + dtOld)/(dt*(dt + dtOld)); }
121 virtual Scalar
getBeta (
const Scalar )
const {
return Scalar(1.0); }
132 virtual void describe(Teuchos::FancyOStream & out,
133 const Teuchos::EVerbosityLevel verbLevel)
const;
159 template <
typename Scalar>
167 Scalar dt, Scalar dtOld, Teuchos::RCP<
const Thyra::VectorBase<Scalar> > xOld,
168 Teuchos::RCP<
const Thyra::VectorBase<Scalar> > xOldOld)
176 Teuchos::RCP<
const Thyra::VectorBase<Scalar> > x,
177 Teuchos::RCP< Thyra::VectorBase<Scalar> > xDot,
178 Teuchos::RCP< Thyra::VectorBase<Scalar> > xDotDot = Teuchos::null)
180 xDotDot = Teuchos::null;
185 Thyra::V_StVpStV(xDot.ptr(), a, *x, -(a+b), *
xOld_);
186 Thyra::Vp_StV(xDot.ptr(), b, *
xOldOld_);
190 Teuchos::RCP<
const Thyra::VectorBase<Scalar> > xOld,
191 Teuchos::RCP<
const Thyra::VectorBase<Scalar> > xOldOld)
196 Teuchos::RCP<const Thyra::VectorBase<Scalar> >
xOld_;
197 Teuchos::RCP<const Thyra::VectorBase<Scalar> >
xOldOld_;
205 #endif // Tempus_StepperBDF2_decl_hpp
BDF2 (Backward-Difference-Formula-2) time stepper.
virtual void setInitialConditions(const Teuchos::RCP< SolutionHistory< Scalar > > &solutionHistory)
Set the initial conditions and make them consistent.
Time-derivative interface for BDF2.
virtual Teuchos::RCP< Tempus::StepperState< Scalar > > getDefaultStepperState()
Get a default (initial) StepperState.
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 setObserver(Teuchos::RCP< StepperObserver< Scalar > > obs=Teuchos::null)
Set Observer.
virtual Teuchos::RCP< StepperObserver< Scalar > > getObserver() const
Get Observer.
virtual bool isExplicit() const
void setStartUpStepper(std::string startupStepperType="DIRK 1 Stage Theta Method")
Set the stepper to use in first step.
virtual void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) const
virtual Scalar getBeta(const Scalar) const
Return beta = d(x)/dx.
Teuchos::RCP< Stepper< Scalar > > startUpStepper_
Teuchos::RCP< StepperObserverComposite< Scalar > > stepperObserver_
virtual void computeStartUp(const Teuchos::RCP< SolutionHistory< Scalar > > &solutionHistory)
Compute the first time step given the supplied startup stepper.
virtual ~StepperBDF2TimeDerivative()
Destructor.
Thyra Base interface for time steppers.
Thyra Base interface for implicit time steppers.
virtual Scalar getAlpha(const Scalar dt) const
Return alpha = d(xDot)/dx.
Teuchos::RCP< StepperBDF2Observer< Scalar > > stepperBDF2Observer_
virtual Scalar getOrderMin() const
StepperObserver class for Stepper class.
Teuchos::RCP< SolutionHistory< Scalar > > solutionHistory(Teuchos::RCP< Teuchos::ParameterList > pList=Teuchos::null)
Nonmember constructor.
SolutionHistory is basically a container of SolutionStates. SolutionHistory maintains a collection of...
Teuchos::RCP< const Thyra::VectorBase< Scalar > > xOld_
virtual OrderODE getOrderODE() const
Stepper integrates first-order ODEs.
virtual Scalar getOrder() const
StepperBDF2TimeDerivative(Scalar dt, Scalar dtOld, Teuchos::RCP< const Thyra::VectorBase< Scalar > > xOld, Teuchos::RCP< const Thyra::VectorBase< Scalar > > xOldOld)
Constructor.
virtual bool isOneStepMethod() const
virtual bool isExplicitImplicit() const
This interface defines the time derivative connection between an implicit Stepper and WrapperModelEva...
virtual bool isMultiStepMethod() const
virtual void initialize(Scalar dt, Scalar dtOld, Teuchos::RCP< const Thyra::VectorBase< Scalar > > xOld, Teuchos::RCP< const Thyra::VectorBase< Scalar > > xOldOld)
virtual Scalar getAlpha(const Scalar dt, const Scalar dtOld) const
virtual Scalar getOrderMax() const
virtual bool getICConsistencyCheckDefault() const
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const
Teuchos::RCP< const Thyra::VectorBase< Scalar > > xOldOld_
virtual void takeStep(const Teuchos::RCP< SolutionHistory< Scalar > > &solutionHistory)
Take the specified timestep, dt, and return true if successful.
virtual void initialize()
Initialize during construction and after changing input parameters.
StepperBDF2()
Default constructor.
virtual bool isImplicit() const