30#ifndef RYTHMOS_STEP_CONTROL_STRATEGY_BASE_HPP
31#define RYTHMOS_STEP_CONTROL_STRATEGY_BASE_HPP
34#include "Rythmos_StepperBase.hpp"
46enum AttemptedStepStatusFlag { PREDICT_AGAIN, CONTINUE_ANYWAY, REP_ERR_FAIL, REP_CONV_FAIL };
49enum StepControlStrategyState { UNINITIALIZED, BEFORE_FIRST_STEP, MID_STEP, AFTER_CORRECTION, READY_FOR_NEXT_STEP, BEFORE_FIRST_STAGE, MID_STAGE };
58const char* toString(
const StepControlStrategyState stepControlStrategyState )
60 switch(stepControlStrategyState) {
62 return "UNINITIALIZED";
63 case BEFORE_FIRST_STEP:
64 return "BEFORE_FIRST_STEP";
67 case AFTER_CORRECTION:
68 return "AFTER_CORRECTION";
69 case READY_FOR_NEXT_STEP:
70 return "READY_FOR_NEXT_STEP";
71 case BEFORE_FIRST_STAGE:
72 return "BEFORE_FIRST_STAGE";
75#ifdef HAVE_RYTHMOS_DEBUG
77 TEUCHOS_TEST_FOR_EXCEPT(
"Invalid enum value!");
105template<
class Scalar>
107 :
virtual public Teuchos::Describable
108 ,
virtual public Teuchos::ParameterListAcceptor
109 ,
virtual public Teuchos::VerboseObject<StepControlStrategyBase<Scalar> >
114 virtual void initialize(
const StepperBase<Scalar>& stepper) =0;
118 const StepperBase<Scalar>& stepper
119 ,
const Scalar& stepSize
120 ,
const StepSizeType& stepSizeType
125 const StepperBase<Scalar>& stepper
127 , StepSizeType* stepSizeType
133 const StepperBase<Scalar>& stepper
134 ,
const RCP<
const Thyra::VectorBase<Scalar> >& soln
135 ,
const RCP<
const Thyra::VectorBase<Scalar> >& ee
141 const StepperBase<Scalar>& stepper
147 const StepperBase<Scalar>& stepper
152 const StepperBase<Scalar>& stepper
173template<
class Scalar>
180template<
class Scalar>
181RCP<StepControlStrategyBase<Scalar> >
184 return Teuchos::null;
The member functions in the StepControlStrategyBase move you between these states in the following fa...
virtual void setCorrection(const StepperBase< Scalar > &stepper, const RCP< const Thyra::VectorBase< Scalar > > &soln, const RCP< const Thyra::VectorBase< Scalar > > &ee, int solveStatus)=0
virtual void completeStep(const StepperBase< Scalar > &stepper)=0
virtual void setRequestedStepSize(const StepperBase< Scalar > &stepper, const Scalar &stepSize, const StepSizeType &stepSizeType)=0
virtual int getMaxOrder() const =0
virtual void setStepControlData(const StepperBase< Scalar > &stepper)=0
virtual void nextStepSize(const StepperBase< Scalar > &stepper, Scalar *stepSize, StepSizeType *stepSizeType, int *order)=0
virtual RCP< StepControlStrategyBase< Scalar > > cloneStepControlStrategyAlgorithm() const
virtual AttemptedStepStatusFlag rejectStep(const StepperBase< Scalar > &stepper)=0
virtual void initialize(const StepperBase< Scalar > &stepper)=0
virtual bool acceptStep(const StepperBase< Scalar > &stepper, Scalar *LETValue)=0
virtual StepControlStrategyState getCurrentState()=0
virtual bool supportsCloning() const