LifeV
MultiscaleCouplingBoundaryCondition.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 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 #include <lifev/multiscale/couplings/MultiscaleCouplingBoundaryCondition.hpp>
38 
39 namespace LifeV
40 {
41 namespace Multiscale
42 {
43 
44 // ===================================================
45 // Constructors & Destructor
46 // ===================================================
49  M_fileName (),
50  M_list (),
51  M_listSize ()
52 {
53 
54 #ifdef HAVE_LIFEV_DEBUG
55  debugStream ( 8210 ) << "MultiscaleCouplingBoundaryCondition::MultiscaleCouplingBoundaryCondition() \n";
56 #endif
57 
59 }
60 
61 // ===================================================
62 // Multiscale PhysicalCoupling Implementation
63 // ===================================================
64 void
65 MultiscaleCouplingBoundaryCondition::setupData ( const std::string& fileName )
66 {
67 
68 #ifdef HAVE_LIFEV_DEBUG
69  debugStream ( 8210 ) << "MultiscaleCouplingBoundaryCondition::setupData() \n";
70 #endif
71 
72  multiscaleCoupling_Type::setupData ( fileName );
73 
74  if ( modelsNumber() > 0 )
75  {
76  M_fileName = fileName;
77  GetPot dataFile ( fileName );
78 
79  //Load the list of boundary conditions
80  M_listSize = dataFile.vector_variable_size ( "boundary_conditions/list" );
81 
82  M_list.reserve ( M_listSize );
83  for ( UInt i ( 0 ); i < M_listSize; ++i )
84  {
85  M_list.push_back ( dataFile ( "boundary_conditions/list", " ", i ) );
86  }
87  }
88 }
89 
90 void
92 {
93 
94 #ifdef HAVE_LIFEV_DEBUG
95  debugStream ( 8210 ) << "MultiscaleCouplingBoundaryCondition::setupCouplingVariablesNumber() \n";
96 #endif
97 
99 }
100 
101 void
103 {
104 
105 #ifdef HAVE_LIFEV_DEBUG
106  debugStream ( 8210 ) << "MultiscaleCouplingBoundaryCondition::setupCoupling() \n";
107 #endif
108 
109  if ( myModelsNumber() > 0 )
110  {
111  // Impose boundary conditions on all the models
112  for ( UInt i ( 0 ); i < modelsNumber(); ++i )
113  if ( myModel ( i ) )
114  switch ( M_models[i]->type() )
115  {
116 #if defined(LIFEV_HAS_ZERODIMENSIONAL)
117  case Windkessel0D:
118 
119  applyBoundaryConditions0D< MultiscaleModelWindkessel0D > ( i );
120 
121  break;
122 
123  case ZeroDimensional:
124 
125  applyBoundaryConditions0D< MultiscaleModel0D > ( i );
126 
127  break;
128 #endif
129 #if defined(LIFEV_HAS_ONEDFSI)
130  case FSI1D:
131 
132  applyBoundaryConditions1D< MultiscaleModelFSI1D > ( i );
133 
134  break;
135 #endif
136 #if defined(LIFEV_HAS_NAVIERSTOKES)
137  case Fluid3D:
138 
139  applyBoundaryConditions3D< MultiscaleModelFluid3D > ( i );
140 
141  break;
142 #endif
143 #if defined(LIFEV_HAS_FSI)
144  case FSI3D:
145 
146  applyBoundaryConditions3D< MultiscaleModelFSI3D > ( i );
147 
148  break;
149 #endif
150  default:
151 
152  switchErrorMessage ( M_models[i] );
153 
154  break;
155  }
156  }
157 }
158 
159 } // Namespace Multiscale
160 } // Namespace LifeV
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.
MultiscaleCouplingBoundaryCondition - Coupling condition for standard boundary conditions.
uint32_type UInt
generic unsigned integer (used mainly for addressing)
Definition: LifeV.hpp:191