29 #ifndef Rythmos_IMPLICITBDF_STEPPER_DECL_H
30 #define Rythmos_IMPLICITBDF_STEPPER_DECL_H
32 #include "Rythmos_StepperBase.hpp"
33 #include "Rythmos_SingleResidualModelEvaluator.hpp"
34 #include "Rythmos_SolverAcceptingStepperBase.hpp"
35 #include "Rythmos_StepControlStrategyAcceptingStepperBase.hpp"
37 #include "Thyra_VectorBase.hpp"
38 #include "Thyra_ModelEvaluator.hpp"
39 #include "Thyra_ModelEvaluatorHelpers.hpp"
40 #include "Thyra_NonlinearSolverBase.hpp"
41 #include "Thyra_SolveSupportTypes.hpp"
43 #include "Teuchos_RCP.hpp"
44 #include "Teuchos_VerboseObjectParameterListHelpers.hpp"
45 #include "Teuchos_as.hpp"
51 template<
class Scalar>
59 typedef typename Teuchos::ScalarTraits<Scalar>::magnitudeType
ScalarMag;
69 const RCP<Thyra::ModelEvaluator<Scalar> >& model
70 ,
const RCP<Thyra::NonlinearSolverBase<Scalar> > &solver
75 const RCP<Thyra::ModelEvaluator<Scalar> >& model
76 ,
const RCP<Thyra::NonlinearSolverBase<Scalar> >& solver
77 ,
const RCP<Teuchos::ParameterList>& parameterList
81 RCP<const Thyra::VectorBase<Scalar> >
get_solution()
const;
84 RCP<const Thyra::VectorBase<Scalar> >
get_residual()
const;
87 const Thyra::VectorBase<Scalar>&
getxHistory(
int index)
const;
103 RCP<StepControlStrategyBase<Scalar> >
107 RCP<const StepControlStrategyBase<Scalar> >
117 const RCP<Thyra::NonlinearSolverBase<Scalar> > &solver
121 RCP<Thyra::NonlinearSolverBase<Scalar> >
125 RCP<const Thyra::NonlinearSolverBase<Scalar> >
149 void setModel(
const RCP<
const Thyra::ModelEvaluator<Scalar> >& model);
155 RCP<const Thyra::ModelEvaluator<Scalar> >
getModel()
const;
162 const Thyra::ModelEvaluatorBase::InArgs<Scalar> &initialCondition
169 Scalar
takeStep(Scalar dt, StepSizeType flag);
180 RCP<const Thyra::VectorSpaceBase<Scalar> >
185 const Array<Scalar>& time_vec
186 ,
const Array<RCP<
const Thyra::VectorBase<Scalar> > >& x_vec
187 ,
const Array<RCP<
const Thyra::VectorBase<Scalar> > >& xdot_vec
195 const Array<Scalar>& time_vec
196 ,Array<RCP<
const Thyra::VectorBase<Scalar> > >* x_vec
197 ,Array<RCP<
const Thyra::VectorBase<Scalar> > >* xdot_vec
198 ,Array<ScalarMag>* accuracy_vec
202 void getNodes(Array<Scalar>* time_vec)
const;
237 Teuchos::FancyOStream &out,
238 const Teuchos::EVerbosityLevel verbLevel
252 RCP<const Thyra::ModelEvaluator<Scalar> > model_;
253 RCP<Thyra::NonlinearSolverBase<Scalar> > solver_;
256 RCP<Thyra::VectorBase<Scalar> > xn0_;
257 RCP<Thyra::VectorBase<Scalar> > xpn0_;
258 RCP<Thyra::VectorBase<Scalar> > x_dot_base_;
259 Array<RCP<Thyra::VectorBase<Scalar> > > xHistory_;
260 RCP<Thyra::VectorBase<Scalar> > ee_;
261 RCP<Thyra::VectorBase<Scalar> > residual_;
263 RCP<StepControlStrategyBase<Scalar> > stepControl_;
267 Thyra::ModelEvaluatorBase::InArgs<Scalar> basePoint_;
273 Array<Scalar> alpha_;
276 EStepLETStatus stepLETStatus_;
277 Array<Scalar> gamma_;
287 bool haveInitialCondition_;
290 Thyra::SolveStatus<Scalar> nonlinearSolveStatus_;
291 int newtonConvergenceStatus_;
293 RCP<Teuchos::ParameterList> parameterList_;
299 void defaultInitializeAll_();
300 void getInitialCondition_();
301 void obtainPredictor_();
302 void interpolateSolution_(
303 const Scalar& timepoint,
304 Thyra::VectorBase<Scalar>* x_ptr_,
305 Thyra::VectorBase<Scalar>* xdot_ptr_,
308 void updateHistory_();
309 void restoreHistory_();
310 void updateCoeffs_();
312 void completeStep_();
316 template<
class Scalar>
317 RCP<ImplicitBDFStepper<Scalar> > implicitBDFStepper();
319 template<
class Scalar>
320 RCP<ImplicitBDFStepper<Scalar> > implicitBDFStepper(
321 const RCP<Thyra::ModelEvaluator<Scalar> >& model,
322 const RCP<Thyra::NonlinearSolverBase<Scalar> >& solver
325 template<
class Scalar>
326 RCP<ImplicitBDFStepper<Scalar> > implicitBDFStepper(
327 const RCP<Thyra::ModelEvaluator<Scalar> >& model,
328 const RCP<Thyra::NonlinearSolverBase<Scalar> >& solver,
329 const RCP<Teuchos::ParameterList>& parameterList
334 #endif // Rythmos_IMPLICITBDF_STEPPER_DECL_H
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) const
Mix-in interface for stepper objects that accept a step control strategy object to be used for evalua...
bool isImplicit() const
Overridden from StepperBase.
Base class for defining stepper functionality.
void getPoints(const Array< Scalar > &time_vec, Array< RCP< const Thyra::VectorBase< Scalar > > > *x_vec, Array< RCP< const Thyra::VectorBase< Scalar > > > *xdot_vec, Array< ScalarMag > *accuracy_vec) const
RCP< Teuchos::ParameterList > getNonconstParameterList()
RCP< const Thyra::ModelEvaluator< Scalar > > getModel() const
void setInitialCondition(const Thyra::ModelEvaluatorBase::InArgs< Scalar > &initialCondition)
void setNonconstModel(const RCP< Thyra::ModelEvaluator< Scalar > > &model)
const Thyra::SolveStatus< Scalar > & getNonlinearSolveStatus() const
Returns the Thyra::SolveStatus object from the last nonlinear solve.
RCP< StepperBase< Scalar > > cloneStepperAlgorithm() const
Creates copies of all internal data (including the parameter list) except the model which is assumed ...
RCP< const StepControlStrategyBase< Scalar > > getStepControlStrategy() const
ImplicitBDFStepper()
Constructors, intializers, Misc.
RCP< const Thyra::VectorBase< Scalar > > get_solution() const
std::string description() const
TimeRange< Scalar > getTimeRange() const
The member functions in the StepControlStrategyBase move you between these states in the following fa...
RCP< Thyra::NonlinearSolverBase< Scalar > > getNonconstSolver()
Thyra::ModelEvaluatorBase::InArgs< Scalar > getInitialCondition() const
void setModel(const RCP< const Thyra::ModelEvaluator< Scalar > > &model)
RCP< const Thyra::NonlinearSolverBase< Scalar > > getSolver() const
Decorator subclass for a steady-state version of a DAE for single-residual time stepper methods...
void getNodes(Array< Scalar > *time_vec) const
Scalar takeStep(Scalar dt, StepSizeType flag)
bool supportsCloning() const
Returns true.
void setParameterList(RCP< Teuchos::ParameterList > const ¶mList)
void setStepControlData(const StepperBase< Scalar > &stepper)
RCP< StepControlStrategyBase< Scalar > > getNonconstStepControlStrategy()
void removeNodes(Array< Scalar > &time_vec)
RCP< Thyra::ModelEvaluator< Scalar > > getNonconstModel()
Mix-in interface all implicit stepper objects that accept a nonlinear solver to be used to compute th...
RCP< const Teuchos::ParameterList > getValidParameters() const
void addPoints(const Array< Scalar > &time_vec, const Array< RCP< const Thyra::VectorBase< Scalar > > > &x_vec, const Array< RCP< const Thyra::VectorBase< Scalar > > > &xdot_vec)
RCP< const Thyra::VectorSpaceBase< Scalar > > get_x_space() const
const StepStatus< Scalar > getStepStatus() const
void setSolver(const RCP< Thyra::NonlinearSolverBase< Scalar > > &solver)
RCP< Teuchos::ParameterList > unsetParameterList()
RCP< const Thyra::VectorBase< Scalar > > get_residual() const
void setStepControlStrategy(const RCP< StepControlStrategyBase< Scalar > > &stepControlStrategy)
const Thyra::VectorBase< Scalar > & getxHistory(int index) const
Teuchos::ScalarTraits< Scalar >::magnitudeType ScalarMag