9 #ifndef Tempus_StepperBackwardEuler_decl_hpp
10 #define Tempus_StepperBackwardEuler_decl_hpp
12 #include "Tempus_StepperImplicit.hpp"
14 #ifndef TEMPUS_HIDE_DEPRECATED_CODE
71 template<
class Scalar>
85 #ifndef TEMPUS_HIDE_DEPRECATED_CODE
88 const Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> >& appModel,
90 const Teuchos::RCP<Thyra::NonlinearSolverBase<Scalar> >& solver,
93 std::string ICConsistency,
94 bool ICConsistencyCheck,
95 bool zeroInitialGuess);
100 const Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> >& appModel,
101 const Teuchos::RCP<Thyra::NonlinearSolverBase<Scalar> >& solver,
104 std::string ICConsistency,
105 bool ICConsistencyCheck,
106 bool zeroInitialGuess,
111 #ifndef TEMPUS_HIDE_DEPRECATED_CODE
115 virtual Teuchos::RCP<StepperObserver<Scalar> >
getObserver()
const
122 virtual Teuchos::RCP<StepperBackwardEulerAppAction<Scalar> >
getAppAction()
const
154 virtual Scalar
getAlpha(
const Scalar dt)
const {
return Scalar(1.0)/dt; }
156 virtual Scalar
getBeta (
const Scalar )
const {
return Scalar(1.0); }
166 virtual void describe(Teuchos::FancyOStream & out,
167 const Teuchos::EVerbosityLevel verbLevel)
const;
170 virtual bool isValidSetup(Teuchos::FancyOStream & out)
const;
176 Thyra::VectorBase<Scalar>& residual,
177 const Teuchos::Array< Teuchos::RCP<
const Thyra::VectorBase<Scalar> > >& x,
178 const Teuchos::Array<Scalar>& t,
179 const Thyra::VectorBase<Scalar>& p,
180 const int param_index)
const;
182 Thyra::LinearOpBase<Scalar>& jacobian,
183 const Teuchos::Array< Teuchos::RCP<
const Thyra::VectorBase<Scalar> > >& x,
184 const Teuchos::Array<Scalar>& t,
185 const Thyra::VectorBase<Scalar>& p,
186 const int param_index,
187 const int deriv_index)
const;
189 Thyra::LinearOpBase<Scalar>& deriv,
190 const Teuchos::Array< Teuchos::RCP<
const Thyra::VectorBase<Scalar> > >& x,
191 const Teuchos::Array<Scalar>& t,
192 const Thyra::VectorBase<Scalar>& p,
193 const int param_index)
const;
195 Thyra::LinearOpWithSolveBase<Scalar>& jacobian_solver,
196 const Teuchos::Array< Teuchos::RCP<
const Thyra::VectorBase<Scalar> > >& x,
197 const Teuchos::Array<Scalar>& t,
198 const Thyra::VectorBase<Scalar>& p,
199 const int param_index)
const;
206 const Thyra::ModelEvaluatorBase::OutArgs<Scalar>& outArgs,
207 const Teuchos::Array< Teuchos::RCP<
const Thyra::VectorBase<Scalar> > >& x,
208 const Teuchos::Array<Scalar>& t,
209 const Thyra::VectorBase<Scalar>& p,
210 const int param_index,
211 const int deriv_index = 0)
const;
216 #ifndef TEMPUS_HIDE_DEPRECATED_CODE
231 template <
typename Scalar>
239 Scalar s, Teuchos::RCP<
const Thyra::VectorBase<Scalar> > xOld)
247 Teuchos::RCP<
const Thyra::VectorBase<Scalar> > x,
248 Teuchos::RCP< Thyra::VectorBase<Scalar> > xDot,
249 Teuchos::RCP< Thyra::VectorBase<Scalar> > xDotDot = Teuchos::null)
251 xDotDot = Teuchos::null;
253 Thyra::V_StVpStV(xDot.ptr(),
s_,*x,-
s_,*
xOld_);
257 Teuchos::RCP<
const Thyra::VectorBase<Scalar> > xOld)
262 Teuchos::RCP<const Thyra::VectorBase<Scalar> >
xOld_;
269 #endif // Tempus_StepperBackwardEuler_decl_hpp
Teuchos::RCP< const Thyra::VectorBase< Scalar > > xOld_
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const
Teuchos::RCP< StepperBackwardEulerAppAction< Scalar > > stepperBEAppAction_
void computeStepResidDerivImpl(const Thyra::ModelEvaluatorBase::OutArgs< Scalar > &outArgs, const Teuchos::Array< Teuchos::RCP< const Thyra::VectorBase< Scalar > > > &x, const Teuchos::Array< Scalar > &t, const Thyra::VectorBase< Scalar > &p, const int param_index, const int deriv_index=0) const
Implementation of computeStep*() methods.
StepperBackwardEuler()
Default constructor.
virtual void computeStepResidual(Thyra::VectorBase< Scalar > &residual, const Teuchos::Array< Teuchos::RCP< const Thyra::VectorBase< Scalar > > > &x, const Teuchos::Array< Scalar > &t, const Thyra::VectorBase< Scalar > &p, const int param_index) const
Compute time step residual.
virtual ~StepperBackwardEulerTimeDerivative()
Destructor.
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 Scalar getOrderMax() const
virtual void takeStep(const Teuchos::RCP< SolutionHistory< Scalar > > &solutionHistory)
Take the specified timestep, dt, and return true if successful.
virtual OrderODE getOrderODE() const
virtual void computePredictor(const Teuchos::RCP< SolutionHistory< Scalar > > &solutionHistory)
Compute predictor given the supplied stepper.
virtual int stencilLength() const
Return the number of solution vectors in the time step stencil.
virtual Scalar getBeta(const Scalar) const
Return beta = d(x)/dx.
virtual Teuchos::RCP< Tempus::StepperState< Scalar > > getDefaultStepperState()
Get a default (initial) StepperState.
Application Action for StepperBackwardEuler.
virtual bool isMultiStepMethod() const
virtual void setObserver(Teuchos::RCP< StepperObserver< Scalar > > obs=Teuchos::null)
Set Observer.
virtual bool isOneStepMethod() const
Thyra Base interface for time steppers.
virtual void computeStepSolver(Thyra::LinearOpWithSolveBase< Scalar > &jacobian_solver, const Teuchos::Array< Teuchos::RCP< const Thyra::VectorBase< Scalar > > > &x, const Teuchos::Array< Scalar > &t, const Thyra::VectorBase< Scalar > &p, const int param_index) const
Compute time step Jacobian solver.
Thyra Base interface for implicit time steppers.
virtual void computeStepJacobian(Thyra::LinearOpBase< Scalar > &jacobian, const Teuchos::Array< Teuchos::RCP< const Thyra::VectorBase< Scalar > > > &x, const Teuchos::Array< Scalar > &t, const Thyra::VectorBase< Scalar > &p, const int param_index, const int deriv_index) const
Compute time step Jacobian.
virtual void computeStepParamDeriv(Thyra::LinearOpBase< Scalar > &deriv, const Teuchos::Array< Teuchos::RCP< const Thyra::VectorBase< Scalar > > > &x, const Teuchos::Array< Scalar > &t, const Thyra::VectorBase< Scalar > &p, const int param_index) const
Compute time step derivative w.r.t. model parameters.
void setPredictor(std::string predictorType="None")
Set the predictor.
StepperObserver class for Stepper class.
virtual Scalar getAlpha(const Scalar dt) const
Return alpha = d(xDot)/dx.
Backward Euler time stepper.
SolutionHistory is basically a container of SolutionStates. SolutionHistory maintains a collection of...
virtual Teuchos::RCP< StepperObserver< Scalar > > getObserver() const
Get Observer.
Teuchos::RCP< Stepper< Scalar > > predictorStepper_
virtual void setAppAction(Teuchos::RCP< StepperBackwardEulerAppAction< Scalar > > appAction)
Stepper integrates first-order ODEs.
StepperBackwardEulerTimeDerivative(Scalar s, Teuchos::RCP< const Thyra::VectorBase< Scalar > > xOld)
Constructor.
virtual bool isValidSetup(Teuchos::FancyOStream &out) const
virtual Teuchos::RCP< StepperBackwardEulerAppAction< Scalar > > getAppAction() const
This interface defines the time derivative connection between an implicit Stepper and WrapperModelEva...
virtual void setInitialConditions(const Teuchos::RCP< SolutionHistory< Scalar > > &solutionHistory)
Set the initial conditions and make them consistent.
virtual void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) const
Teuchos::RCP< StepperBackwardEulerObserver< Scalar > > stepperBEObserver_
virtual void initialize(Scalar s, Teuchos::RCP< const Thyra::VectorBase< Scalar > > xOld)
Stepper interface to support full-space optimization.
virtual Scalar getOrderMin() const
Time-derivative interface for Backward Euler.
virtual bool isExplicit() const
virtual Scalar getOrder() const
virtual bool isExplicitImplicit() const
virtual bool isImplicit() const