29 #ifndef Rythmos_IMPLICITBDF_STEPPER_STEP_CONTROL_DECL_H
30 #define Rythmos_IMPLICITBDF_STEPPER_STEP_CONTROL_DECL_H
32 #include "Rythmos_ErrWtVecCalcAcceptingStepControlStrategyBase.hpp"
37 enum BDFactionFlag { ACTION_UNSET, ACTION_LOWER, ACTION_MAINTAIN, ACTION_RAISE };
54 template<
class Scalar>
55 class ImplicitBDFStepperStepControl
56 :
virtual public ErrWtVecCalcAcceptingStepControlStrategyBase<Scalar>
60 typedef typename Teuchos::ScalarTraits<Scalar>::magnitudeType ScalarMag;
65 void setRequestedStepSize(
const StepperBase<Scalar>& stepper,
66 const Scalar& stepSize,
const StepSizeType& stepSizeType);
69 void nextStepSize(
const StepperBase<Scalar>& stepper, Scalar* stepSize,
70 StepSizeType* stepSizeType,
int* order);
74 const StepperBase<Scalar>& stepper
75 ,
const RCP<
const Thyra::VectorBase<Scalar> >& soln
76 ,
const RCP<
const Thyra::VectorBase<Scalar> >& ee
81 bool acceptStep(
const StepperBase<Scalar>& stepper, Scalar* LETValue);
84 void completeStep(
const StepperBase<Scalar>& stepper);
87 AttemptedStepStatusFlag rejectStep(
const StepperBase<Scalar>& stepper);
90 StepControlStrategyState getCurrentState();
93 int getMinOrder()
const;
96 int getMaxOrder()
const;
99 void setStepControlData(
const StepperBase<Scalar>& stepper);
102 bool supportsCloning()
const;
105 RCP<StepControlStrategyBase<Scalar> > cloneStepControlStrategyAlgorithm()
const;
113 void setErrWtVecCalc(
const RCP<ErrWtVecCalcBase<Scalar> >& errWtVecCalc);
116 RCP<const ErrWtVecCalcBase<Scalar> > getErrWtVecCalc()
const;
120 ImplicitBDFStepperStepControl();
126 Teuchos::FancyOStream &out,
127 const Teuchos::EVerbosityLevel verbLevel
134 void setParameterList(RCP<Teuchos::ParameterList>
const& paramList);
137 RCP<Teuchos::ParameterList> getNonconstParameterList();
140 RCP<Teuchos::ParameterList> unsetParameterList();
143 RCP<const Teuchos::ParameterList> getValidParameters()
const;
148 void initialize(
const StepperBase<Scalar>& stepper);
155 void defaultInitializeAllData_();
157 StepControlStrategyState stepControlState_;
159 RCP<ErrWtVecCalcBase<Scalar> > errWtVecCalc_;
163 StepSizeType stepSizeType_;
169 RCP<const Thyra::VectorBase<Scalar> > ee_;
170 RCP<Thyra::VectorBase<Scalar> > errWtVec_;
171 RCP<Thyra::VectorBase<Scalar> > delta_;
173 bool checkReduceOrderCalled_;
175 RCP<Teuchos::ParameterList> parameterList_;
179 ScalarMag relErrTol_;
180 ScalarMag absErrTol_;
185 Array<Scalar> alpha_;
187 Array<Scalar> sigma_;
188 Array<Scalar> gamma_;
199 bool constantStepSize_;
216 Scalar h0_max_factor_;
217 Scalar h_phase0_incr_;
219 Scalar Tkm1_Tk_safety_;
220 Scalar Tkp1_Tk_safety_;
226 Scalar r_hincr_test_;
232 int newtonConvergenceStatus_;
233 bool failStepIfNonlinearSolveFails_;
238 const Thyra::VectorBase<Scalar>& weight,
239 const Thyra::VectorBase<Scalar>& vector
242 Scalar checkReduceOrder_(
const StepperBase<Scalar>& stepper);
244 void getFirstTimeStep_(
const StepperBase<Scalar>& stepper);
246 void setStepControlState_(StepControlStrategyState state);
248 void updateCoeffs_();
250 void setDefaultMagicNumbers_(Teuchos::ParameterList &magicNumberList);
256 #endif // Rythmos_IMPLICITBDF_STEPPER_STEP_CONTROL_DECL_H