LifeV
TimeAdvanceData.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 
26 //@HEADER
27 
28 /*!
29  @file
30  @brief File containing a class for handling temporal discretization.
31 
32  @author Cristiano Malossi <cristiano.malossi@epfl.ch>
33  @date 11-06-2012
34 
35  @contributor Matteo Pozzoli <matteo1.pozzoli@mail.polimi.it>
36  @maintainer Matteo Pozzoli <matteo1.pozzoli@mail.polimi.it>
37  */
38 
39 #ifndef TimeAdvanceData_H
40 #define TimeAdvanceData_H 1
41 
42 #include <ostream>
43 #include <lifev/core/filter/GetPot.hpp>
44 #include <lifev/core/LifeV.hpp>
45 
46 namespace LifeV
47 {
48 
49 //! TimeAdvanceData - Class for handling temporal discretization.
50 /*!
51  * @author Cristiano Malossi
52  *
53  * The class is a data container for the time discretization.
54  */
56 {
57 public:
58 
59  //! @name Constructors & Destructor
60  //@{
61 
62  //! Empty Constructor
64 
65  //! Constructor
66  /*!
67  * @param dataFile GetPot data file
68  * @param section the section on the data file that contains the information on the time discretization
69  */
70  TimeAdvanceData ( const GetPot& dataFile, const std::string& section = "time_discretization" );
71 
72  //! Copy constructor
73  /*!
74  * @param TimeAdvanceData - TimeAdvanceData class
75  */
76  TimeAdvanceData ( const TimeAdvanceData& TimeAdvanceData);
77 
78  //! Virtual destructor
79  virtual ~TimeAdvanceData() {}
80 
81  //@}
82 
83 
84  //! @name Methods
85  //@{
86 
87  //! Read the dataFile and set all the internal quantities
88  /*!
89  * @param dataFile data file
90  * @param section section of the file
91  */
92  void setup ( const GetPot& dfile, const std::string& section = "time_discretization" );
93 
94  //! Display general information about the content of the class
95  /*!
96  @param output - specify the output format (std::cout by default)
97  */
98  void showMe ( std::ostream& output = std::cout ) const;
99 
100  //@}
101 
102 
103  //! @name Set Methods
104  //@{
105 
106  //! Set the BDF odert to use
107  /*!
108  * @param order BDF order
109  */
110  void setOrderBDF ( const UInt& orderBDF )
111  {
112  M_orderBDF = orderBDF;
113  }
114 
115  //! Set the theta of TimeAdvanceNewmark scheme
116  /*!
117  * @param theta - coefficient of TimeAdvanceNewmark scheme
118  */
119  void setTheta ( const Real& theta )
120  {
121  M_theta = theta;
122  }
123 
124  //! Set the theta of TimeAdvanceNewmark scheme
125  /*!
126  * @param gamma- coefficient of TimeAdvanceNewmark scheme
127  */
128  void setGamma ( const Real& gamma )
129  {
130  M_gamma = gamma;
131  }
132 
133  //@}
134 
135 
136  //! @name Get Methods
137  //@{
138 
139  //! Get the BDF order used
140  /*!
141  * @return BDF order value
142  */
143  const UInt& orderBDF() const
144  {
145  return M_orderBDF;
146  }
147 
148  //! Return theta parameter of TimeAdvanceNewmark scheme
149  /*!
150  * @return theta value
151  */
152  const Real& theta() const
153  {
154  return M_theta;
155  }
156 
157  //! Return gamma of TimeAdvanceNewmark scheme
158  /*!
159  * @return gamma value
160  */
161  const Real& gamma() const
162  {
163  return M_gamma;
164  }
165 
166  //! Return TimeAdvanceNewmark parameters (\f$theta\f$, \f$\gamma\f$)
167  /*!
168  * @return TimeAdvanceNewmark parameters (\f$theta\f$, \f$\gamma\f$)
169  */
171 
172  //@}
173 
174 private:
175 
176  UInt M_orderBDF; // order of the time discretization formula
177  Real M_theta; // TimeAdvanceNewmark parameter
178  Real M_gamma; // TimeAdvanceNewmark parameter
179 };
180 
181 } // namespace LifeV
182 
183 #endif // TimeAdvanceData_H
void setup(const GetPot &dfile, const std::string &section="time_discretization")
Read the dataFile and set all the internal quantities.
std::vector< Real > coefficientsNewmark()
Return TimeAdvanceNewmark parameters ( , )
TimeAdvanceData()
Empty Constructor.
TimeAdvanceData - Class for handling temporal discretization.
void updateInverseJacobian(const UInt &iQuadPt)
const Real & gamma() const
Return gamma of TimeAdvanceNewmark scheme.
const Real & theta() const
Return theta parameter of TimeAdvanceNewmark scheme.
const UInt & orderBDF() const
Get the BDF order used.
void showMe(std::ostream &output=std::cout) const
Display general information about the content of the class.
TimeAdvanceData(const TimeAdvanceData &TimeAdvanceData)
Copy constructor.
double Real
Generic real data.
Definition: LifeV.hpp:175
TimeAdvanceData(const GetPot &dataFile, const std::string &section="time_discretization")
Constructor.
void setOrderBDF(const UInt &orderBDF)
Set the BDF odert to use.
void setTheta(const Real &theta)
Set the theta of TimeAdvanceNewmark scheme.
virtual ~TimeAdvanceData()
Virtual destructor.
uint32_type UInt
generic unsigned integer (used mainly for addressing)
Definition: LifeV.hpp:191
void setGamma(const Real &gamma)
Set the theta of TimeAdvanceNewmark scheme.