LifeV
TimeAdvanceData.cpp
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 handling temporal discretization.
30 
31  @author Cristiano Malossi <cristiano.malossi@epfl.ch>
32  @date 11-06-2012
33 
34  @contributor Matteo Pozzoli <matteo1.pozzoli@mail.polimi.it>
35  @maintainer Matteo Pozzoli <matteo1.pozzoli@mail.polimi.it>
36  */
37 #include <lifev/core/fem/TimeAdvanceData.hpp>
38 
39 namespace LifeV
40 {
41 
42 // ===================================================
43 // Constructors & Destructor
44 // ===================================================
46  M_orderBDF ( 1 ),
47  M_theta ( 0.25 ),
48  M_gamma ( 0.5 )
49 {
50 }
51 
52 TimeAdvanceData::TimeAdvanceData ( const GetPot& dataFile, const std::string& section )
53 {
54  setup ( dataFile, section );
55 }
56 
58 {
59  M_orderBDF = timeData.M_orderBDF;
60  M_theta = timeData.M_theta;
61  M_gamma = timeData.M_gamma;
62 }
63 
64 // ===================================================
65 // Methods
66 // ===================================================
67 void
68 TimeAdvanceData::setup ( const GetPot& dataFile, const std::string& section )
69 {
70  M_orderBDF = dataFile ( ( section + "/BDF_order" ).data(), 1 );
71  M_theta = dataFile ( (section + "/theta").data(), 0.25);
72  M_gamma = dataFile ( ( section + "/gamma").data(), 0.5);
73 }
74 
75 void
76 TimeAdvanceData::showMe ( std::ostream& output ) const
77 {
78  output << "\n*** TimeAdvanceData: values for user-defined data\n";
79 
80  output << "\n[/time_discretization]" << std::endl;
81  output << "BDF order = " << M_orderBDF << std::endl;
82  output << "theta = " << M_theta << std::endl;
83  output << "gamma = " << M_gamma << std::endl;
84 }
85 
86 // ===================================================
87 // Get Methods
88 // ===================================================
89 std::vector<Real>
91 {
92  std::vector<Real> coefficients;
93 
94  coefficients.push_back ( M_theta );
95  coefficients.push_back ( M_gamma );
96 
97  return coefficients;
98 }
99 
100 }
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)
void showMe(std::ostream &output=std::cout) const
Display general information about the content of the class.
TimeAdvanceData(const TimeAdvanceData &TimeAdvanceData)
Copy constructor.
TimeAdvanceData(const GetPot &dataFile, const std::string &section="time_discretization")
Constructor.