9 #ifndef Tempus_StepperBDF2_decl_hpp
10 #define Tempus_StepperBDF2_decl_hpp
12 #include "Tempus_StepperImplicit.hpp"
14 #include "Tempus_StepperObserverComposite.hpp"
75 template<
class Scalar>
92 const Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> >& appModel,
94 const Teuchos::RCP<Thyra::NonlinearSolverBase<Scalar> >& solver,
97 std::string ICConsistency,
98 bool ICConsistencyCheck,
99 bool zeroInitialGuess);
104 const Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> >& appModel);
109 virtual Teuchos::RCP<StepperObserver<Scalar> >
getObserver()
const
145 virtual Scalar
getAlpha(
const Scalar dt,
const Scalar dtOld)
const
146 {
return (Scalar(2.0)*dt + dtOld)/(dt*(dt + dtOld)); }
148 virtual Scalar
getBeta (
const Scalar )
const {
return Scalar(1.0); }
159 virtual void describe(Teuchos::FancyOStream & out,
160 const Teuchos::EVerbosityLevel verbLevel)
const;
163 virtual bool isValidSetup(Teuchos::FancyOStream & out)
const;
188 template <
typename Scalar>
196 Scalar dt, Scalar dtOld, Teuchos::RCP<
const Thyra::VectorBase<Scalar> > xOld,
197 Teuchos::RCP<
const Thyra::VectorBase<Scalar> > xOldOld)
205 Teuchos::RCP<
const Thyra::VectorBase<Scalar> > x,
206 Teuchos::RCP< Thyra::VectorBase<Scalar> > xDot,
207 Teuchos::RCP< Thyra::VectorBase<Scalar> > xDotDot = Teuchos::null)
209 xDotDot = Teuchos::null;
214 Thyra::V_StVpStV(xDot.ptr(), a, *x, -(a+b), *
xOld_);
215 Thyra::Vp_StV(xDot.ptr(), b, *
xOldOld_);
219 Teuchos::RCP<
const Thyra::VectorBase<Scalar> > xOld,
220 Teuchos::RCP<
const Thyra::VectorBase<Scalar> > xOldOld)
225 Teuchos::RCP<const Thyra::VectorBase<Scalar> >
xOld_;
226 Teuchos::RCP<const Thyra::VectorBase<Scalar> >
xOldOld_;
234 #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
virtual void setModel(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &appModel)
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.
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 bool isValidSetup(Teuchos::FancyOStream &out) const
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.
void setStartUpStepper(std::string startupStepperType)
Set the stepper to use in first step.
virtual void initialize()
Initialize during construction and after changing input parameters.
StepperBDF2()
Default constructor.
virtual bool isImplicit() const