Tempus  Version of the Day
Time Integration
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Tempus_StepperHHTAlpha_decl.hpp
Go to the documentation of this file.
1 // @HEADER
2 // ****************************************************************************
3 // Tempus: Copyright (2017) Sandia Corporation
4 //
5 // Distributed under BSD 3-clause license (See accompanying file Copyright.txt)
6 // ****************************************************************************
7 // @HEADER
8 
9 #ifndef Tempus_StepperHHTAlpha_decl_hpp
10 #define Tempus_StepperHHTAlpha_decl_hpp
11 
12 #include "Tempus_config.hpp"
13 #include "Tempus_StepperImplicit.hpp"
14 #include "Tempus_WrapperModelEvaluatorSecondOrder.hpp"
16 
17 namespace Tempus {
18 
19 
45 template<class Scalar>
46 class StepperHHTAlpha : virtual public Tempus::StepperImplicit<Scalar>
47 {
48 public:
49 
56 
59  const Teuchos::RCP<const Thyra::ModelEvaluator<Scalar> >& appModel,
61  bool useFSAL,
62  std::string ICConsistency,
63  bool ICConsistencyCheck,
64  bool zeroInitialGuess,
65  std::string schemeName,
66  Scalar beta,
67  Scalar gamma,
68  Scalar alpha_f_,
69  Scalar alpha_m_,
70  const Teuchos::RCP<StepperHHTAlphaAppAction<Scalar> >& stepperHHTAlphaAppAction);
71 
73 
74  virtual void setModel(
75  const Teuchos::RCP<const Thyra::ModelEvaluator<Scalar> >& appModel);
76 
77  virtual void setAppAction(
79 
81  { return stepperHHTAlphaAppAction_; }
82 
84  virtual void setInitialConditions (
85  const Teuchos::RCP<SolutionHistory<Scalar> >& /* solutionHistory */){}
86 
88  virtual void takeStep(
89  const Teuchos::RCP<SolutionHistory<Scalar> >& solutionHistory);
90 
93  virtual Scalar getOrder() const {
94  if (gamma_ == 0.5) return 2.0;
95  else return 1.0;
96  }
97  virtual Scalar getOrderMin() const {return 1.0;}
98  virtual Scalar getOrderMax() const {return 2.0;}
99 
100  virtual bool isExplicit() const {return false;}
101  virtual bool isImplicit() const {return true;}
102  virtual bool isExplicitImplicit() const
103  {return isExplicit() && isImplicit();}
104  virtual bool isOneStepMethod() const {return true;}
105  virtual bool isMultiStepMethod() const {return !isOneStepMethod();}
106  virtual OrderODE getOrderODE() const {return SECOND_ORDER_ODE;}
108 
110  virtual Scalar getW_xDotDot_coeff (const Scalar dt) const
111  { return Scalar(1.0)/(beta_*dt*dt); }
113  virtual Scalar getAlpha(const Scalar dt) const { return gamma_/(beta_*dt); }
115  virtual Scalar getBeta (const Scalar ) const { return Scalar(1.0); }
116 
118 
120 
121  virtual void describe(Teuchos::FancyOStream & out,
122  const Teuchos::EVerbosityLevel verbLevel) const;
124 
125  virtual bool isValidSetup(Teuchos::FancyOStream & out) const;
126 
128  const Thyra::VectorBase<Scalar>& v,
129  const Thyra::VectorBase<Scalar>& a,
130  const Scalar dt) const;
131 
133  const Thyra::VectorBase<Scalar>& d,
134  const Thyra::VectorBase<Scalar>& v,
135  const Thyra::VectorBase<Scalar>& a,
136  const Scalar dt) const;
137 
139  const Thyra::VectorBase<Scalar>& v) const;
140 
142  const Thyra::VectorBase<Scalar>& d) const;
143 
145  const Thyra::VectorBase<Scalar>& a_n) const;
146 
148  const Thyra::VectorBase<Scalar>& vPred,
149  const Thyra::VectorBase<Scalar>& a,
150  const Scalar dt) const;
151 
153  const Thyra::VectorBase<Scalar>& dPred,
154  const Thyra::VectorBase<Scalar>& a,
155  const Scalar dt) const;
156 
157  void setSchemeName(std::string schemeName);
158  void setBeta(Scalar beta);
159  void setGamma(Scalar gamma);
160  void setAlphaF(Scalar alpha_f);
161  void setAlphaM(Scalar alpha_m);
162 
163 private:
164 
166 
167  std::string schemeName_;
168  Scalar beta_;
169  Scalar gamma_;
170  Scalar alpha_f_;
171  Scalar alpha_m_;
172 
174 
175 };
176 
177 
179 // ------------------------------------------------------------------------
180 template<class Scalar>
183  const Teuchos::RCP<const Thyra::ModelEvaluator<Scalar> >& model,
185 
186 
187 } // namespace Tempus
188 
189 #endif // Tempus_StepperHHTAlpha_decl_hpp
void correctDisplacement(Thyra::VectorBase< Scalar > &d, const Thyra::VectorBase< Scalar > &dPred, const Thyra::VectorBase< Scalar > &a, const Scalar dt) const
virtual Scalar getW_xDotDot_coeff(const Scalar dt) const
Return W_xDotxDot_coeff = d(xDotDot)/d(x).
virtual Teuchos::RCP< StepperHHTAlphaAppAction< Scalar > > getAppAction() const
virtual bool isExplicitImplicit() const
virtual bool isValidSetup(Teuchos::FancyOStream &out) const
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const
void correctVelocity(Thyra::VectorBase< Scalar > &v, const Thyra::VectorBase< Scalar > &vPred, const Thyra::VectorBase< Scalar > &a, const Scalar dt) const
virtual OrderODE getOrderODE() const
virtual Scalar getOrderMin() const
void correctAcceleration(Thyra::VectorBase< Scalar > &a_n_plus1, const Thyra::VectorBase< Scalar > &a_n) const
virtual Teuchos::RCP< Tempus::StepperState< Scalar > > getDefaultStepperState()
Get a default (initial) StepperState.
StepperHHTAlpha()
Default constructor.
Stepper integrates second-order ODEs.
virtual Scalar getAlpha(const Scalar dt) const
Return alpha = d(xDot)/d(x).
Thyra Base interface for implicit time steppers.
void predictVelocity_alpha_f(Thyra::VectorBase< Scalar > &vPred, const Thyra::VectorBase< Scalar > &v) const
void setSchemeName(std::string schemeName)
virtual void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) const
SolutionHistory is basically a container of SolutionStates. SolutionHistory maintains a collection of...
void predictDisplacement_alpha_f(Thyra::VectorBase< Scalar > &dPred, const Thyra::VectorBase< Scalar > &d) const
virtual Scalar getBeta(const Scalar) const
Return beta = d(x)/d(x).
void predictDisplacement(Thyra::VectorBase< Scalar > &dPred, const Thyra::VectorBase< Scalar > &d, const Thyra::VectorBase< Scalar > &v, const Thyra::VectorBase< Scalar > &a, const Scalar dt) const
virtual Scalar getOrderMax() const
Teuchos::RCP< StepperHHTAlpha< Scalar > > createStepperHHTAlpha(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &model, Teuchos::RCP< Teuchos::ParameterList > pl)
Nonmember constructor - ModelEvaluator and ParameterList.
Teuchos::RCP< Teuchos::FancyOStream > out_
void predictVelocity(Thyra::VectorBase< Scalar > &vPred, const Thyra::VectorBase< Scalar > &v, const Thyra::VectorBase< Scalar > &a, const Scalar dt) const
virtual void setInitialConditions(const Teuchos::RCP< SolutionHistory< Scalar > > &)
Set the initial conditions and make them consistent.
virtual void setAppAction(Teuchos::RCP< StepperHHTAlphaAppAction< Scalar > > appAction)
virtual void setModel(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &appModel)
virtual void takeStep(const Teuchos::RCP< SolutionHistory< Scalar > > &solutionHistory)
Take the specified timestep, dt, and return true if successful.
Teuchos::RCP< StepperHHTAlphaAppAction< Scalar > > stepperHHTAlphaAppAction_