LifeV
BCInterfaceData3D.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 BCInterfaceData3D class
30  *
31  * @date 17-07-2009
32  * @author Cristiano Malossi <cristiano.malossi@epfl.ch>
33  *
34  * @maintainer Cristiano Malossi <cristiano.malossi@epfl.ch>
35  */
36 
37 #ifndef BCInterfaceData3D_H
38 #define BCInterfaceData3D_H 1
39 
40 // 3D BCHandler include
41 #include <lifev/core/fem/BCHandler.hpp>
42 
43 // Data interpolator include
44 #include <lifev/core/fem/BCDataInterpolator.hpp>
45 
46 // BCInterface includes
47 #include <lifev/bc_interface/core/bc/BCInterfaceData.hpp>
48 
49 namespace LifeV
50 {
51 
52 //! BCInterfaceData3D - The BCInterface3D data container
53 /*!
54  * @author Cristiano Malossi
55  *
56  * The BCInterfaceData3D class provides a general container for all the data
57  * required by the 3D boundary conditions.
58  */
59 class BCInterfaceData3D: public virtual BCInterfaceData
60 {
61 public:
62 
63  //! @name Type definitions
64  //@{
65 
67 
68  //@}
69 
70 
71  //! @name Constructors & Destructor
72  //@{
73 
74  //! Constructor
75  explicit BCInterfaceData3D();
76 
77  //! Copy constructor
78  /*!
79  * @param data BCInterfaceData3D
80  */
81  BCInterfaceData3D ( const BCInterfaceData3D& data );
82 
83  //! Destructor
84  virtual ~BCInterfaceData3D() {}
85 
86  //@}
87 
88 
89  //! @name Operators
90  //@{
91 
92  //! Operator =
93  /*!
94  * @param data BCInterfaceData3D
95  * @return reference to a copy of the class
96  */
98 
99  //@}
100 
101 
102  //! @name Methods
103  //@{
104 
105  //! Read parameters for all kind of BC
106  /*!
107  * @param fileName Name of the data file.
108  * @param dataSection BC section
109  * @param name name of the boundary condition
110  */
111  void readBC ( const std::string& fileName, const std::string& dataSection, const std::string& name );
112 
113  //! Set the directional base as the current base
115  {
116  M_base = M_baseDirectional;
118  }
119 
120  //! Set the Robin Alpha base as the current base
122  {
123  M_base = M_baseRobinAlpha;
125  }
126 
127  //! Set the Robin Beta base as the current base
129  {
130  M_base = M_baseRobinBeta;
132  }
133 
134  //! Display general information about the content of the class
135  /*!
136  * @param output specify the output format (std::cout by default)
137  */
138  void showMe ( std::ostream& output = std::cout ) const;
139 
140  //@}
141 
142 
143  //! @name Set Methods
144  //@{
145 
146  //! Set the name of the boundary condition
147  /*!
148  * @param name Boundary condition name
149  */
150  void setName ( const bcName_Type& name )
151  {
152  M_name = name;
153  }
154 
155  //! Set the flag of the boundary condition
156  /*!
157  * @param flag Boundary condition flag
158  */
159  void setFlag ( const bcFlag_Type& flag )
160  {
161  M_boundaryID = flag;
162  }
163 
164  //! Set the type of the boundary condition
165  /*!
166  * @param type Boundary condition type
167  */
168  void setType ( const bcType_Type& type )
169  {
170  M_type = type;
171  }
172 
173  //! Set the mode of the boundary condition
174  /*!
175  * @param mode Boundary condition mode
176  */
177  void setMode ( const bcMode_Type& mode )
178  {
179  M_mode = mode;
180  }
181 
182  //! Set the components vector of the boundary condition
183  /*!
184  * @param componentsVector Boundary condition components vector
185  */
186  void setComponentsVector ( const bcComponentsVec_Type& componentsVector )
187  {
188  M_componentsVector = componentsVector;
189  }
190 
191  //! Set the i-component of the components vector of the boundary condition
192  /*!
193  * @param componentsVector Boundary condition component
194  * @param index Index value
195  */
196  void setComponentsVector ( const UInt& componentsVector, const UInt& index )
197  {
198  M_componentsVector[index] = componentsVector;
199  }
200 
201  //! Add a component to the component vector of the boundary condition
202  /*!
203  * @param componentsVector Boundary condition component
204  */
205  void addComponentsVector ( const UInt& componentsVector )
206  {
207  M_componentsVector.push_back ( componentsVector );
208  }
209 
210  //@}
211 
212 
213  //! @name Get Methods
214  //@{
215 
216  //! Get the name of the boundary condition
217  /*!
218  * @return Boundary condition name
219  */
220  const bcName_Type& name() const
221  {
222  return M_name;
223  }
224 
225  //! Get the flag of the boundary condition
226  /*!
227  * @return Boundary condition flag
228  */
229  const bcFlag_Type& flag() const
230  {
231  return M_boundaryID;
232  }
233 
234  //! Get the type of the boundary condition
235  /*!
236  * @return Boundary condition type
237  */
238  const bcType_Type& type() const
239  {
240  return M_type;
241  }
242 
243  //! Get the mode of the boundary condition
244  /*!
245  * @return Boundary condition mode
246  */
247  const bcMode_Type& mode() const
248  {
249  return M_mode;
250  }
251 
252  //! Get the vector of components of the boundary condition
253  /*!
254  * @return Boundary condition vector of components
255  */
257  {
258  return M_componentsVector;
259  }
260 
261  //! Get the number of components of the boundary condition
262  /*!
263  * Note that this method should not be called for the case of "Component" boundary conditions,
264  * since it does not return the size of the M_componentsVector. It has to be used only for the case
265  * of "Full" boundary conditions.
266  *
267  * @return Number of components of the boundary condition
268  */
269  const ID& componentsNumber() const
270  {
271  return M_componentsVector.front();
272  }
273 
274  //@}
275 
276 private:
277 
278  //! @name Private Methods
279  //@{
280 
281  void readFlag ( const GetPot& dataFile, const char* flag )
282  {
283  M_boundaryID = dataFile ( flag, 0 );
284  }
285 
286  void readType ( const GetPot& dataFile, const char* type )
287  {
288  M_type = M_mapType[dataFile ( type, "Essential" )];
289  }
290 
291  void readMode ( const GetPot& dataFile, const char* mode )
292  {
293  M_mode = M_mapMode[dataFile ( mode, "Full" )];
294  }
295 
296  void readComponentsVector ( const GetPot& dataFile, const char* component );
297 
298  //@}
299 
300 
301  //! @name Private Members
302  //@{
303 
304  std::pair< std::string, baseList_Type > M_baseRobinAlpha;
306 
307  std::pair< std::string, baseList_Type > M_baseRobinBeta;
309 
310  std::pair< std::string, baseList_Type > M_baseDirectional;
312 
317 
318  // Maps
321 
322  //@}
323 };
324 
325 } // Namespace LifeV
326 
327 #endif /* BCInterfaceData3D_H */
const bcMode_Type & mode() const
Get the mode of the boundary condition.
markerID_Type bcFlag_Type
Definition: BCBase.hpp:118
BCInterfaceData - The BCInterface data container.
void setComponentsVector(const UInt &componentsVector, const UInt &index)
Set the i-component of the components vector of the boundary condition.
bcMode_Type
Definition: BCBase.hpp:102
void readBC(const std::string &fileName, const std::string &dataSection, const std::string &name)
Read parameters for all kind of BC.
void setType(const bcType_Type &type)
Set the type of the boundary condition.
void setComponentsVector(const bcComponentsVec_Type &componentsVector)
Set the components vector of the boundary condition.
void updateInverseJacobian(const UInt &iQuadPt)
void setName(const bcName_Type &name)
Set the name of the boundary condition.
std::pair< std::string, baseList_Type > M_baseDirectional
void setFlag(const bcFlag_Type &flag)
Set the flag of the boundary condition.
void readType(const GetPot &dataFile, const char *type)
std::pair< std::string, baseList_Type > M_baseRobinBeta
std::vector< ID > bcComponentsVec_Type
Definition: BCBase.hpp:120
uint32_type ID
IDs.
Definition: LifeV.hpp:194
void setRobinBaseAlpha()
Set the Robin Alpha base as the current base.
bcComponentsVec_Type M_componentsVector
BCInterfaceData3D - The BCInterface3D data container.
void setMode(const bcMode_Type &mode)
Set the mode of the boundary condition.
std::string bcName_Type
Definition: BCBase.hpp:116
void readComponentsVector(const GetPot &dataFile, const char *component)
std::pair< std::string, baseList_Type > M_baseRobinAlpha
void showMe(std::ostream &output=std::cout) const
Display general information about the content of the class.
const bcComponentsVec_Type & componentsVector() const
Get the vector of components of the boundary condition.
const bcName_Type & name() const
Get the name of the boundary condition.
std::map< std::string, bcType_Type > M_mapType
void readMode(const GetPot &dataFile, const char *mode)
void setDirectionalBase()
Set the directional base as the current base.
BCInterfaceData3D(const BCInterfaceData3D &data)
Copy constructor.
int operator()(const char *VarName, int Default) const
Definition: GetPot.hpp:2021
bcType_Type
Definition: BCBase.hpp:88
BCInterfaceData dataContainer_Type
const bcFlag_Type & flag() const
Get the flag of the boundary condition.
void setRobinBaseBeta()
Set the Robin Beta base as the current base.
const ID & componentsNumber() const
Get the number of components of the boundary condition.
virtual ~BCInterfaceData3D()
Destructor.
BCInterfaceData3D & operator=(const BCInterfaceData3D &data)
Operator =.
const bcType_Type & type() const
Get the type of the boundary condition.
std::map< std::string, bcMode_Type > M_mapMode
void readFlag(const GetPot &dataFile, const char *flag)
uint32_type UInt
generic unsigned integer (used mainly for addressing)
Definition: LifeV.hpp:191
void addComponentsVector(const UInt &componentsVector)
Add a component to the component vector of the boundary condition.