Rythmos - Transient Integration for Differential Equations Version of the Day
Rythmos_RampingIntegrationControlStrategy_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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00023 // USA
00024 // Questions? Contact Todd S. Coffey (tscoffe@sandia.gov)
00025 //
00026 // ***********************************************************************
00027 //@HEADER
00028 
00029 
00030 #ifndef RYTHMOS_RAMPING_INTEGRATION_CONTROL_STRATEGY_DECL_HPP
00031 #define RYTHMOS_RAMPING_INTEGRATION_CONTROL_STRATEGY_DECL_HPP
00032 
00033 
00034 #include "Rythmos_IntegrationControlStrategyBase.hpp"
00035 #include "Rythmos_StepperBase.hpp"
00036 #include "Rythmos_StepControlInfo.hpp"
00037 #include "Teuchos_ParameterListAcceptorDefaultBase.hpp"
00038 
00039 
00040 namespace Rythmos {
00041 
00042 
00047 template<class Scalar>
00048 class RampingIntegrationControlStrategy
00049   : virtual public IntegrationControlStrategyBase<Scalar>,
00050     virtual public Teuchos::ParameterListAcceptorDefaultBase
00051 {
00052 public:
00053 
00056 
00058   RampingIntegrationControlStrategy();
00059 
00061 
00064 
00066   void setParameterList(RCP<ParameterList> const& paramList);
00067 
00069   RCP<const ParameterList> getValidParameters() const;
00070 
00072 
00075 
00077   bool handlesFailedTimeSteps() const;
00078 
00080   RCP<IntegrationControlStrategyBase<Scalar> >
00081   cloneIntegrationControlStrategy() const;
00082 
00084   void resetIntegrationControlStrategy(
00085     const TimeRange<Scalar> &integrationTimeDomain
00086     );
00087 
00089   StepControlInfo<Scalar>
00090   getNextStepControlInfo(
00091     const StepperBase<Scalar> &stepper,
00092     const StepControlInfo<Scalar> &stepCtrlInfoLast,
00093     const int timeStepIter
00094     );
00095 
00097   bool resetForFailedTimeStep(
00098     const StepperBase<Scalar> &stepper,
00099     const StepControlInfo<Scalar> &stepCtrlInfoLast,
00100     const int timeStepIter,
00101     const StepControlInfo<Scalar> &stepCtrlInfo
00102     );
00103 
00105 
00106 private:
00107 
00108   int num_ramping_steps_;
00109   Scalar initial_dt_;
00110   Scalar max_dt_;
00111   Scalar ramping_factor_;
00112 
00113   Scalar current_dt_;
00114 
00115   TimeRange<Scalar> integrationTimeDomain_;
00116 
00117   static const std::string num_ramping_steps_name_;
00118   static const int num_ramping_steps_default_;
00119 
00120   static const std::string initial_dt_name_;
00121   static const double initial_dt_default_;
00122 
00123   static const std::string max_dt_name_;
00124   static const double max_dt_default_;
00125 
00126   static const std::string ramping_factor_name_;
00127   static const double ramping_factor_default_;
00128 
00129 };
00130 
00131 
00136 template<class Scalar> 
00137 RCP<RampingIntegrationControlStrategy<Scalar> >
00138 rampingIntegrationControlStrategy();
00139 
00140 
00145 template<class Scalar> 
00146 RCP<RampingIntegrationControlStrategy<Scalar> >
00147 rampingIntegrationControlStrategy( const RCP<ParameterList> &paramList );
00148 
00149 
00150 
00151 } // namespace Rythmos
00152 
00153 
00154 #endif // RYTHMOS_RAMPING_INTEGRATION_CONTROL_STRATEGY_DECL_HPP
 All Classes Functions Variables Typedefs Friends