Rythmos - Transient Integration for Differential Equations  Version of the Day
 All Classes Functions Variables Typedefs Pages
Rythmos_FixedStepControlStrategy_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 #ifndef Rythmos_FIXED_STEP_CONTROL_STRATEGY_DECL_H
30 #define Rythmos_FIXED_STEP_CONTROL_STRATEGY_DECL_H
31 
32 #include "Rythmos_StepControlStrategyBase.hpp"
33 
34 namespace Rythmos {
35 
36 // Step Control Strategy object for FixedStepControlStrategy
37 //
38 // Order of calls:
39 // setRequestedStepSize()
40 // nextStepSize()
41 // optional: nextStepOrder()
42 // setCorrection
43 // acceptStep
44 // completeStep or rejectStep
45 // repeat
46 //
47 template<class Scalar>
48 class FixedStepControlStrategy
49  : virtual public StepControlStrategyBase<Scalar>
50 {
51  public:
52 
53  typedef typename Teuchos::ScalarTraits<Scalar>::magnitudeType ScalarMag;
54 
58  void setRequestedStepSize(const StepperBase<Scalar>& stepper,
59  const Scalar& stepSize, const StepSizeType& stepSizeType);
60 
62  void nextStepSize(const StepperBase<Scalar>& stepper, Scalar* stepSize,
63  StepSizeType* stepSizeType, int* order);
64 
66  void setCorrection(
67  const StepperBase<Scalar>& stepper
68  ,const RCP<const Thyra::VectorBase<Scalar> >& soln
69  ,const RCP<const Thyra::VectorBase<Scalar> >& ee
70  ,int solveStatus
71  );
72 
74  bool acceptStep(const StepperBase<Scalar>& stepper, Scalar* LETValue);
75 
77  void completeStep(const StepperBase<Scalar>& stepper);
78 
80  AttemptedStepStatusFlag rejectStep(const StepperBase<Scalar>& stepper);
81 
83  StepControlStrategyState getCurrentState();
84 
86  int getMaxOrder() const;
87 
89  void setStepControlData(const StepperBase<Scalar>& stepper);
90 
92  bool supportsCloning() const;
93 
95  RCP<StepControlStrategyBase<Scalar> > cloneStepControlStrategyAlgorithm() const;
96 
98 
99  FixedStepControlStrategy();
100 
104  void describe(
105  Teuchos::FancyOStream &out,
106  const Teuchos::EVerbosityLevel verbLevel
107  ) const;
109 
113  void setParameterList(RCP<Teuchos::ParameterList> const& paramList);
114 
116  RCP<Teuchos::ParameterList> getNonconstParameterList();
117 
119  RCP<Teuchos::ParameterList> unsetParameterList();
120 
122  RCP<const Teuchos::ParameterList> getValidParameters() const;
123 
125 
126  void initialize(const StepperBase<Scalar>& stepper);
127 
128 
129  private:
130 
131  // Private data members
132 
133  StepControlStrategyState stepControlState_;
134  RCP<Teuchos::ParameterList> parameterList_;
135 
136  // Private member functions
137 
138  void setStepControlState_(StepControlStrategyState state);
139 
140 };
141 
142 } // namespace Rythmos
143 
144 #endif // Rythmos_FIXED_STEP_CONTROL_STRATEGY_DECL_H
145