Rythmos - Transient Integration for Differential Equations  Version of the Day
 All Classes Functions Variables Typedefs
Rythmos_FixedStepControlStrategy_decl.hpp
00001 //@HEADER
00002 // ***********************************************************************
00003 //
00004 //                           Rythmos Package
00005 //                 Copyright (2006) Sandia Corporation
00006 //
00007 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
00008 // license for use of this work by or on behalf of the U.S. Government.
00009 //
00010 // This library is free software; you can redistribute it and/or modify
00011 // it under the terms of the GNU Lesser General Public License as
00012 // published by the Free Software Foundation; either version 2.1 of the
00013 // License, or (at your option) any later version.
00014 //
00015 // This library is distributed in the hope that it will be useful, but
00016 // WITHOUT ANY WARRANTY; without even the implied warranty of
00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018 // Lesser General Public License for more details.
00019 //
00020 // You should have received a copy of the GNU Lesser General Public
00021 // License along with this library; if not, write to the Free Software
00022 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
00023 // USA
00024 // Questions? Contact Todd S. Coffey (tscoffe@sandia.gov)
00025 //
00026 // ***********************************************************************
00027 //@HEADER
00028 
00029 #ifndef Rythmos_FIXED_STEP_CONTROL_STRATEGY_DECL_H
00030 #define Rythmos_FIXED_STEP_CONTROL_STRATEGY_DECL_H
00031 
00032 #include "Rythmos_StepControlStrategyBase.hpp"
00033 
00034 namespace Rythmos {
00035 
00036 // Step Control Strategy object for FixedStepControlStrategy
00037 //
00038 // Order of calls:
00039 // setRequestedStepSize()
00040 // nextStepSize()
00041 // optional:  nextStepOrder()
00042 // setCorrection
00043 // acceptStep
00044 // completeStep or rejectStep
00045 // repeat
00046 //
00047 template<class Scalar>
00048 class FixedStepControlStrategy
00049   : virtual public StepControlStrategyBase<Scalar>
00050 {
00051   public:
00052 
00053     typedef typename Teuchos::ScalarTraits<Scalar>::magnitudeType ScalarMag;
00054 
00058     void setRequestedStepSize(const StepperBase<Scalar>& stepper,
00059       const Scalar& stepSize, const StepSizeType& stepSizeType);
00060 
00062     void nextStepSize(const StepperBase<Scalar>& stepper, Scalar* stepSize,
00063       StepSizeType* stepSizeType, int* order);
00064 
00066     void setCorrection(
00067          const StepperBase<Scalar>& stepper
00068         ,const RCP<const Thyra::VectorBase<Scalar> >& soln
00069         ,const RCP<const Thyra::VectorBase<Scalar> >& ee
00070         ,int solveStatus
00071         );
00072 
00074     bool acceptStep(const StepperBase<Scalar>& stepper, Scalar* LETValue);
00075 
00077     void completeStep(const StepperBase<Scalar>& stepper);
00078 
00080     AttemptedStepStatusFlag rejectStep(const StepperBase<Scalar>& stepper);
00081 
00083     StepControlStrategyState getCurrentState();
00084 
00086     int getMaxOrder() const;
00087 
00089     void setStepControlData(const StepperBase<Scalar>& stepper);
00090 
00092     bool supportsCloning() const;
00093 
00095     RCP<StepControlStrategyBase<Scalar> > cloneStepControlStrategyAlgorithm() const;
00096 
00098 
00099     FixedStepControlStrategy();
00100 
00104     void describe(
00105       Teuchos::FancyOStream &out,
00106       const Teuchos::EVerbosityLevel verbLevel
00107       ) const;
00109 
00113     void setParameterList(RCP<Teuchos::ParameterList> const& paramList);
00114 
00116     RCP<Teuchos::ParameterList> getNonconstParameterList();
00117 
00119     RCP<Teuchos::ParameterList> unsetParameterList();
00120 
00122     RCP<const Teuchos::ParameterList> getValidParameters() const;
00123 
00125 
00126     void initialize(const StepperBase<Scalar>& stepper);
00127 
00128 
00129   private:
00130 
00131     // Private data members
00132 
00133     StepControlStrategyState stepControlState_;
00134     RCP<Teuchos::ParameterList> parameterList_;
00135 
00136     // Private member functions
00137 
00138     void setStepControlState_(StepControlStrategyState state);
00139 
00140 };
00141 
00142 } // namespace Rythmos
00143 
00144 #endif // Rythmos_FIXED_STEP_CONTROL_STRATEGY_DECL_H
00145 
 All Classes Functions Variables Typedefs