Rythmos - Transient Integration for Differential Equations  Version of the Day
 All Classes Functions Variables Typedefs Pages
Rythmos_RampingIntegrationControlStrategy_decl.hpp
1 //@HEADER
2 // ***********************************************************************
3 //
4 // Rythmos Package
5 // Copyright (2006) Sandia Corporation
6 //
7 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
8 // license for use of this work by or on behalf of the U.S. Government.
9 //
10 // This library is free software; you can redistribute it and/or modify
11 // it under the terms of the GNU Lesser General Public License as
12 // published by the Free Software Foundation; either version 2.1 of the
13 // License, or (at your option) any later version.
14 //
15 // This library is distributed in the hope that it will be useful, but
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 // Lesser General Public License for more details.
19 //
20 // You should have received a copy of the GNU Lesser General Public
21 // License along with this library; if not, write to the Free Software
22 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
23 // USA
24 // Questions? Contact Todd S. Coffey (tscoffe@sandia.gov)
25 //
26 // ***********************************************************************
27 //@HEADER
28 
29 
30 #ifndef RYTHMOS_RAMPING_INTEGRATION_CONTROL_STRATEGY_DECL_HPP
31 #define RYTHMOS_RAMPING_INTEGRATION_CONTROL_STRATEGY_DECL_HPP
32 
33 
34 #include "Rythmos_IntegrationControlStrategyBase.hpp"
35 #include "Rythmos_StepperBase.hpp"
36 #include "Rythmos_StepControlInfo.hpp"
37 #include "Teuchos_ParameterListAcceptorDefaultBase.hpp"
38 
39 
40 namespace Rythmos {
41 
42 
47 template<class Scalar>
49  : virtual public IntegrationControlStrategyBase<Scalar>,
50  virtual public Teuchos::ParameterListAcceptorDefaultBase
51 {
52 public:
53 
56 
59 
61 
64 
66  void setParameterList(RCP<ParameterList> const& paramList);
67 
69  RCP<const ParameterList> getValidParameters() const;
70 
72 
75 
77  bool handlesFailedTimeSteps() const;
78 
80  RCP<IntegrationControlStrategyBase<Scalar> >
82 
85  const TimeRange<Scalar> &integrationTimeDomain
86  );
87 
91  const StepperBase<Scalar> &stepper,
92  const StepControlInfo<Scalar> &stepCtrlInfoLast,
93  const int timeStepIter
94  );
95 
98  const StepperBase<Scalar> &stepper,
99  const StepControlInfo<Scalar> &stepCtrlInfoLast,
100  const int timeStepIter,
101  const StepControlInfo<Scalar> &stepCtrlInfo
102  );
103 
105 
106 private:
107 
108  bool take_variable_steps_;
109  int num_constant_steps_;
110  int num_ramping_steps_;
111  Scalar initial_dt_;
112  Scalar min_dt_;
113  Scalar max_dt_;
114  Scalar ramping_factor_;
115  int num_step_failures_;
116  int max_step_failures_;
117 
118  Scalar current_dt_;
119 
120  TimeRange<Scalar> integrationTimeDomain_;
121 
122  static const std::string take_variable_steps_name_;
123  static const bool take_variable_steps_default_;
124 
125  static const std::string num_constant_steps_name_;
126  static const int num_constant_steps_default_;
127 
128  static const std::string num_ramping_steps_name_;
129  static const int num_ramping_steps_default_;
130 
131  static const std::string initial_dt_name_;
132  static const double initial_dt_default_;
133 
134  static const std::string min_dt_name_;
135  static const double min_dt_default_;
136 
137  static const std::string max_dt_name_;
138  static const double max_dt_default_;
139 
140  static const std::string ramping_factor_name_;
141  static const double ramping_factor_default_;
142 
143  static const std::string max_step_failures_name_;
144  static const int max_step_failures_default_;
145 
146 };
147 
148 
153 template<class Scalar>
154 RCP<RampingIntegrationControlStrategy<Scalar> >
155 rampingIntegrationControlStrategy();
156 
157 
162 template<class Scalar>
163 RCP<RampingIntegrationControlStrategy<Scalar> >
164 rampingIntegrationControlStrategy( const RCP<ParameterList> &paramList );
165 
166 
167 
168 } // namespace Rythmos
169 
170 
171 #endif // RYTHMOS_RAMPING_INTEGRATION_CONTROL_STRATEGY_DECL_HPP
void resetIntegrationControlStrategy(const TimeRange< Scalar > &integrationTimeDomain)
Base class for defining stepper functionality.
Simple struct to aggregate integration/stepper control information.
Base class for strategy objects that control integration by selecting step sizes for a stepper...
bool handlesFailedTimeSteps() const
Overridden from IntegrationControlStrategyBase.
bool resetForFailedTimeStep(const StepperBase< Scalar > &stepper, const StepControlInfo< Scalar > &stepCtrlInfoLast, const int timeStepIter, const StepControlInfo< Scalar > &stepCtrlInfo)
Controls inital ramping at a fixed or incrementing time step size.
RCP< IntegrationControlStrategyBase< Scalar > > cloneIntegrationControlStrategy() const
StepControlInfo< Scalar > getNextStepControlInfo(const StepperBase< Scalar > &stepper, const StepControlInfo< Scalar > &stepCtrlInfoLast, const int timeStepIter)