LifeV
TimeAdvanceBDFNavierStokes.hpp
Go to the documentation of this file.
1 //@HEADER
2 /*
3 *******************************************************************************
4 
5  Copyright (C) 2004, 2005, 2007 EPFL, Politecnico di Milano, INRIA
6  Copyright (C) 2010 EPFL, Politecnico di Milano, Emory University
7 
8  This file is part of LifeV.
9 
10  LifeV is free software; you can redistribute it and/or modify
11  it under the terms of the GNU Lesser General Public License as published by
12  the Free Software Foundation, either version 3 of the License, or
13  (at your option) any later version.
14 
15  LifeV is distributed in the hope that it will be useful,
16  but 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 License
21  along with LifeV. If not, see <http://www.gnu.org/licenses/>.
22 
23 *******************************************************************************
24 */
25 //@HEADER
26 
27 /*!
28  @file
29  @brief File containing a class for an easy handling of different order time
30  discretizations/extrapolations BDF based specific for the Navier-Stokes problem
31 
32  @date 01-04-2003
33  @author Alessandro Veneziani <ale@mathcs.emory.edu>
34 
35  @contributor Laura Cattaneo
36  @mantainer Laura Cattaneo
37 
38  */
39 
40 #ifndef _BDF_NS_TEMPLATE_H
41 #define _BDF_NS_TEMPLATE_H
42 
43 #include <string>
44 #include <iostream>
45 #include <algorithm>
46 
47 #include <lifev/core/filter/GetPot.hpp>
48 #include <lifev/core/fem/TimeAdvanceBDF.hpp>
49 
50 
51 namespace LifeV
52 {
53 
54 //! \class TimeAdvanceBDFNavierStokes
55 /*!
56  @author Alessandro Veneziani
57  @see Van Kan, Prohl, Guermond
58 
59  This class implements an easy handling of different order time discretizations/extrapolations
60  Bdf based specific for the Navier-Stokes problem.
61 
62  The idea is to couple a Bdf of order q with a pressure incremental approach of order q-1.
63 
64  If q=1, we still have an incremental pressure treatment.
65 
66  At the moment, the couple BDF of order q + extrapolation of order q seems unstable
67 
68  */
69 
70 template<typename VectorType = VectorEpetra >
72 {
73 public:
74 
75 
76  //! @name Public Types
77  //@{
78 
79  typedef VectorType vector_Type;
80 
81  //@}
82 
83 
84  //! @name Constructor & Destructor
85  //@{
86 
87  //! Constructor
89 
90  //! Destructor
92 
93  //@}
94 
95  //! @name Set Methods
96  //@{
97 
98  //! Setup the bdf velocity and the bdf pressure
99  /*!
100  @param order Order q of the bdf
101  */
102  void setup ( const UInt order );
103 
104  //@}
105 
106  //! @name Methods
107  //@{
108 
109  //! Show the contents of the object
110  void showMe() const;
111 
112  //! The method returns the Bdf velocity
113  /*!
114  @return Reference to a new Bdf template which holds the velocity field
115  */
117  {
118  return M_bdfVelocity;
119  }
120 
121  //! The method returns the Bdf pressure
122  /*!
123  @return Reference to a new Bdf template which holds the pressure
124  */
126  {
127  return M_bdfPressure;
128  }
129 
130  //@}
131 
132 private:
133 
134  //! Bdf velocity
136 
137  //! Bdf pressure
139 };
140 
141 
142 // ===================================================
143 // Constructors
144 // ===================================================
145 template<typename VectorType>
147  :
148  M_bdfVelocity( ),
149  M_bdfPressure( )
150 {}
151 
152 
153 template<typename VectorType>
154 void
155 TimeAdvanceBDFNavierStokes<VectorType>::setup ( const UInt order )
156 {
157  M_bdfVelocity.setup ( order, 1 );
158  M_bdfPressure.setup ( std::max ( UInt ( 1 ), order - 1 ), 1 );
159 }
160 
161 // ===================================================
162 // Methods
163 // ===================================================
164 template<typename VectorType>
165 void
166 TimeAdvanceBDFNavierStokes<VectorType>::showMe() const
167 {
168  std::cout << " *** Bdf velocity: " << std::endl;
169  M_bdfVelocity.showMe();
170  std::cout << " *** Bdf pressure: " << std::endl;
171  M_bdfPressure.showMe();
172 }
173 
174 
175 }// Namespace LifeV
176 
177 #endif /* _BDF_NS_TEMPLATE_H */
VectorEpetra - The Epetra Vector format Wrapper.
TimeAdvanceBDF< VectorType > & bdfPressure()
The method returns the Bdf pressure.
void setup(const UInt order)
Setup the bdf velocity and the bdf pressure.
TimeAdvanceBDF< VectorType > M_bdfPressure
Bdf pressure.
TimeAdvanceBDF< VectorType > M_bdfVelocity
Bdf velocity.
TimeAdvanceBDF< VectorType > & bdfVelocity()
The method returns the Bdf velocity.
class TimeAdvanceBDF - Backward differencing formula time discretization for the first and the second...
void showMe() const
Show the contents of the object.
uint32_type UInt
generic unsigned integer (used mainly for addressing)
Definition: LifeV.hpp:191