Tempus  Version of the Day
Time Integration
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros 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_StepperImplicit.hpp"
13 #include "Tempus_WrapperModelEvaluatorSecondOrder.hpp"
14 
15 namespace Tempus {
16 
17 
18 /** \brief HHT-Alpha time stepper.
19  *
20  * Here, we implement the HHT-Alpha scheme in predictor/corrector form;
21  * see equations (10) and (13)-(19) in: G.M. Hulbert, J. Chung,
22  * "Explicit time integration algorithms for structural dynamics with
23  * optimal numerical dissipation", Comput. Methods Appl. Mech. Engrg.
24  * 137 175-188 (1996).
25  *
26  * There are four parameters in the scheme: \f$\alpha_m\f$, \f$\alpha_f\f$,
27  * \f$\beta\f$ and \f$\gamma\f$, all of which must be in the range \f$[0,1]\f$.
28  * When \f$\alpha_m=\alpha_f = 0\f$, the scheme reduces to the Newmark Beta
29  * scheme (see Tempus::StepperNewmark for details). Like the Newmark Beta
30  * scheme, the HHT-Alpha scheme can be either first or second order accurate,
31  * and either explicit or implicit.
32  *
33  * Although the general form of the scheme has been implemented in Tempus,
34  * it has only been verified for the case when \f$\alpha_m=\alpha_f = 0\f$
35  * (corresponding to the Newmark Beta) scheme, so other values for these
36  * parameters are not allowed at the present time. Also, note that, like
37  * the Newmark Beta stepper, the linear solve for the explicit version of
38  * this scheme has not been optimized (the mass matrix is not lumped).
39  *
40  * The First-Step-As-Last (FSAL) principle is not used with the
41  * HHT-Alpha method.
42  */
43 template<class Scalar>
44 class StepperHHTAlpha : virtual public Tempus::StepperImplicit<Scalar>
45 {
46 public:
47 
48  /** \brief Default constructor.
49  *
50  * Requires subsequent setModel(), setSolver() and initialize()
51  * calls before calling takeStep().
52  */
54 
55  /// Constructor
57  const Teuchos::RCP<const Thyra::ModelEvaluator<Scalar> >& appModel,
58  const Teuchos::RCP<StepperObserver<Scalar> >& obs,
59  const Teuchos::RCP<Thyra::NonlinearSolverBase<Scalar> >& solver,
60  bool useFSAL,
61  std::string ICConsistency,
62  bool ICConsistencyCheck,
63  bool zeroInitialGuess,
64  std::string schemeName,
65  Scalar beta,
66  Scalar gamma,
67  Scalar alpha_f_,
68  Scalar alpha_m_);
69 
70  /// \name Basic stepper methods
71  //@{
72  virtual void setModel(
73  const Teuchos::RCP<const Thyra::ModelEvaluator<Scalar> >& appModel);
74 
75  virtual void setObserver(
76  Teuchos::RCP<StepperObserver<Scalar> > /* obs */ = Teuchos::null){}
77 
78  virtual Teuchos::RCP<StepperObserver<Scalar> > getObserver() const
79  { return Teuchos::null; }
80 
81  /// Set the initial conditions and make them consistent.
82  virtual void setInitialConditions (
83  const Teuchos::RCP<SolutionHistory<Scalar> >& /* solutionHistory */){}
84 
85  /// Take the specified timestep, dt, and return true if successful.
86  virtual void takeStep(
87  const Teuchos::RCP<SolutionHistory<Scalar> >& solutionHistory);
88 
89  /// Get a default (initial) StepperState
90  virtual Teuchos::RCP<Tempus::StepperState<Scalar> > getDefaultStepperState();
91  virtual Scalar getOrder() const {
92  if (gamma_ == 0.5) return 2.0;
93  else return 1.0;
94  }
95  virtual Scalar getOrderMin() const {return 1.0;}
96  virtual Scalar getOrderMax() const {return 2.0;}
97 
98  virtual bool isExplicit() const {return false;}
99  virtual bool isImplicit() const {return true;}
100  virtual bool isExplicitImplicit() const
101  {return isExplicit() and isImplicit();}
102  virtual bool isOneStepMethod() const {return true;}
103  virtual bool isMultiStepMethod() const {return !isOneStepMethod();}
104 
105  virtual OrderODE getOrderODE() const {return SECOND_ORDER_ODE;}
106  //@}
107 
108  /// Return W_xDotxDot_coeff = d(xDotDot)/d(x).
109  virtual Scalar getW_xDotDot_coeff (const Scalar dt) const
110  { return Scalar(1.0)/(beta_*dt*dt); }
111  /// Return alpha = d(xDot)/d(x).
112  virtual Scalar getAlpha(const Scalar dt) const { return gamma_/(beta_*dt); }
113  /// Return beta = d(x)/d(x).
114  virtual Scalar getBeta (const Scalar ) const { return Scalar(1.0); }
115 
116  Teuchos::RCP<const Teuchos::ParameterList> getValidParameters() const;
117 
118  /// \name Overridden from Teuchos::Describable
119  //@{
120  virtual void describe(Teuchos::FancyOStream & out,
121  const Teuchos::EVerbosityLevel verbLevel) const;
122  //@}
123 
124  virtual bool isValidSetup(Teuchos::FancyOStream & out) const;
125 
126  void predictVelocity(Thyra::VectorBase<Scalar>& vPred,
127  const Thyra::VectorBase<Scalar>& v,
128  const Thyra::VectorBase<Scalar>& a,
129  const Scalar dt) const;
130 
131  void predictDisplacement(Thyra::VectorBase<Scalar>& dPred,
132  const Thyra::VectorBase<Scalar>& d,
133  const Thyra::VectorBase<Scalar>& v,
134  const Thyra::VectorBase<Scalar>& a,
135  const Scalar dt) const;
136 
137  void predictVelocity_alpha_f(Thyra::VectorBase<Scalar>& vPred,
138  const Thyra::VectorBase<Scalar>& v) const;
139 
140  void predictDisplacement_alpha_f(Thyra::VectorBase<Scalar>& dPred,
141  const Thyra::VectorBase<Scalar>& d) const;
142 
143  void correctAcceleration(Thyra::VectorBase<Scalar>& a_n_plus1,
144  const Thyra::VectorBase<Scalar>& a_n) const;
145 
146  void correctVelocity(Thyra::VectorBase<Scalar>& v,
147  const Thyra::VectorBase<Scalar>& vPred,
148  const Thyra::VectorBase<Scalar>& a,
149  const Scalar dt) const;
150 
151  void correctDisplacement(Thyra::VectorBase<Scalar>& d,
152  const Thyra::VectorBase<Scalar>& dPred,
153  const Thyra::VectorBase<Scalar>& a,
154  const Scalar dt) const;
155 
156  void setSchemeName(std::string schemeName);
157  void setBeta(Scalar beta);
158  void setGamma(Scalar gamma);
159  void setAlphaF(Scalar alpha_f);
160  void setAlphaM(Scalar alpha_m);
161 
162 private:
163 
164  std::string schemeName_;
165  Scalar beta_;
166  Scalar gamma_;
167  Scalar alpha_f_;
168  Scalar alpha_m_;
169 
170  Teuchos::RCP<Teuchos::FancyOStream> out_;
171 
172 };
173 } // namespace Tempus
174 
175 #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 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.
virtual void setObserver(Teuchos::RCP< StepperObserver< Scalar > >=Teuchos::null)
Set Observer.
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)
StepperObserver class for Stepper class.
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
virtual Teuchos::RCP< StepperObserver< Scalar > > getObserver() const
Get Observer.
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 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.