LifeV
Newmark.hpp
Go to the documentation of this file.
1 #ifndef TIMEHANDLERNEWMARK_H
2 #define TIMEHANDLERNEWMARK_H 1
3 
4 /*
5  * author: DAVIDE FORTI, davide.forti@epfl.ch
6  * Lightweighted class to Handle the time advancing scheme (based on Newmark).
7  *
8  */
9 
10 #include <lifev/core/LifeV.hpp>
11 
12 #include <lifev/core/array/VectorEpetra.hpp>
13 
14 namespace LifeV
15 {
16 
17 class Newmark
18 {
19 
20  typedef VectorEpetra vector_Type;
21 
22  typedef std::shared_ptr<vector_Type> vectorPtr_Type;
23 
24 public:
25 
26  // empty constructor
27  Newmark();
28 
29  // empty destructor
30  ~Newmark();
31 
32  void initialize ( const vectorPtr_Type& state, const vectorPtr_Type& first_derivative, const vectorPtr_Type& second_derivative);
33 
34  void compute_csi( );
35 
36  void shift( const vectorPtr_Type& state );
37 
38  void restart( const vectorPtr_Type& state, const vectorPtr_Type& first_derivative, const vectorPtr_Type& second_derivative );
39 
40  // set the value of beta
41  void set_beta( const Real beta ) { M_beta = beta; };
42 
43  // set the value of beta
44  void set_gamma( const Real gamma ) { M_gamma = gamma; };
45 
46  // set the value of beta
47  void set_timestep( const Real timestep ) { M_timeStep = timestep; };
48 
49  // set the value of beta
50  Real get_beta( ) { return M_beta; };
51 
52  // set the value of beta
53  Real get_gamma( ) { return M_gamma; };
54 
55  // set the value of beta
56  Real get_timestep( ) { return M_timeStep; };
57 
58  vectorPtr_Type const& get_csi() const { return M_csi; };
59 
60  vectorPtr_Type const& old_first_derivative() const { return M_old_first_derivative; };
61 
62  vectorPtr_Type const& old_second_derivative() const { return M_old_second_derivative; };
63 
64 private:
65 
66  // timestep
67  Real M_timeStep;
68 
69  // Coefficients. For second order derivatives the method is unconditionally stable for M_beta >= 0.25 and M_gamma = 0.5
70  Real M_beta;
71  Real M_gamma;
72 
73  // Vector needed by Newmark
74  vectorPtr_Type M_csi;
75 
76  // vectors for the current approximation
77  vectorPtr_Type M_current_state;
78  vectorPtr_Type M_current_first_derivative;
79  vectorPtr_Type M_current_second_derivative;
80 
81  // vectors for the approximation at the previous time step
82  vectorPtr_Type M_old_state;
83  vectorPtr_Type M_old_first_derivative;
84  vectorPtr_Type M_old_second_derivative;
85 
86 };
87 
88 } // end namespace LifeV
89 
90 #endif
double Real
Generic real data.
Definition: LifeV.hpp:175