29 #ifndef Rythmos_IMPLICIT_RK_STEPPER_DECL_H
30 #define Rythmos_IMPLICIT_RK_STEPPER_DECL_H
32 #include "Rythmos_Types.hpp"
33 #include "Rythmos_StepperBase.hpp"
34 #include "Rythmos_DataStore.hpp"
35 #include "Rythmos_SolverAcceptingStepperBase.hpp"
36 #include "Rythmos_RKButcherTableauAcceptingStepperBase.hpp"
37 #include "Rythmos_RKButcherTableauBase.hpp"
38 #include "Rythmos_StepControlStrategyAcceptingStepperBase.hpp"
39 #include "Rythmos_StepControlStrategyBase.hpp"
41 #include "Thyra_ModelEvaluator.hpp"
42 #include "Thyra_ProductVectorBase.hpp"
43 #include "Thyra_NonlinearSolverBase.hpp"
49 template<
class Scalar>
58 typedef typename ScalarTraits<Scalar>::magnitudeType
ScalarMag;
66 void set_W_factory(
const RCP<Thyra::LinearOpWithSolveFactoryBase<Scalar> > &irk_W_factory );
69 RCP<const Thyra::LinearOpWithSolveFactoryBase<Scalar> >
get_W_factory()
const;
75 void setRKButcherTableau(
const RCP<
const RKButcherTableauBase<Scalar> > &rkButcherTableau );
95 const RCP<Thyra::NonlinearSolverBase<Scalar> > &solver
99 RCP<Thyra::NonlinearSolverBase<Scalar> >
103 RCP<const Thyra::NonlinearSolverBase<Scalar> >
121 void setModel(
const RCP<
const Thyra::ModelEvaluator<Scalar> >& model);
127 RCP<const Thyra::ModelEvaluator<Scalar> >
getModel()
const;
134 const Thyra::ModelEvaluatorBase::InArgs<Scalar> &initialCondition
142 Scalar
takeStep(Scalar dt, StepSizeType flag);
156 RCP<StepControlStrategyBase<Scalar> >
160 RCP<const StepControlStrategyBase<Scalar> >
172 RCP<const Thyra::VectorSpaceBase<Scalar> >
177 const Array<Scalar>& time_vec,
178 const Array<RCP<
const Thyra::VectorBase<Scalar> > >& x_vec,
179 const Array<RCP<
const Thyra::VectorBase<Scalar> > >& xdot_vec
187 const Array<Scalar>& time_vec,
188 Array<RCP<
const Thyra::VectorBase<Scalar> > >* x_vec,
189 Array<RCP<
const Thyra::VectorBase<Scalar> > >* xdot_vec,
190 Array<ScalarMag>* accuracy_vec
194 void getNodes(Array<Scalar>* time_vec)
const;
227 const Teuchos::EVerbosityLevel verbLevel
241 RCP<const Thyra::ModelEvaluator<Scalar> > model_;
242 RCP<Thyra::NonlinearSolverBase<Scalar> > solver_;
243 RCP<Thyra::LinearOpWithSolveFactoryBase<Scalar> > irk_W_factory_;
244 RCP<ParameterList> paramList_;
246 Thyra::ModelEvaluatorBase::InArgs<Scalar> basePoint_;
247 RCP<Thyra::VectorBase<Scalar> > x_;
248 RCP<Thyra::VectorBase<Scalar> > x_old_;
249 RCP<Thyra::VectorBase<Scalar> > x_dot_;
250 RCP<Thyra::VectorBase<Scalar> > oldSolution_;
251 EStepLETStatus stepLETStatus_;
252 RCP<Thyra::VectorBase<Scalar> > xhat_;
253 RCP<Thyra::VectorBase<Scalar> > ee_;
257 RCP<Thyra::ModelEvaluator<Scalar> > irkModel_;
258 RCP<const RKButcherTableauBase<Scalar> > irkButcherTableau_;
261 bool isVariableStep_ =
false;
266 bool haveInitialCondition_;
269 Thyra::SolveStatus<Scalar> nonlinearSolveStatus_;
270 int rkNewtonConvergenceStatus_;
271 RCP<Rythmos::StepControlStrategyBase<Scalar> > stepControl_;
274 RCP<Thyra::ProductVectorBase<Scalar> > x_stage_bar_;
279 void defaultInitializeAll_();
282 Scalar takeVariableStep_(Scalar dt, StepSizeType flag);
284 Scalar takeFixedStep_(Scalar dt, StepSizeType flag);
295 template<
class Scalar>
296 RCP<ImplicitRKStepper<Scalar> >
299 template<
class Scalar>
300 RCP<ImplicitRKStepper<Scalar> >
302 const RCP<
const Thyra::ModelEvaluator<Scalar> >& model,
303 const RCP<Thyra::NonlinearSolverBase<Scalar> >& solver,
304 const RCP<Thyra::LinearOpWithSolveFactoryBase<Scalar> >& irk_W_factory,
305 const RCP<
const RKButcherTableauBase<Scalar> >& irkbt
311 #endif //Rythmos_IMPLICIT_RK_STEPPER_DECL_H
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)
Mix-in interface for stepper objects that accept a step control strategy object to be used for evalua...
bool isImplicit() const
Returns true.
RCP< ParameterList > getNonconstParameterList()
RCP< const Thyra::VectorSpaceBase< Scalar > > get_x_space() const
RCP< const RKButcherTableauBase< Scalar > > getRKButcherTableau() const
void describe(FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) const
Scalar takeStep(Scalar dt, StepSizeType flag)
RCP< const ParameterList > getValidParameters() const
void setRKButcherTableau(const RCP< const RKButcherTableauBase< Scalar > > &rkButcherTableau)
RCP< StepperBase< Scalar > > cloneStepperAlgorithm() const
void setSolver(const RCP< Thyra::NonlinearSolverBase< Scalar > > &solver)
RCP< StepControlStrategyBase< Scalar > > getNonconstStepControlStrategy()
RCP< const StepControlStrategyBase< Scalar > > getStepControlStrategy() const
const StepStatus< Scalar > getStepStatus() const
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
The member functions in the StepControlStrategyBase move you between these states in the following fa...
RCP< const Thyra::LinearOpWithSolveFactoryBase< Scalar > > get_W_factory() const
ScalarTraits< Scalar >::magnitudeType ScalarMag
void removeNodes(Array< Scalar > &time_vec)
void setInitialCondition(const Thyra::ModelEvaluatorBase::InArgs< Scalar > &initialCondition)
void setDirk(bool isDirk)
void setModel(const RCP< const Thyra::ModelEvaluator< Scalar > > &model)
void setStepControlStrategy(const RCP< StepControlStrategyBase< Scalar > > &stepControlStrategy)
void setNonconstModel(const RCP< Thyra::ModelEvaluator< Scalar > > &model)
void getNodes(Array< Scalar > *time_vec) const
Mix-in interface stepper objects that accept an RK Butcher Tableau.
bool supportsCloning() const
Returns true.
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 Thyra::ModelEvaluator< Scalar > > getModel() const
RCP< ParameterList > unsetParameterList()
TimeRange< Scalar > getTimeRange() const
Thyra::ModelEvaluatorBase::InArgs< Scalar > getInitialCondition() const
RCP< const Thyra::NonlinearSolverBase< Scalar > > getSolver() const
RCP< Thyra::NonlinearSolverBase< Scalar > > getNonconstSolver()
void setParameterList(RCP< ParameterList > const ¶mList)