LifeV
MultiscaleCouplingBoundaryCondition.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 Coupling BoundaryCondition
30  *
31  * @date 02-09-2009
32  * @author Cristiano Malossi <cristiano.malossi@epfl.ch>
33  *
34  * @maintainer Cristiano Malossi <cristiano.malossi@epfl.ch>
35  */
36 
37 #ifndef MultiscaleCouplingBoundaryCondition_H
38 #define MultiscaleCouplingBoundaryCondition_H 1
39 
40 #if defined(LIFEV_HAS_ZERODIMENSIONAL)
41 #include <lifev/bc_interface/0D/bc/BCInterface0D.hpp>
42 #endif
43 
44 #if defined(LIFEV_HAS_ONEDFSI)
45 #include <lifev/bc_interface/1D/bc/BCInterface1D.hpp>
46 #endif
47 
48 #include <lifev/bc_interface/3D/bc/BCInterface3D.hpp>
49 
50 #include <lifev/multiscale/couplings/MultiscaleCoupling.hpp>
51 
52 #if defined(LIFEV_HAS_ZERODIMENSIONAL)
53 #include <lifev/multiscale/models/MultiscaleModelWindkessel0D.hpp>
54 #include <lifev/multiscale/models/MultiscaleModel0D.hpp>
55 #endif
56 
57 #if defined(LIFEV_HAS_ONEDFSI)
58 #include <lifev/multiscale/models/MultiscaleModelFSI1D.hpp>
59 #endif
60 
61 #if defined(LIFEV_HAS_NAVIERSTOKES)
62 #include <lifev/multiscale/models/MultiscaleModelFluid3D.hpp>
63 #endif
64 
65 #if defined(LIFEV_HAS_FSI)
66 #include <lifev/multiscale/models/MultiscaleModelFSI3D.hpp>
67 #endif
68 
69 namespace LifeV
70 {
71 namespace Multiscale
72 {
73 
74 //! MultiscaleCouplingBoundaryCondition - Coupling condition for standard boundary conditions
75 /*!
76  * @author Cristiano Malossi
77  *
78  * @see Full description of the Geometrical Multiscale Framework: \cite Malossi-Thesis
79  * @see Methodology: \cite Malossi2011Algorithms \cite Malossi2011Algorithms1D \cite Malossi2011Algorithms3D1DFSI \cite BlancoMalossi2012
80  * @see Applications: \cite Malossi2011Algorithms3D1DFSIAortaIliac \cite LassilaMalossi2012IdealLeftVentricle \cite BonnemainMalossi2012LVAD
81  *
82  * The MultiscaleCouplingBoundaryCondition class is an implementation of the multiscaleCoupling_Type
83  * for applying standard boundary conditions on the models.
84  */
86 {
87 public:
88 
89  //! @name Constructors & Destructor
90  //@{
91 
92  //! Constructor
94 
95  //! Destructor
97 
98  //@}
99 
100 
101  //! @name Multiscale PhysicalCoupling Implementation
102  //@{
103 
104  //! Setup the data of the coupling
105  /*!
106  * @param fileName Name of data file
107  */
108  void setupData ( const std::string& fileName );
109 
110  //! Setup the coupling variables number.
112 
113  //! Setup the coupling
114  void setupCoupling();
115 
116  //! Initialize the values of the coupling variables (DO NOTHING)
118 
119  //! Update the coupling
120  /*!
121  * Nothing to do for boundary conditions
122  */
123  void updateCoupling() {};
124 
125  //! Compute the local coupling residuals vector
127 
128  //@}
129 
130 private:
131 
132  //! @name Private Multiscale PhysicalCoupling Implementation
133  //@{
134 
135  //! Build the list of models affected by the perturbation of a local coupling variable (DO NOTHING)
136  /*!
137  * @param localCouplingVariableID id of the perturbed local coupling variable
138  * @param perturbedModelsList list of models affected by the perturbation
139  */
140  void exportListOfPerturbedModels ( const UInt& /*localCouplingVariableID*/, multiscaleModelsContainer_Type& /*perturbedModelsList*/ ) {}
141 
142  //! Insert constant coefficients into the Jacobian matrix (DO NOTHING)
143  /*!
144  * @param jacobian the Jacobian matrix
145  */
147 
148  //! Insert the Jacobian coefficient(s) depending on a perturbation of the model, due to a specific variable (the column) (DO NOTHING)
149  /*!
150  * @param jacobian the Jacobian matrix
151  * @param column the column related to the perturbed variable
152  * @param ID the global ID of the model which is perturbed by the variable
153  * @param solveLinearSystem a flag to which determine if the linear system has to be solved
154  */
155  void insertJacobianDeltaCoefficients ( multiscaleMatrix_Type& /*jacobian*/, const UInt& /*column*/, const UInt& /*ID*/, bool& /*solveLinearSystem*/ ) {}
156 
157  //@}
158 
159 
160  //! @name Private Methods
161  //@{
162 
163 #if defined(LIFEV_HAS_ZERODIMENSIONAL)
164  //! Apply the boundary condition to the specific 0D model
165  template< class ModelType >
166  void applyBoundaryConditions0D ( const UInt& i );
167 #endif
168 
169 #if defined(LIFEV_HAS_ONEDFSI)
170  //! Apply the boundary condition to the specific 1D model
171  template< class ModelType >
172  void applyBoundaryConditions1D ( const UInt& i );
173 #endif
174 
175 #if defined(LIFEV_HAS_FSI) || defined(LIFEV_HAS_NAVIERSTOKES)
176  //! Apply the boundary condition to the specific 3D model
177  template< class ModelType >
178  void applyBoundaryConditions3D ( const UInt& i );
179 #endif
180  //@}
181 
182 
183  //! @name Unimplemented Methods
184  //@{
185 
187 
189 
190  //@}
191 
192  std::string M_fileName;
193 
196 };
197 
198 //! Factory create function
200 {
201  return new MultiscaleCouplingBoundaryCondition();
202 }
203 
204 // ===================================================
205 // Template implementation
206 // ===================================================
207 #if defined(LIFEV_HAS_ZERODIMENSIONAL)
208 template< class ModelType >
209 inline void
211 {
214 
215  for ( UInt j ( 0 ); j < M_listSize; ++j )
216  {
217  model->bcInterface().readBC ( M_fileName, "boundary_conditions/", M_list[j] );
218 
220 
222  }
223 }
224 #endif
225 
226 #if defined(LIFEV_HAS_ONEDFSI)
227 template< class ModelType >
228 inline void
230 {
233 
234  for ( UInt j ( 0 ); j < M_listSize; ++j )
235  {
236  model->bcInterface().readBC ( M_fileName, "boundary_conditions/", M_list[j] );
237 
239 
241  }
242 }
243 #endif
244 
245 #if defined(LIFEV_HAS_FSI) || defined(LIFEV_HAS_NAVIERSTOKES)
246 template< class ModelType >
247 inline void
249 {
252 
253  for ( UInt j ( 0 ); j < M_listSize; ++j )
254  {
255  model->bcInterface().readBC ( M_fileName, "boundary_conditions/", M_list[j] );
256 
257  model->bcInterface().dataContainer().setName ( "CouplingBC_Model_" + number2string ( model->ID() ) + "_BoundaryID_" + number2string ( M_boundaryIDs[i] ) + "_" + M_list[j] );
259 
261  }
262 }
263 #endif
264 
265 } // Namespace Multiscale
266 } // Namespace LifeV
267 
268 #endif /* MultiscaleCouplingBoundaryCondition_H */
void insertJacobianDeltaCoefficients(multiscaleMatrix_Type &, const UInt &, const UInt &, bool &)
Insert the Jacobian coefficient(s) depending on a perturbation of the model, due to a specific variab...
void setupCouplingVariablesNumber()
Setup the coupling variables number.
MultiscaleCoupling multiscaleCoupling_Type
void updateInverseJacobian(const UInt &iQuadPt)
void setupData(const std::string &fileName)
Setup the data of the coupling.
void initializeCouplingVariables()
Initialize the values of the coupling variables (DO NOTHING)
MatrixEpetra< Real > multiscaleMatrix_Type
std::vector< multiscaleModelPtr_Type > multiscaleModelsContainer_Type
MultiscaleCouplingBoundaryCondition - Coupling condition for standard boundary conditions.
MultiscaleCouplingBoundaryCondition & operator=(const MultiscaleCouplingBoundaryCondition &coupling)
void exportListOfPerturbedModels(const UInt &, multiscaleModelsContainer_Type &)
Build the list of models affected by the perturbation of a local coupling variable (DO NOTHING) ...
MultiscaleCouplingBoundaryCondition(const MultiscaleCouplingBoundaryCondition &coupling)
multiscaleCoupling_Type * createMultiscaleCouplingBoundaryCondition()
Factory create function.
void computeCouplingResiduals()
Compute the local coupling residuals vector.
uint32_type UInt
generic unsigned integer (used mainly for addressing)
Definition: LifeV.hpp:191
void insertJacobianConstantCoefficients(multiscaleMatrix_Type &)
Insert constant coefficients into the Jacobian matrix (DO NOTHING)