29 #ifndef Rythmos_FORWARDEULER_STEPPER_DECL_H
30 #define Rythmos_FORWARDEULER_STEPPER_DECL_H
32 #include "Rythmos_StepperBase.hpp"
33 #include "Rythmos_Types.hpp"
34 #include "Rythmos_MomentoBase.hpp"
35 #include "Rythmos_StateSerializerStrategy.hpp"
36 #include "Thyra_ModelEvaluator.hpp"
37 #include "Teuchos_ParameterListAcceptorDefaultBase.hpp"
38 #include "Teuchos_ConstNonconstObjectContainer.hpp"
246 template<
class Scalar>
249 virtual public Teuchos::ParameterListAcceptorDefaultBase
257 std::ostream& oStream
262 std::istream& iStream
265 RCP<MomentoBase<Scalar> > clone()
const;
267 void set_solution_vector(
const RCP<
const VectorBase<Scalar> >& solution_vector );
268 RCP<VectorBase<Scalar> > get_solution_vector()
const;
270 void set_residual_vector(
const RCP<
const VectorBase<Scalar> >& residual_vector );
271 RCP<VectorBase<Scalar> > get_residual_vector()
const;
273 void set_solution_vector_old(
const RCP<
const VectorBase<Scalar> >& solution_vector_old );
274 RCP<VectorBase<Scalar> > get_solution_vector_old()
const;
276 void set_t(
const Scalar & t);
277 Scalar get_t()
const;
279 void set_t_old(
const Scalar & t_old);
280 Scalar get_t_old()
const;
282 void set_dt(
const Scalar & dt);
283 Scalar get_dt()
const;
285 void set_numSteps(
const int & numSteps);
286 int get_numSteps()
const;
288 void set_isInitialized(
const bool & isInitialized);
289 bool get_isInitialized()
const;
291 void set_haveInitialCondition(
const bool & haveInitialCondition);
292 bool get_haveInitialCondition()
const;
294 void set_parameterList(
const RCP<const ParameterList>& pl);
295 RCP<ParameterList> get_parameterList()
const;
297 void setParameterList(
const RCP<ParameterList>& paramList);
298 RCP<const ParameterList> getValidParameters()
const;
300 void set_model(
const RCP<
const Thyra::ModelEvaluator<Scalar> >& model);
301 RCP<const Thyra::ModelEvaluator<Scalar> > get_model()
const;
303 void set_basePoint(
const RCP<
const Thyra::ModelEvaluatorBase::InArgs<Scalar> >& basePoint);
304 RCP<const Thyra::ModelEvaluatorBase::InArgs<Scalar> > get_basePoint()
const;
307 RCP<Thyra::VectorBase<Scalar> > solution_vector_;
308 RCP<Thyra::VectorBase<Scalar> > residual_vector_;
309 RCP<Thyra::VectorBase<Scalar> > solution_vector_old_;
315 bool haveInitialCondition_;
316 RCP<ParameterList> parameterList_;
319 RCP<const Thyra::ModelEvaluator<Scalar> > model_;
321 RCP<const Thyra::ModelEvaluatorBase::InArgs<Scalar> > basePoint_;
326 template<
class Scalar>
331 typedef Teuchos::ScalarTraits<Scalar> ST;
332 typedef typename Teuchos::ScalarTraits<Scalar>::magnitudeType ScalarMag;
344 void setModel(
const RCP<
const Thyra::ModelEvaluator<Scalar> >& model);
350 RCP<const Thyra::ModelEvaluator<Scalar> >
getModel()
const;
357 const Thyra::ModelEvaluatorBase::InArgs<Scalar> &initialCondition
364 RCP<const Thyra::VectorSpaceBase<Scalar> >
get_x_space()
const;
370 Scalar
takeStep(Scalar dt, StepSizeType flag);
380 Teuchos::FancyOStream &out,
381 const Teuchos::EVerbosityLevel verbLevel
387 const Array<Scalar>& time_vec
388 ,
const Array<RCP<
const Thyra::VectorBase<Scalar> > >& x_vec
389 ,
const Array<RCP<
const Thyra::VectorBase<Scalar> > >& xdot_vec
394 const Array<Scalar>& time_vec
395 ,Array<RCP<
const Thyra::VectorBase<Scalar> > >* x_vec
396 ,Array<RCP<
const Thyra::VectorBase<Scalar> > >* xdot_vec
397 ,Array<ScalarMag>* accuracy_vec
410 void getNodes(Array<Scalar>* time_vec)
const;
434 RCP<const MomentoBase<Scalar> >
getMomento()
const;
443 RCP<const Thyra::ModelEvaluator<Scalar> > model_;
444 RCP<Thyra::VectorBase<Scalar> > solution_vector_;
445 RCP<Thyra::VectorBase<Scalar> > residual_vector_;
449 RCP<Thyra::VectorBase<Scalar> > solution_vector_old_;
450 Thyra::ModelEvaluatorBase::InArgs<Scalar> basePoint_;
452 bool haveInitialCondition_;
454 RCP<Teuchos::ParameterList> parameterList_;
458 void defaultInitializAll_();
460 void checkConsistentState_();
465 template<
class Scalar>
466 RCP<ForwardEulerStepper<Scalar> > forwardEulerStepper();
469 template<
class Scalar>
470 RCP<ForwardEulerStepper<Scalar> > forwardEulerStepper(
const RCP<Thyra::ModelEvaluator<Scalar> >& model);
474 #endif //Rythmos_FORWARDEULER_STEPPER_DECL_H
RCP< const MomentoBase< Scalar > > getMomento() const
Get momento object for use in restarts.
RCP< Teuchos::ParameterList > unsetParameterList()
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) const
void removeNodes(Array< Scalar > &time_vec)
Remove interpolation nodes.
RCP< Thyra::ModelEvaluator< Scalar > > getNonconstModel()
RCP< Teuchos::ParameterList > getNonconstParameterList()
Base class for defining stepper functionality.
Concrete momento class for the ForwardEulerStepper.
void setParameterList(RCP< Teuchos::ParameterList > const ¶mList)
Redefined from Teuchos::ParameterListAcceptor.
bool supportsCloning() const
void setModel(const RCP< const Thyra::ModelEvaluator< Scalar > > &model)
Base class for serializing Rythmos state data.
RCP< const Thyra::ModelEvaluator< Scalar > > getModel() const
RCP< const Teuchos::ParameterList > getValidParameters() const
void setInitialCondition(const Thyra::ModelEvaluatorBase::InArgs< Scalar > &initialCondition)
Thyra::ModelEvaluatorBase::InArgs< Scalar > getInitialCondition() const
int getOrder() const
Get order of interpolation.
Base class for an interpolation buffer.
const StepStatus< Scalar > getStepStatus() const
TimeRange< Scalar > getTimeRange() const
void setRange(const TimeRange< Scalar > &range, const InterpolationBufferBase< Scalar > &IB)
Fill data in from another interpolation buffer.
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)
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
Get values from buffer.
void setNonconstModel(const RCP< Thyra::ModelEvaluator< Scalar > > &model)
void getNodes(Array< Scalar > *time_vec) const
Get interpolation nodes.
RCP< StepperBase< Scalar > > cloneStepperAlgorithm() const
RCP< const Thyra::VectorSpaceBase< Scalar > > get_x_space() const
void setMomento(const Ptr< const MomentoBase< Scalar > > &momentoPtr)
Set momento object for use in restarts.
std::string description() const
Base class for a momento object.
Scalar takeStep(Scalar dt, StepSizeType flag)