29 #ifndef Rythmos_SIMPLE_STEP_CONTROL_STRATEGY_DECL_H
30 #define Rythmos_SIMPLE_STEP_CONTROL_STRATEGY_DECL_H
32 #include "Rythmos_StepControlStrategyBase.hpp"
47 template<
class Scalar>
48 class SimpleStepControlStrategy
49 :
virtual public StepControlStrategyBase<Scalar>
53 typedef typename Teuchos::ScalarTraits<Scalar>::magnitudeType ScalarMag;
58 void setRequestedStepSize(
const StepperBase<Scalar>& stepper,
59 const Scalar& stepSize,
const StepSizeType& stepSizeType);
62 void nextStepSize(
const StepperBase<Scalar>& stepper, Scalar* stepSize,
63 StepSizeType* stepSizeType,
int* order);
67 const StepperBase<Scalar>& stepper
68 ,
const RCP<
const Thyra::VectorBase<Scalar> >& soln
69 ,
const RCP<
const Thyra::VectorBase<Scalar> >& ee
74 bool acceptStep(
const StepperBase<Scalar>& stepper, Scalar* LETValue);
77 void completeStep(
const StepperBase<Scalar>& stepper);
80 AttemptedStepStatusFlag rejectStep(
const StepperBase<Scalar>& stepper);
83 StepControlStrategyState getCurrentState();
86 int getMaxOrder()
const;
89 void setStepControlData(
const StepperBase<Scalar>& stepper);
92 bool supportsCloning()
const;
95 RCP<StepControlStrategyBase<Scalar> > cloneStepControlStrategyAlgorithm()
const;
99 SimpleStepControlStrategy();
105 Teuchos::FancyOStream &out,
106 const Teuchos::EVerbosityLevel verbLevel
113 void setParameterList(RCP<Teuchos::ParameterList>
const& paramList);
116 RCP<Teuchos::ParameterList> getNonconstParameterList();
119 RCP<Teuchos::ParameterList> unsetParameterList();
122 RCP<const Teuchos::ParameterList> getValidParameters()
const;
126 void initialize(
const StepperBase<Scalar>& stepper);
133 void defaultInitializeAllData_();
135 StepControlStrategyState stepControlState_;
137 RCP<Teuchos::ParameterList> parameterList_;
139 Scalar initialStepSize_;
140 Scalar requestedStepSize_;
141 Scalar currentStepSize_;
142 Scalar nextStepSize_;
143 StepSizeType stepSizeType_;
147 Scalar stepSizeIncreaseFactor_;
148 Scalar stepSizeDecreaseFactor_;
149 int numStepFailures_;
150 int maxStepFailures_;
152 Scalar dxRelativeTolerance_;
153 Scalar dxAbsoluteTolerance_;
156 RCP<const Thyra::VectorBase<Scalar> > x_;
157 RCP<const Thyra::VectorBase<Scalar> > dx_;
160 static const std::string initialStepSizeName_;
161 static const double initialStepSizeDefault_;
163 static const std::string minStepSizeName_;
164 static const double minStepSizeDefault_;
166 static const std::string maxStepSizeName_;
167 static const double maxStepSizeDefault_;
169 static const std::string stepSizeIncreaseFactorName_;
170 static const double stepSizeIncreaseFactorDefault_;
172 static const std::string stepSizeDecreaseFactorName_;
173 static const double stepSizeDecreaseFactorDefault_;
175 static const std::string maxStepFailuresName_;
176 static const int maxStepFailuresDefault_;
178 static const std::string dxRelativeToleranceName_;
179 static const double dxRelativeToleranceDefault_;
181 static const std::string dxAbsoluteToleranceName_;
182 static const double dxAbsoluteToleranceDefault_;
187 void setStepControlState_(StepControlStrategyState state);
193 #endif // Rythmos_SIMPLE_STEP_CONTROL_STRATEGY_DECL_H