29 #ifndef Rythmos_THETA_STEPPER_DECL_H
30 #define Rythmos_THETA_STEPPER_DECL_H
32 #define HAVE_RYTHMOS_EXPERIMENTAL
34 #include "Rythmos_ConfigDefs.h"
35 #ifdef HAVE_RYTHMOS_EXPERIMENTAL
37 #include "Rythmos_StepperBase.hpp"
38 #include "Rythmos_DataStore.hpp"
39 #include "Rythmos_LinearInterpolator.hpp"
40 #include "Rythmos_InterpolatorAcceptingObjectBase.hpp"
41 #include "Rythmos_InterpolatorBaseHelpers.hpp"
42 #include "Rythmos_SingleResidualModelEvaluator.hpp"
43 #include "Rythmos_SolverAcceptingStepperBase.hpp"
44 #include "Rythmos_StepperHelpers.hpp"
46 #include "Thyra_VectorBase.hpp"
47 #include "Thyra_ModelEvaluator.hpp"
48 #include "Thyra_ModelEvaluatorHelpers.hpp"
49 #include "Thyra_AssertOp.hpp"
50 #include "Thyra_NonlinearSolverBase.hpp"
51 #include "Thyra_TestingTools.hpp"
53 #include "Teuchos_VerboseObjectParameterListHelpers.hpp"
54 #include "Teuchos_as.hpp"
58 const std::string ThetaStepperType_name =
"Theta Stepper Type";
59 const std::string ThetaStepperType_default =
"Implicit Euler";
61 const std::string PredictorOrder_name =
"Predictor Order";
62 const int PredictorOrder_default = 2;
71 INVALID_THETA_STEPPER_TYPE
78 template<
class Scalar>
86 typedef typename Teuchos::ScalarTraits<Scalar>::magnitudeType
ScalarMag;
103 RCP<InterpolatorBase<Scalar> >
107 RCP<const InterpolatorBase<Scalar> >
121 const RCP<Thyra::NonlinearSolverBase<Scalar> > &solver
125 RCP<Thyra::NonlinearSolverBase<Scalar> >
129 RCP<const Thyra::NonlinearSolverBase<Scalar> >
150 void setModel(
const RCP<
const Thyra::ModelEvaluator<Scalar> >& model);
156 RCP<const Thyra::ModelEvaluator<Scalar> >
getModel()
const;
163 const Thyra::ModelEvaluatorBase::InArgs<Scalar> &initialCondition
170 Scalar
takeStep(Scalar dt, StepSizeType flag);
181 RCP<const Thyra::VectorSpaceBase<Scalar> >
186 const Array<Scalar>& time_vec,
187 const Array<RCP<
const Thyra::VectorBase<Scalar> > >& x_vec,
188 const Array<RCP<
const Thyra::VectorBase<Scalar> > >& xdot_vec
196 const Array<Scalar>& time_vec,
197 Array<RCP<
const Thyra::VectorBase<Scalar> > >* x_vec,
198 Array<RCP<
const Thyra::VectorBase<Scalar> > >* xdot_vec,
199 Array<ScalarMag>* accuracy_vec
203 void getNodes(Array<Scalar>* time_vec)
const;
235 Teuchos::FancyOStream &out,
236 const Teuchos::EVerbosityLevel verbLevel
247 bool haveInitialCondition_;
248 RCP<const Thyra::ModelEvaluator<Scalar> > model_;
249 RCP<Thyra::NonlinearSolverBase<Scalar> > solver_;
251 Thyra::ModelEvaluatorBase::InArgs<Scalar> basePoint_;
253 RCP<Thyra::VectorBase<Scalar> > x_;
254 RCP<Thyra::VectorBase<Scalar> > x_old_;
255 RCP<Thyra::VectorBase<Scalar> > x_pre_;
257 RCP<Thyra::VectorBase<Scalar> > x_dot_;
258 RCP<Thyra::VectorBase<Scalar> > x_dot_old_;
259 RCP<Thyra::VectorBase<Scalar> > x_dot_really_old_;
260 RCP<Thyra::VectorBase<Scalar> > x_dot_base_;
269 ThetaStepperType thetaStepperType_;
271 int predictor_corrector_begin_after_step_;
272 int default_predictor_order_;
274 RCP<Rythmos::SingleResidualModelEvaluator<Scalar> > neModel_;
276 RCP<Teuchos::ParameterList> parameterList_;
278 RCP<InterpolatorBase<Scalar> > interpolator_;
284 void defaultInitializeAll_();
286 void obtainPredictor_();
294 template<
class Scalar>
295 RCP<ThetaStepper<Scalar> >
297 const RCP<Thyra::ModelEvaluator<Scalar> >& model,
298 const RCP<Thyra::NonlinearSolverBase<Scalar> >& solver,
299 RCP<Teuchos::ParameterList>& parameterList
304 #endif // HAVE_RYTHMOS_EXPERIMENTAL
306 #endif //Rythmos_THETA_STEPPER_DECL_H
bool supportsCloning() const
Returns true.
RCP< const Teuchos::ParameterList > getValidParameters() const
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) const
RCP< InterpolatorBase< Scalar > > getNonconstInterpolator()
Base strategy class for interpolation functionality.
void removeNodes(Array< Scalar > &time_vec)
RCP< Teuchos::ParameterList > unsetParameterList()
Stepper class for theta integration scheme common in SNL thermal/fluids codes.
void setInterpolator(const RCP< InterpolatorBase< Scalar > > &interpolator)
Redefined from InterpolatorAcceptingObjectBase.
RCP< Teuchos::ParameterList > getNonconstParameterList()
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< const Thyra::NonlinearSolverBase< Scalar > > getSolver() const
Mix-in interface for objects that accept an interpolator object.
RCP< const InterpolatorBase< Scalar > > getInterpolator() 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)
void setModel(const RCP< const Thyra::ModelEvaluator< Scalar > > &model)
RCP< const Thyra::VectorSpaceBase< Scalar > > get_x_space() const
Teuchos::ScalarTraits< Scalar >::magnitudeType ScalarMag
void setParameterList(RCP< Teuchos::ParameterList > const ¶mList)
void setInitialCondition(const Thyra::ModelEvaluatorBase::InArgs< Scalar > &initialCondition)
void setSolver(const RCP< Thyra::NonlinearSolverBase< Scalar > > &solver)
void getNodes(Array< Scalar > *time_vec) const
bool isImplicit() const
Return if this stepper is an implicit stepper.
RCP< Thyra::ModelEvaluator< Scalar > > getNonconstModel()
RCP< InterpolatorBase< Scalar > > unSetInterpolator()
Mix-in interface all implicit stepper objects that accept a nonlinear solver to be used to compute th...
TimeRange< Scalar > getTimeRange() const
RCP< Thyra::NonlinearSolverBase< Scalar > > getNonconstSolver()
Thyra::ModelEvaluatorBase::InArgs< Scalar > getInitialCondition() const
const StepStatus< Scalar > getStepStatus() const
Scalar takeStep(Scalar dt, StepSizeType flag)
RCP< StepperBase< Scalar > > cloneStepperAlgorithm() const
Creates copies of all internal data (including the parameter list) except the model which is assumed ...
RCP< const Thyra::ModelEvaluator< Scalar > > getModel() const
void setNonconstModel(const RCP< Thyra::ModelEvaluator< Scalar > > &model)