LifeV
ZeroDimensionalData.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 0D model data handling.
30  * @version alpha (experimental)
31  *
32  * @date 16-11-2011
33  * @author Mahmoud Jafargholi
34  *
35  * @contributors Cristiano Malossi <cristiano.malossi@epfl.ch>
36  * @mantainer Cristiano Malossi <cristiano.malossi@epfl.ch>
37  */
38 
39 #ifndef ZeroDimensionalData_H
40 #define ZeroDimensionalData_H
41 
42 // LIFEV
43 #include <lifev/zero_dimensional/solver/ZeroDimensionalCircuitData.hpp>
44 
45 namespace LifeV
46 {
47 
48 //! Data container for 0D model
50 {
51 public:
52 
53  // TODO This should be a separate class and not a struct here
54  //! Rhytmos solver data container
55  struct SolverData
56  {
57  std::string method;
63  bool verbose;
65  bool useNOX;
67  std::string extraLSParamsFile;
69  };
70 
71  typedef struct SolverData solverData_Type;
74 
75  // TODO: this is a temporary typedef, to be removed in the future
77 
78  //! Constructor
79  explicit ZeroDimensionalData();
80 
81  //! Destructor
82  virtual ~ZeroDimensionalData();
83 
84  //! setup model
85  void setup ( const GetPot& dataFile, bcPtr_Type bc, const std::string& section = "0D_Model" );
86 
87  //! initialize Solution
88  void initializeSolution() ;
89 
90  //! update source elements
91  void updateBC();
92 
93  //! save solution
94  void saveSolution() ;
95 
96  //! show some information
97  void showMe() const
98  {
99  M_circuitData->showMe();
100  }
101 
102  //! show variables
103  void showMeVariables() ;
104 
105  //! set time
106  void setTimeData ( const timePtr_Type& timeData )
107  {
108  M_time = timeData;
109  }
110 
111  const timePtr_Type& dataTime() const
112  {
113  return M_time;
114  }
115 
116  //! get circuit data container
118  {
119  return M_circuitData;
120  }
121 
122  //!total number of unknowns
123  const Int& unknownCounter() const
124  {
125  return M_unknownCounter;
126  }
127 
129  {
130  return M_solverData;
131  }
132 
133  //! Set the fluid venous pressure.
134  /*!
135  * @param venous pressure of the fluid.
136  */
137  void setVenousPressure ( const Real& venousPressure )
138  {
139  M_venousPressure = venousPressure;
140  }
141 
142  //! Get the fluid venous pressure.
143  /*!
144  * @return venous pressure of the fluid.
145  */
146  const Real& venousPressure() const
147  {
148  return M_venousPressure;
149  }
150 
151 private:
152 
153  // TODO: The output part should be rewritten following the example in the OneDFSI solver
154  void writeHeaders();
155 
156  void assignVaribleIndex();
157 
161  std::ofstream M_voltageFileStream;
162  std::ofstream M_currentFileStream;
163  std::ofstream M_balanceFileStream;
166 
168 };
169 
170 } // LifeV namespace
171 
172 #endif //ZeroDimensionalData_H
virtual ~ZeroDimensionalData()
Destructor.
void updateBC()
update source elements
const solverData_Type & solverData() const
void setTimeData(const timePtr_Type &timeData)
set time
OutPutFormat - Write to output.
int32_type Int
Generic integer data.
Definition: LifeV.hpp:188
void saveSolution()
save solution
const Real & venousPressure() const
Get the fluid venous pressure.
const Int & unknownCounter() const
total number of unknowns
void updateInverseJacobian(const UInt &iQuadPt)
Rhytmos solver data container.
const timePtr_Type & dataTime() const
zeroDimensionalCircuitDataPtr_Type M_circuitData
void setVenousPressure(const Real &venousPressure)
Set the fluid venous pressure.
zeroDimensionalCircuitDataPtr_Type circuitData() const
get circuit data container
double Real
Generic real data.
Definition: LifeV.hpp:175
void initializeSolution()
initialize Solution
void showMeVariables()
show variables
Data container for 0D model.
void showMe() const
show some information
std::shared_ptr< Real > solutionPtr_Type
std::shared_ptr< time_Type > timePtr_Type
void setup(const GetPot &dataFile, bcPtr_Type bc, const std::string &section="0D_Model")
setup model
std::shared_ptr< ZeroDimensionalCircuitData > zeroDimensionalCircuitDataPtr_Type
TimeData - Class for handling temporal discretization.
Definition: TimeData.hpp:61