9 #ifndef Tempus_StepperBackwardEuler_decl_hpp
10 #define Tempus_StepperBackwardEuler_decl_hpp
12 #include "Tempus_StepperImplicit.hpp"
35 template<
class Scalar>
51 const Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> >& appModel,
53 const Teuchos::RCP<Thyra::NonlinearSolverBase<Scalar> >& solver,
55 std::string ICConsistency,
56 bool ICConsistencyCheck,
57 bool zeroInitialGuess);
64 virtual Teuchos::RCP<StepperObserver<Scalar> >
getObserver()
const
99 virtual Scalar
getAlpha(
const Scalar dt)
const {
return Scalar(1.0)/dt; }
101 virtual Scalar
getBeta (
const Scalar )
const {
return Scalar(1.0); }
111 virtual void describe(Teuchos::FancyOStream & out,
112 const Teuchos::EVerbosityLevel verbLevel)
const;
119 Thyra::VectorBase<Scalar>& residual,
120 const Teuchos::Array< Teuchos::RCP<
const Thyra::VectorBase<Scalar> > >& x,
121 const Teuchos::Array<Scalar>& t,
122 const Thyra::VectorBase<Scalar>& p,
123 const int param_index)
const;
125 Thyra::LinearOpBase<Scalar>& jacobian,
126 const Teuchos::Array< Teuchos::RCP<
const Thyra::VectorBase<Scalar> > >& x,
127 const Teuchos::Array<Scalar>& t,
128 const Thyra::VectorBase<Scalar>& p,
129 const int param_index,
130 const int deriv_index)
const;
132 Thyra::LinearOpBase<Scalar>& deriv,
133 const Teuchos::Array< Teuchos::RCP<
const Thyra::VectorBase<Scalar> > >& x,
134 const Teuchos::Array<Scalar>& t,
135 const Thyra::VectorBase<Scalar>& p,
136 const int param_index)
const;
138 Thyra::LinearOpWithSolveBase<Scalar>& jacobian_solver,
139 const Teuchos::Array< Teuchos::RCP<
const Thyra::VectorBase<Scalar> > >& x,
140 const Teuchos::Array<Scalar>& t,
141 const Thyra::VectorBase<Scalar>& p,
142 const int param_index)
const;
149 const Thyra::ModelEvaluatorBase::OutArgs<Scalar>& outArgs,
150 const Teuchos::Array< Teuchos::RCP<
const Thyra::VectorBase<Scalar> > >& x,
151 const Teuchos::Array<Scalar>& t,
152 const Thyra::VectorBase<Scalar>& p,
153 const int param_index,
154 const int deriv_index = 0)
const;
171 template <
typename Scalar>
179 Scalar s, Teuchos::RCP<
const Thyra::VectorBase<Scalar> > xOld)
187 Teuchos::RCP<
const Thyra::VectorBase<Scalar> > x,
188 Teuchos::RCP< Thyra::VectorBase<Scalar> > xDot,
189 Teuchos::RCP< Thyra::VectorBase<Scalar> > xDotDot = Teuchos::null)
191 xDotDot = Teuchos::null;
193 Thyra::V_StVpStV(xDot.ptr(),
s_,*x,-
s_,*
xOld_);
197 Teuchos::RCP<
const Thyra::VectorBase<Scalar> > xOld)
202 Teuchos::RCP<const Thyra::VectorBase<Scalar> >
xOld_;
209 #endif // Tempus_StepperBackwardEuler_decl_hpp
Teuchos::RCP< const Thyra::VectorBase< Scalar > > xOld_
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const
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.
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.
Teuchos::RCP< SolutionHistory< Scalar > > solutionHistory(Teuchos::RCP< Teuchos::ParameterList > pList=Teuchos::null)
Nonmember constructor.
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_
Stepper integrates first-order ODEs.
StepperBackwardEulerTimeDerivative(Scalar s, Teuchos::RCP< const Thyra::VectorBase< Scalar > > xOld)
Constructor.
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 void initialize()
Initialize during construction and after changing input parameters.
virtual Scalar getOrder() const
virtual bool isExplicitImplicit() const
virtual bool isImplicit() const