29 #ifndef Rythmos_FIRSTORDERERROR_STEP_CONTROL_STRATEGY_DEF_H 
   30 #define Rythmos_FIRSTORDERERROR_STEP_CONTROL_STRATEGY_DEF_H 
   32 #include "Rythmos_FirstOrderErrorStepControlStrategy_decl.hpp" 
   33 #include "Thyra_VectorStdOps.hpp" 
   34 #include "Teuchos_VerboseObjectParameterListHelpers.hpp" 
   41 template<
class Scalar>
 
   43 FirstOrderErrorStepControlStrategy<Scalar>::initialStepSizeName_
 
   44 = 
"Initial Step Size";
 
   46 template<
class Scalar>
 
   48 FirstOrderErrorStepControlStrategy<Scalar>::initialStepSizeDefault_
 
   52 template<
class Scalar>
 
   54 FirstOrderErrorStepControlStrategy<Scalar>::minStepSizeName_
 
   57 template<
class Scalar>
 
   59 FirstOrderErrorStepControlStrategy<Scalar>::minStepSizeDefault_
 
   60 = std::numeric_limits<Scalar>::min();
 
   63 template<
class Scalar>
 
   65 FirstOrderErrorStepControlStrategy<Scalar>::maxStepSizeName_
 
   68 template<
class Scalar>
 
   70 FirstOrderErrorStepControlStrategy<Scalar>::maxStepSizeDefault_
 
   71 = std::numeric_limits<Scalar>::max();
 
   74 template<
class Scalar>
 
   76 FirstOrderErrorStepControlStrategy<Scalar>::maxStepSizeIncreaseFactorName_
 
   77 = 
"Max Step Size Increase Factor";
 
   79 template<
class Scalar>
 
   81 FirstOrderErrorStepControlStrategy<Scalar>::maxStepSizeIncreaseFactorDefault_
 
   85 template<
class Scalar>
 
   87 FirstOrderErrorStepControlStrategy<Scalar>::minStepSizeDecreaseFactorName_
 
   88 = 
"Min Step Size Decrease Factor";
 
   90 template<
class Scalar>
 
   92 FirstOrderErrorStepControlStrategy<Scalar>::minStepSizeDecreaseFactorDefault_
 
   96 template<
class Scalar>
 
   98 FirstOrderErrorStepControlStrategy<Scalar>::maxStepFailuresName_
 
   99 = 
"Maximum Number of Step Failures";
 
  101 template<
class Scalar>
 
  103 FirstOrderErrorStepControlStrategy<Scalar>::maxStepFailuresDefault_
 
  107 template<
class Scalar>
 
  109 FirstOrderErrorStepControlStrategy<Scalar>::errorRelativeToleranceName_
 
  110 = 
"Error Relative Tolerance";
 
  112 template<
class Scalar>
 
  114 FirstOrderErrorStepControlStrategy<Scalar>::errorRelativeToleranceDefault_
 
  118 template<
class Scalar>
 
  120 FirstOrderErrorStepControlStrategy<Scalar>::errorAbsoluteToleranceName_
 
  121 = 
"Error Absolute Tolerance";
 
  123 template<
class Scalar>
 
  125 FirstOrderErrorStepControlStrategy<Scalar>::errorAbsoluteToleranceDefault_
 
  131 template<
class Scalar>
 
  132 void FirstOrderErrorStepControlStrategy<Scalar>::setStepControlState_(
 
  133   StepControlStrategyState newState)
 
  135   if (stepControlState_ == UNINITIALIZED) {
 
  136     TEUCHOS_TEST_FOR_EXCEPT(newState != BEFORE_FIRST_STEP);
 
  137   } 
else if (stepControlState_ == BEFORE_FIRST_STEP) {
 
  138     TEUCHOS_TEST_FOR_EXCEPT(newState != MID_STEP);
 
  139   } 
else if (stepControlState_ == MID_STEP) {
 
  140     TEUCHOS_TEST_FOR_EXCEPT(newState != AFTER_CORRECTION);
 
  141   } 
else if (stepControlState_ == AFTER_CORRECTION) {
 
  142     TEUCHOS_TEST_FOR_EXCEPT(newState != READY_FOR_NEXT_STEP);
 
  143   } 
else if (stepControlState_ == READY_FOR_NEXT_STEP) {
 
  144     TEUCHOS_TEST_FOR_EXCEPT(newState != MID_STEP);
 
  146   stepControlState_ = newState;
 
  149 template<
class Scalar>
 
  152   return(stepControlState_);
 
  155 template<
class Scalar>
 
  157   : stepControlState_(UNINITIALIZED),
 
  158     initialStepSize_(initialStepSizeDefault_),
 
  159     stepSizeType_(STEP_TYPE_VARIABLE),
 
  160     minStepSize_(minStepSizeDefault_),
 
  161     maxStepSize_(maxStepSizeDefault_),
 
  162     maxStepSizeIncreaseFactor_(maxStepSizeIncreaseFactorDefault_),
 
  163     minStepSizeDecreaseFactor_(minStepSizeDecreaseFactorDefault_),
 
  165     maxStepFailures_(maxStepFailuresDefault_),
 
  167     errorRelativeTolerance_(errorRelativeToleranceDefault_),
 
  168     errorAbsoluteTolerance_(errorAbsoluteToleranceDefault_),
 
  172 template<
class Scalar>
 
  178   using Thyra::createMember;
 
  180   RCP<Teuchos::FancyOStream> out = this->getOStream();
 
  181   Teuchos::EVerbosityLevel verbLevel = this->getVerbLevel();
 
  182   const bool doTrace = (as<int>(verbLevel) >= as<int>(Teuchos::VERB_HIGH));
 
  183   Teuchos::OSTab ostab(out,1,
"initialize");
 
  186     *out << 
"\nEntering " << this->Teuchos::Describable::description()
 
  187          << 
"::initialize()...\n";
 
  190   if (is_null(errWtVec_))
 
  192   setStepControlState_(BEFORE_FIRST_STEP);
 
  195     *out << 
"\nLeaving " << this->Teuchos::Describable::description()
 
  196          << 
"::initialize()...\n";
 
  200 template<
class Scalar>
 
  203   const Scalar& stepSize,
 
  204   const StepSizeType& stepSizeType)
 
  206   typedef Teuchos::ScalarTraits<Scalar> ST;
 
  207   TEUCHOS_TEST_FOR_EXCEPTION(
 
  208     !((stepControlState_ == UNINITIALIZED) ||
 
  209       (stepControlState_ == BEFORE_FIRST_STEP) ||
 
  210       (stepControlState_ == READY_FOR_NEXT_STEP) ||
 
  211       (stepControlState_ == MID_STEP)), std::logic_error,
 
  212      "Error: Invalid state (stepControlState_=" << toString(stepControlState_)
 
  213      << 
") for FirstOrderErrorStepControlStrategy<Scalar>::setRequestedStepSize()\n");
 
  215   TEUCHOS_TEST_FOR_EXCEPTION(
 
  216     ((stepSizeType == STEP_TYPE_FIXED) && (stepSize == ST::zero())),
 
  217     std::logic_error, 
"Error, step size type == STEP_TYPE_FIXED, " 
  218     "but requested step size == 0!\n");
 
  220   TEUCHOS_TEST_FOR_EXCEPTION(
 
  221     ((stepSizeType == STEP_TYPE_FIXED) && (stepSize < minStepSize_)),
 
  222     std::logic_error, 
"Error, step size type == STEP_TYPE_FIXED, " 
  223     "and (stepSize="<<stepSize<<
") < (minStepSize="<<minStepSize_<<
")!\n");
 
  225   TEUCHOS_TEST_FOR_EXCEPTION(
 
  226     ((stepSizeType == STEP_TYPE_FIXED) && (stepSize > maxStepSize_)),
 
  227     std::logic_error, 
"Error, step size type == STEP_TYPE_FIXED, " 
  228     "and (stepSize="<<stepSize<<
") > (maxStepSize="<<maxStepSize_<<
")!\n");
 
  230   if (stepControlState_ == UNINITIALIZED) initialize(stepper);
 
  231   requestedStepSize_ = stepSize;
 
  232   stepSizeType_ = stepSizeType;
 
  235 template<
class Scalar>
 
  238   StepSizeType* stepSizeType, 
int* )
 
  240   TEUCHOS_TEST_FOR_EXCEPTION(!((stepControlState_ == BEFORE_FIRST_STEP) ||
 
  241                                (stepControlState_ == MID_STEP) ||
 
  242                                (stepControlState_ == READY_FOR_NEXT_STEP) ),
 
  244      "Error: Invalid state (stepControlState_=" << toString(stepControlState_)
 
  245      << 
") for FirstOrderErrorStepControlStrategy<Scalar>::nextStepSize()\n");
 
  247   if (stepControlState_ == BEFORE_FIRST_STEP) {
 
  248     if (initialStepSize_ == initialStepSizeDefault_)
 
  249       initialStepSize_ = requestedStepSize_;
 
  250     nextStepSize_ = initialStepSize_;
 
  253   stepSizeType_ = *stepSizeType;
 
  254   if (stepSizeType_ == STEP_TYPE_FIXED)
 
  255     currentStepSize_ = requestedStepSize_;
 
  257     currentStepSize_ = nextStepSize_;
 
  260   currentStepSize_ = std::min(requestedStepSize_, currentStepSize_);
 
  262   *stepSize = currentStepSize_;
 
  263   setStepControlState_(MID_STEP);
 
  266 template<
class Scalar>
 
  269     ,
const RCP<
const Thyra::VectorBase<Scalar> >& soln
 
  270     ,
const RCP<
const Thyra::VectorBase<Scalar> >& dx
 
  273   TEUCHOS_TEST_FOR_EXCEPTION(stepControlState_ != MID_STEP, std::logic_error,
 
  274      "Error: Invalid state (stepControlState_=" << toString(stepControlState_)
 
  275      << 
") for FirstOrderErrorStepControlStrategy<Scalar>::setCorrection()\n");
 
  278   solveStatus_ = solveStatus;
 
  279   setStepControlState_(AFTER_CORRECTION);
 
  282 template<
class Scalar>
 
  286   TEUCHOS_TEST_FOR_EXCEPTION(stepControlState_ != AFTER_CORRECTION,
 
  288      "Error: Invalid state (stepControlState_=" << toString(stepControlState_)
 
  289      << 
") for FirstOrderErrorStepControlStrategy<Scalar>::completeStep()\n");
 
  293   Thyra::abs(*x_, Teuchos::ptrFromRef(*errWtVec_));
 
  294   Thyra::Vt_S(Teuchos::ptrFromRef(*errWtVec_), errorRelativeTolerance_);
 
  295   Thyra::Vp_S(Teuchos::ptrFromRef(*errWtVec_), errorAbsoluteTolerance_);
 
  296   reciprocal(*errWtVec_, Teuchos::ptrFromRef(*errWtVec_));
 
  297   typedef Teuchos::ScalarTraits<Scalar> ST;
 
  299   Vt_StV(Teuchos::ptrFromRef(*errWtVec_), ST::one(), *errWtVec_);
 
  301   int N = x_->space()->dim();
 
  302   Vt_S(Teuchos::ptrFromRef(*errWtVec_), Teuchos::as<Scalar>(1.0/N));
 
  303   double wrms = norm_2(*errWtVec_,(*dx_));
 
  304   stepSizeFactor_ = sqrt(2.0/wrms);     
 
  308   bool return_status = 
true;
 
  311   if ( (stepSizeFactor_ < minStepSizeDecreaseFactor_) || solveStatus_ < 0 )
 
  312     return_status = 
false;
 
  314   Teuchos::EVerbosityLevel verbLevel = this->getVerbLevel();
 
  315   if ( Teuchos::as<int>(verbLevel) >= Teuchos::as<int>(Teuchos::VERB_HIGH) ||
 
  316        (return_status == 
false &&
 
  317         Teuchos::as<int>(verbLevel) != Teuchos::as<int>(Teuchos::VERB_NONE)) ) {
 
  318     RCP<Teuchos::FancyOStream> out = this->getOStream();
 
  319     Teuchos::OSTab ostab(out,1,
"acceptStep");
 
  320     *out << 
"\n wrms                       = " << wrms << 
"\n" 
  321          << 
" stepSizeFactor_            = " << stepSizeFactor_ << 
"\n" 
  322          << 
" solveStatus_               = " << solveStatus_ << 
"\n" 
  323          << 
" minStepSizeDecreaseFactor_ = " << minStepSizeDecreaseFactor_
 
  327   return(return_status);
 
  330 template<
class Scalar>
 
  334   TEUCHOS_TEST_FOR_EXCEPTION(stepControlState_ != AFTER_CORRECTION,
 
  336      "Error: Invalid state (stepControlState_=" << toString(stepControlState_)
 
  337      << 
") for FirstOrderErrorStepControlStrategy<Scalar>::completeStep()\n");
 
  339   setStepControlState_(READY_FOR_NEXT_STEP);
 
  343   RCP<Teuchos::FancyOStream> out = this->getOStream();
 
  344   Teuchos::EVerbosityLevel verbLevel = this->getVerbLevel();
 
  345   Teuchos::OSTab ostab(out,1,
"rejectStep");
 
  348   if ( as<int>(verbLevel) != as<int>(Teuchos::VERB_NONE) )
 
  349     *out << 
"numStepFailures_ = " << numStepFailures_ << 
"\n";
 
  350   if (numStepFailures_ > maxStepFailures_) {
 
  351     *out << 
"Rythmos_FirstOrderErrorStepControlStrategy::rejectStep(...):  " 
  352          << 
"Error: Too many step failures " 
  353          << 
"(numStepFailures="<<numStepFailures_
 
  354          <<
") > (maxStepFailures="<<maxStepFailures_<<
")\n";
 
  355     return (REP_ERR_FAIL);
 
  359   if (stepSizeType_ == STEP_TYPE_FIXED) {
 
  360     if ( as<int>(verbLevel) != as<int>(Teuchos::VERB_NONE) ) {
 
  361       *out << 
"Rythmos_FirstOrderErrorStepControl::rejectStep(...):  " 
  362            << 
"Error:  Step failure with fixed step size.\n";
 
  364     return (REP_ERR_FAIL);
 
  367   nextStepSize_ = currentStepSize_*
 
  368                   std::max(stepSizeFactor_, minStepSizeDecreaseFactor_);
 
  369   nextStepSize_ = std::max(nextStepSize_, minStepSize_);
 
  370   nextStepSize_ = std::min(nextStepSize_, maxStepSize_);
 
  372   AttemptedStepStatusFlag return_status = PREDICT_AGAIN;
 
  374   if ( as<int>(verbLevel) != as<int>(Teuchos::VERB_NONE) ) {
 
  375     *out << 
"Rythmos_FirstOrderErrorStepControl::rejectStep(...):  Step failure.\n" 
  376          << 
"  Current step size is "<< currentStepSize_ <<
".\n" 
  377          << 
"  Reducing next step size to "<< nextStepSize_ <<
".\n";
 
  380   return(return_status);
 
  383 template<
class Scalar>
 
  387   TEUCHOS_TEST_FOR_EXCEPTION(stepControlState_ != AFTER_CORRECTION,
 
  389      "Error: Invalid state (stepControlState_=" << toString(stepControlState_)
 
  390      << 
") for FirstOrderErrorStepControlStrategy<Scalar>::completeStep()\n");
 
  393   if (stepSizeType_ == STEP_TYPE_VARIABLE) {
 
  395     if (numStepFailures_ == 0) {
 
  396       nextStepSize_ *= std::max(minStepSizeDecreaseFactor_,
 
  397                          std::min(stepSizeFactor_, maxStepSizeIncreaseFactor_));
 
  400       nextStepSize_ = currentStepSize_;
 
  401       numStepFailures_ = std::max(numStepFailures_-1,0);
 
  404   nextStepSize_ = std::max(nextStepSize_, minStepSize_);
 
  405   nextStepSize_ = std::min(nextStepSize_, maxStepSize_);
 
  407   Teuchos::EVerbosityLevel verbLevel = this->getVerbLevel();
 
  408   if ( Teuchos::as<int>(verbLevel) >= Teuchos::as<int>(Teuchos::VERB_HIGH) ) {
 
  409     RCP<Teuchos::FancyOStream> out = this->getOStream();
 
  410     Teuchos::OSTab ostab(out,1,
"completeStep_");
 
  411     *out << 
"nextStepSize_    = " << nextStepSize_ << 
"\n";
 
  412     *out << 
"numStepFailures_ = " << numStepFailures_ << 
"\n";
 
  414   setStepControlState_(READY_FOR_NEXT_STEP);
 
  417 template<
class Scalar>
 
  419   Teuchos::FancyOStream &out,
 
  420   const Teuchos::EVerbosityLevel verbLevel
 
  426   if ( (as<int>(verbLevel) == as<int>(Teuchos::VERB_DEFAULT) ) ||
 
  427        (as<int>(verbLevel) >= as<int>(Teuchos::VERB_LOW)     )    ) {
 
  428     out << this->description() << 
"::describe" << 
"\n";
 
  430   if (as<int>(verbLevel) >= as<int>(Teuchos::VERB_LOW)) {
 
  431     out << 
"requestedStepSize_ = " << requestedStepSize_ << 
"\n";
 
  432     out << 
"currentStepSize_   = " << currentStepSize_ << 
"\n";
 
  433     out << 
"nextStepSize_      = " << nextStepSize_ << 
"\n";
 
  434     out << 
"stepSizeType_      = " << stepSizeType_ << 
"\n";
 
  435     out << 
"numStepFailures_   = " << numStepFailures_ << 
"\n";
 
  439 template<
class Scalar>
 
  441   RCP<Teuchos::ParameterList> 
const& paramList)
 
  446   TEUCHOS_TEST_FOR_EXCEPT(paramList == Teuchos::null);
 
  447   paramList->validateParameters(*this->getValidParameters(),0);
 
  448   parameterList_ = paramList;
 
  449   Teuchos::readVerboseObjectSublist(&*parameterList_,
this);
 
  451   initialStepSize_ = parameterList_->get(initialStepSizeName_,
 
  452                                          initialStepSizeDefault_);
 
  453   minStepSize_ = parameterList_->get(minStepSizeName_, minStepSizeDefault_);
 
  454   maxStepSize_ = parameterList_->get(maxStepSizeName_, maxStepSizeDefault_);
 
  455   TEUCHOS_TEST_FOR_EXCEPTION(
 
  456     !(minStepSize_ <= maxStepSize_), std::logic_error,
 
  457     "Error:  (minStepSize="<<minStepSize_
 
  458     <<
") > (maxStepSize="<<maxStepSize_<<
")\n");
 
  459   TEUCHOS_TEST_FOR_EXCEPTION(
 
  460     !((minStepSize_ <= initialStepSize_) && (initialStepSize_ <= maxStepSize_)),
 
  462     "Error: Initial Step Size is not within min/max range.\n" 
  463     << 
"  (minStepSize="<<minStepSize_
 
  464     <<
") > (initialStepSize="<<initialStepSize_<<
") or \n" 
  465     << 
"  (maxStepSize="<<maxStepSize_
 
  466     <<
") < (initialStepSize="<<initialStepSize_<<
")\n");
 
  468   maxStepSizeIncreaseFactor_ =
 
  469     parameterList_->get(maxStepSizeIncreaseFactorName_,
 
  470                         maxStepSizeIncreaseFactorDefault_);
 
  471   TEUCHOS_TEST_FOR_EXCEPTION(
 
  472     !(maxStepSizeIncreaseFactor_ > 0.0), std::logic_error,
 
  473     "Error:  (maxStepSizeIncreaseFactor=" 
  474     <<maxStepSizeIncreaseFactor_<<
") <= 0.0\n");
 
  476   minStepSizeDecreaseFactor_ =
 
  477     parameterList_->get(minStepSizeDecreaseFactorName_,
 
  478                         minStepSizeDecreaseFactorDefault_);
 
  479   TEUCHOS_TEST_FOR_EXCEPTION(
 
  480     !(minStepSizeDecreaseFactor_ > 0.0), std::logic_error,
 
  481     "Error:  (minStepSizeDecreaseFactor=" 
  482     <<minStepSizeDecreaseFactor_<<
") <= 0.0\n");
 
  484   TEUCHOS_TEST_FOR_EXCEPTION(
 
  485     !(minStepSizeDecreaseFactor_ < maxStepSizeIncreaseFactor_),
 
  486     std::logic_error, 
"Error:  " 
  487     "(minStepSizeDecreaseFactor="<<minStepSizeDecreaseFactor_<<
") >=" 
  488     "(maxStepSizeIncreaseFactor="<<maxStepSizeIncreaseFactor_<<
")\n");
 
  490   maxStepFailures_ = parameterList_->get(maxStepFailuresName_,
 
  491                                          maxStepFailuresDefault_);
 
  492   TEUCHOS_TEST_FOR_EXCEPTION(
 
  493     !(maxStepFailures_ >= 0), std::logic_error,
 
  494     "Error:  (maxStepFailures="<<maxStepFailures_<<
") < 0\n");
 
  496   errorRelativeTolerance_ = parameterList_->get(errorRelativeToleranceName_,
 
  497                                                 errorRelativeToleranceDefault_);
 
  498   TEUCHOS_TEST_FOR_EXCEPTION(
 
  499     !(errorRelativeTolerance_ >= 0.0), std::logic_error,
 
  500     "Error:  (errorRelativeTolerance="<<errorRelativeTolerance_<<
") < 0.0\n");
 
  502   errorAbsoluteTolerance_ = parameterList_->get(errorAbsoluteToleranceName_,
 
  503                                                 errorAbsoluteToleranceDefault_);
 
  504   TEUCHOS_TEST_FOR_EXCEPTION(
 
  505     !(errorAbsoluteTolerance_ >= 0.0), std::logic_error,
 
  506     "Error:  (errorAbsoluteTolerance="<<errorAbsoluteTolerance_<<
") < 0.0\n");
 
  508   RCP<Teuchos::FancyOStream> out = this->getOStream();
 
  509   Teuchos::EVerbosityLevel verbLevel = this->getVerbLevel();
 
  510   Teuchos::OSTab ostab(out,1,
"setParameterList");
 
  513   if ( as<int>(verbLevel) >= as<int>(Teuchos::VERB_HIGH) ) {
 
  514     *out << 
"minStepSize_               = " << minStepSize_              <<
"\n";
 
  515     *out << 
"maxStepSize_               = " << maxStepSize_              <<
"\n";
 
  516     *out << 
"maxStepSizeIncreaseFactor_ = " << maxStepSizeIncreaseFactor_<<
"\n";
 
  517     *out << 
"minStepSizeDecreaseFactor_ = " << minStepSizeDecreaseFactor_<<
"\n";
 
  518     *out << 
"maxStepFailures_           = " << maxStepFailures_          <<
"\n";
 
  519     *out << 
"errorRelativeTolerance_    = " << errorRelativeTolerance_   <<
"\n";
 
  520     *out << 
"errorAbsoluteTolerance_    = " << errorAbsoluteTolerance_   <<
"\n";
 
  524 template<
class Scalar>
 
  525 RCP<const Teuchos::ParameterList>
 
  528   static RCP<Teuchos::ParameterList> validPL;
 
  529   if (is_null(validPL)) {
 
  530     RCP<Teuchos::ParameterList> pl = Teuchos::parameterList();
 
  532     pl->set(initialStepSizeName_,initialStepSizeDefault_, 
"Initial step size.");
 
  533     pl->set(minStepSizeName_, minStepSizeDefault_, 
"Minimum step size.");
 
  534     pl->set(maxStepSizeName_, maxStepSizeDefault_, 
"Maximum step size.");
 
  535     pl->set(maxStepSizeIncreaseFactorName_, maxStepSizeIncreaseFactorDefault_,
 
  536             "The maximum factor to increase the step size after a successful step.");
 
  537     pl->set(minStepSizeDecreaseFactorName_, minStepSizeDecreaseFactorDefault_,
 
  538             "The minimum allowable factor to decrease the step size.  If the " 
  539       "stepSizeFactor_ is below this, the current step is considered a " 
  540       "failure and retried with `" + minStepSizeDecreaseFactorName_ +
 
  542     pl->set(maxStepFailuresName_, maxStepFailuresDefault_,
 
  543       "The maximum number of step failures before exiting with an error.  " 
  544       "The number of failure steps are carried between successful steps.");
 
  545     pl->set(errorRelativeToleranceName_, errorRelativeToleranceDefault_,
 
  546       "The allowable relative change in the error (the difference between " 
  547       "the solution at the end of the step and the predicted solution) for " 
  548       "each step to pass.  The stepper solution status is also used to " 
  549       "determine pass/fail.");
 
  550     pl->set(errorAbsoluteToleranceName_, errorAbsoluteToleranceDefault_,
 
  551       "The allowable absolute change in the error (the difference between " 
  552       "the solution at the end of the step and the predicted solution) for " 
  553       "each step to pass.  The stepper solution status is also used to " 
  554       "determine pass/fail.");
 
  556     Teuchos::setupVerboseObjectSublist(&*pl);
 
  562 template<
class Scalar>
 
  563 RCP<Teuchos::ParameterList>
 
  566   RCP<Teuchos::ParameterList> temp_param_list = parameterList_;
 
  567   parameterList_ = Teuchos::null;
 
  568   return(temp_param_list);
 
  571 template<
class Scalar>
 
  572 RCP<Teuchos::ParameterList>
 
  575   return(parameterList_);
 
  578 template<
class Scalar>
 
  582   if (stepControlState_ == UNINITIALIZED) initialize(stepper);
 
  585 template<
class Scalar>
 
  592 template<
class Scalar>
 
  593 RCP<StepControlStrategyBase<Scalar> >
 
  596   RCP<FirstOrderErrorStepControlStrategy<Scalar> >
 
  599   if (!is_null(parameterList_)) {
 
  600     stepControl->setParameterList(parameterList_);
 
  606 template<
class Scalar>
 
  609   TEUCHOS_TEST_FOR_EXCEPTION(
 
  610       stepControlState_ == UNINITIALIZED, std::logic_error,
 
  611       "Error, attempting to call getMaxOrder before initialization!\n" 
  622 #define RYTHMOS_FIRSTORDERERROR_STEP_CONTROL_STRATEGY_INSTANT(SCALAR) \ 
  623   template class FirstOrderErrorStepControlStrategy< SCALAR >; 
  627 #endif // Rythmos_FIRSTORDERERROR_STEP_CONTROL_STRATEGY_DEF_H 
Base class for defining stepper functionality. 
 
void setParameterList(RCP< Teuchos::ParameterList > const ¶mList)
 
void nextStepSize(const StepperBase< Scalar > &stepper, Scalar *stepSize, StepSizeType *stepSizeType, int *order)
 
RCP< Teuchos::ParameterList > getNonconstParameterList()
 
bool supportsCloning() const 
 
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) const 
 
void setCorrection(const StepperBase< Scalar > &stepper, const RCP< const Thyra::VectorBase< Scalar > > &soln, const RCP< const Thyra::VectorBase< Scalar > > &ee, int solveStatus)
 
RCP< const Teuchos::ParameterList > getValidParameters() const 
 
RCP< Teuchos::ParameterList > unsetParameterList()
 
virtual RCP< const Thyra::VectorSpaceBase< Scalar > > get_x_space() const =0
Return the space for x and x_dot. 
 
void setStepControlData(const StepperBase< Scalar > &stepper)
 
Step Control Strategy for first-order time integration. 
 
AttemptedStepStatusFlag rejectStep(const StepperBase< Scalar > &stepper)
 
StepControlStrategyState getCurrentState()
 
void initialize(const StepperBase< Scalar > &stepper)
 
bool acceptStep(const StepperBase< Scalar > &stepper, Scalar *LETValue)
 
RCP< StepControlStrategyBase< Scalar > > cloneStepControlStrategyAlgorithm() const 
 
void completeStep(const StepperBase< Scalar > &stepper)
 
void setRequestedStepSize(const StepperBase< Scalar > &stepper, const Scalar &stepSize, const StepSizeType &stepSizeType)