LifeV
MultiscaleModel0D.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 the Multiscale Model 0D
30  *
31  * @version 1.0
32  * @date 01-10-2011
33  * @author Mahmoud Jafargholi <mahmoud.jafargholi@epfl.ch>
34  *
35  * @contributors Cristiano Malossi <cristiano.malossi@epfl.ch>
36  * @mantainer Cristiano Malossi <cristiano.malossi@epfl.ch>
37  */
38 
39 #ifndef MultiscaleModel0D_H
40 #define MultiscaleModel0D_H 1
41 
42 #include <lifev/bc_interface/0D/bc/BCInterface0D.hpp>
43 #include <lifev/zero_dimensional/solver/ZeroDimensionalData.hpp>
44 #include <lifev/zero_dimensional/solver/ZeroDimensionalSolver.hpp>
45 
46 #include <lifev/multiscale/models/MultiscaleModel.hpp>
47 
48 namespace LifeV
49 {
50 namespace Multiscale
51 {
52 
53 //! MultiscaleModel0D - Multiscale model for 0D simulations
54 /*!
55  * @author Mahmoud Jafargholi
56  *
57  * @see Full description of the Geometrical Multiscale Framework: \cite Malossi-Thesis
58  * @see Methodology: \cite Malossi2011Algorithms \cite Malossi2011Algorithms1D \cite Malossi2011Algorithms3D1DFSI \cite BlancoMalossi2012
59  * @see Applications: \cite Malossi2011Algorithms3D1DFSIAortaIliac \cite LassilaMalossi2012IdealLeftVentricle \cite BonnemainMalossi2012LVAD
60  *
61  * The MultiscaleModel0D class is an implementation of the multiscaleModel_Type
62  * for 0D problems.
63  */
64 
66 {
67 public:
68 
69  //! @name Type definitions
70  //@{
71 
76 
81 
82  //@}
83 
84 
85  //! @name Constructors & Destructor
86  //@{
87 
88  //! Constructor
89  explicit MultiscaleModel0D();
90 
91  //! Destructor
92  virtual ~MultiscaleModel0D() {}
93 
94  //@}
95 
96 
97  //! @name MultiscaleModel Methods
98  //@{
99 
100  //! Setup the data of the model.
101  /*!
102  * @param fileName Name of data file.
103  */
104  void setupData ( const std::string& fileName );
105 
106  //! Setup the model.
107  void setupModel();
108 
109  //! Build the initial model.
110  void buildModel();
111 
112  //! Update the model.
113  void updateModel();
114 
115  //! Solve the model.
116  void solveModel();
117 
118  //! Update the solution.
119  void updateSolution();
120 
121  //! Save the solution
122  void saveSolution();
123 
124  //! Display some information about the model.
125  void showMe();
126 
127  //! Return a specific scalar quantity to be used for a comparison with a reference value.
128  /*!
129  * This method is meant to be used for night checks.
130  * @return reference quantity.
131  */
132  Real checkSolution() const;
133 
134  //@}
135 
136 
137  //! @name MultiscaleInterface Methods
138  //@{
139 
140  //TODO These methods should be implemented after deriving from MultiscaleInterface
141 
142  //@}
143 
144 
145  //! @name Get Methods
146  //@{
147 
148  //! Get the BCInterface container of the boundary conditions of the model
149  /*!
150  * @return BCInterface container
151  */
153  {
154  return *M_bc;
155  }
156 
157  //! Get the data container of the model
158  /*!
159  * @return data container
160  */
161  data_Type& data() const
162  {
163  return *M_data;
164  }
165 
166  //! Get the solver of the model
167  /*!
168  * @return solver
169  */
171  {
172  return *M_solver;
173  }
174 
175  //@}
176 
177 private:
178 
179  //! @name Private Methods
180  //@{
181 
182  //! Setup the global data of the model.
183  /*!
184  * In particular, it replaces the default local values with the ones in the global container.
185  * If a value is already specified in the data file, do not perform the replacement.
186  *
187  * @param fileName File name of the specific model.
188  */
189  void setupGlobalData ( const std::string& fileName );
190 
191  //@}
192 
193 
197 };
198 
199 //! Factory create function
201 {
202  return new MultiscaleModel0D();
203 }
204 
205 } // Namespace Multiscale
206 } // Namespace LifeV
207 
208 #endif /* MultiscaleModel0D_H */
multiscaleModel_Type * createMultiscaleModelZeroDimensional()
Factory create function.
void setupGlobalData(const std::string &fileName)
Setup the global data of the model.
std::shared_ptr< data_Type > dataPtr_Type
ZeroDimensionalBCHandler - A boundary conditions handler for zero-dimensional models.
void updateInverseJacobian(const UInt &iQuadPt)
std::shared_ptr< bcInterface_Type > bcInterfacePtr_Type
void setupData(const std::string &fileName)
Setup the data of the model.
void showMe()
Display some information about the model.
MultiscaleModel0D - Multiscale model for 0D simulations.
bcInterface_Type & bcInterface()
Get the BCInterface container of the boundary conditions of the model.
std::shared_ptr< bc_Type > bcPtr_Type
MultiscaleModel multiscaleModel_Type
data_Type & data() const
Get the data container of the model.
BCInterface0D< bc_Type, data_Type > bcInterface_Type
std::shared_ptr< solver_Type > solverPtr_Type
double Real
Generic real data.
Definition: LifeV.hpp:175
BCInterface0D - LifeV interface to load boundary conditions for 0D problems completely from a GetPot ...
Data container for 0D model.
void saveSolution()
Save the solution.
void updateSolution()
Update the solution.
Real checkSolution() const
Return a specific scalar quantity to be used for a comparison with a reference value.
void buildModel()
Build the initial model.
solver_Type & solver() const
Get the solver of the model.