9 #ifndef Tempus_StepperBDF2_decl_hpp
10 #define Tempus_StepperBDF2_decl_hpp
12 #include "Tempus_StepperImplicit.hpp"
49 template<
class Scalar>
65 const Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> >& appModel,
66 Teuchos::RCP<Teuchos::ParameterList> pList = Teuchos::null);
75 void setStartUpStepper(Teuchos::RCP<Teuchos::ParameterList>startUpStepperPL=Teuchos::null);
106 virtual Scalar
getAlpha(
const Scalar dt,
const Scalar dtOld)
const
107 {
return (Scalar(2.0)*dt + dtOld)/(dt*(dt + dtOld)); }
109 virtual Scalar
getBeta (
const Scalar )
const {
return Scalar(1.0); }
127 virtual void describe(Teuchos::FancyOStream & out,
128 const Teuchos::EVerbosityLevel verbLevel)
const;
153 template <
typename Scalar>
161 Scalar dt, Scalar dtOld, Teuchos::RCP<
const Thyra::VectorBase<Scalar> > xOld,
162 Teuchos::RCP<
const Thyra::VectorBase<Scalar> > xOldOld)
170 Teuchos::RCP<
const Thyra::VectorBase<Scalar> > x,
171 Teuchos::RCP< Thyra::VectorBase<Scalar> > xDot,
172 Teuchos::RCP< Thyra::VectorBase<Scalar> > xDotDot = Teuchos::null)
174 xDotDot = Teuchos::null;
179 Thyra::V_StVpStV(xDot.ptr(), a, *x, -(a+b), *
xOld_);
180 Thyra::Vp_StV(xDot.ptr(), b, *
xOldOld_);
184 Teuchos::RCP<
const Thyra::VectorBase<Scalar> > xOld,
185 Teuchos::RCP<
const Thyra::VectorBase<Scalar> > xOldOld)
190 Teuchos::RCP<const Thyra::VectorBase<Scalar> >
xOld_;
191 Teuchos::RCP<const Thyra::VectorBase<Scalar> >
xOldOld_;
199 #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.
Teuchos::RCP< Teuchos::ParameterList > getNonconstParameterList()
virtual bool isExplicit() const
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_
void setParameterList(const Teuchos::RCP< Teuchos::ParameterList > &pl)
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 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< Teuchos::ParameterList > getDefaultParameters() const
Teuchos::RCP< Teuchos::ParameterList > unsetParameterList()
Teuchos::RCP< const Thyra::VectorBase< Scalar > > xOld_
virtual OrderODE getOrderODE() const
Stepper integrates first-order ODEs.
virtual Scalar getOrder() const
virtual std::string description() 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
void setStartUpStepper(std::string startupStepperName)
Set the stepper to use in first step.
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