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., 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 
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   bool take_variable_steps_;
00109   int num_constant_steps_;
00110   int num_ramping_steps_;
00111   Scalar initial_dt_;
00112   Scalar min_dt_;
00113   Scalar max_dt_;
00114   Scalar ramping_factor_;
00115   int num_step_failures_;
00116   int max_step_failures_;
00117 
00118   Scalar current_dt_;
00119 
00120   TimeRange<Scalar> integrationTimeDomain_;
00121 
00122   static const std::string take_variable_steps_name_;
00123   static const bool take_variable_steps_default_;
00124 
00125   static const std::string num_constant_steps_name_;
00126   static const int num_constant_steps_default_;
00127 
00128   static const std::string num_ramping_steps_name_;
00129   static const int num_ramping_steps_default_;
00130 
00131   static const std::string initial_dt_name_;
00132   static const double initial_dt_default_;
00133 
00134   static const std::string min_dt_name_;
00135   static const double min_dt_default_;
00136 
00137   static const std::string max_dt_name_;
00138   static const double max_dt_default_;
00139 
00140   static const std::string ramping_factor_name_;
00141   static const double ramping_factor_default_;
00142 
00143   static const std::string max_step_failures_name_;
00144   static const int max_step_failures_default_;
00145 
00146 };
00147 
00148 
00153 template<class Scalar>
00154 RCP<RampingIntegrationControlStrategy<Scalar> >
00155 rampingIntegrationControlStrategy();
00156 
00157 
00162 template<class Scalar>
00163 RCP<RampingIntegrationControlStrategy<Scalar> >
00164 rampingIntegrationControlStrategy( const RCP<ParameterList> &paramList );
00165 
00166 
00167 
00168 } // namespace Rythmos
00169 
00170 
00171 #endif // RYTHMOS_RAMPING_INTEGRATION_CONTROL_STRATEGY_DECL_HPP
 All Classes Functions Variables Typedefs Friends