LifeV
BCInterfaceData0D.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 BCInterfaceData0D 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 BCInterfaceData0D_H
38 #define BCInterfaceData0D_H 1
39 
40 // 0D BCHandler include
41 #include <lifev/zero_dimensional/fem/ZeroDimensionalBCHandler.hpp>
42 
43 // BCInterface includes
44 #include <lifev/bc_interface/core/bc/BCInterfaceData.hpp>
45 
46 namespace LifeV
47 {
48 
49 //! BCInterfaceData0D - The BCInterface1D data container
50 /*!
51  * @author Cristiano Malossi
52  *
53  * The BCInterfaceData0D class provides a general container for all the data
54  * required by the 0D boundary conditions.
55  */
56 class BCInterfaceData0D: public virtual BCInterfaceData
57 {
58 public:
59 
60  //! @name Type definitions
61  //@{
62 
64  typedef ZeroDimensionalBCHandler::bcType_Type bcType_Type;
65 
66  //@}
67 
68 
69  //! @name Constructors & Destructor
70  //@{
71 
72  //! Constructor
73  explicit BCInterfaceData0D();
74 
75  //! Copy constructor
76  /*!
77  * @param data BCInterfaceData0D
78  */
79  BCInterfaceData0D ( const BCInterfaceData0D& data );
80 
81  //! Destructor
82  virtual ~BCInterfaceData0D() {}
83 
84  //@}
85 
86 
87  //! @name Operators
88  //@{
89 
90  //! Operator =
91  /*!
92  * @param data BCInterfaceData0D
93  * @return reference to a copy of the class
94  */
96 
97  //@}
98 
99 
100  //! @name Methods
101  //@{
102 
103  //! Read parameters for all kind of BC
104  /*!
105  * @param fileName Name of the data file.
106  * @param dataSection BC section
107  * @param name name of the boundary condition
108  */
109  void readBC ( const std::string& fileName, const std::string& dataSection, const std::string& name );
110 
111  //! Display general information about the content of the class
112  /*!
113  * @param output specify the output format (std::cout by default)
114  */
115  void showMe ( std::ostream& output = std::cout ) const;
116 
117  //@}
118 
119 
120  //! @name Set Methods
121  //@{
122 
123  //! Set the flag of the boundary condition
124  /*!
125  * @param flag Boundary condition flag
126  */
127  void setFlag ( const bcFlag_Type& flag )
128  {
129  M_boundaryID = flag;
130  }
131 
132  //! Set the type of the boundary condition
133  /*!
134  * @param type Boundary condition type
135  */
136  void setType ( const bcType_Type& type )
137  {
138  M_type = type;
139  }
140 
141  //@}
142 
143 
144  //! @name Get Methods
145  //@{
146 
147  //! Get the flag of the boundary condition
148  /*!
149  * @return Boundary condition flag
150  */
151  const bcFlag_Type& flag() const
152  {
153  return M_boundaryID;
154  }
155 
156  //! Get the type of the boundary condition
157  /*!
158  * @return Boundary condition type
159  */
160  const bcType_Type& type() const
161  {
162  return M_type;
163  }
164 
165  //@}
166 
167 private:
168 
169  //! @name Private Methods
170  //@{
171 
172  void readFlag ( const GetPot& dataFile, const char* flag )
173  {
174  M_boundaryID = dataFile ( flag, 0 );
175  }
176 
177  void readType ( const GetPot& dataFile, const char* type )
178  {
179  M_type = M_mapType[dataFile ( type, "Current" )];
180  }
181 
182  //@}
183 
184 
185  //! @name Private Members
186  //@{
187 
188 
189  bcType_Type M_type;
190 
191 
192  // Maps
194 
195  //@}
196 };
197 
198 } // Namespace LifeV
199 
200 #endif /* BCInterfaceData0D_H */
BCInterfaceData0D & operator=(const BCInterfaceData0D &data)
Operator =.
std::map< std::string, bcType_Type > M_mapType
markerID_Type bcFlag_Type
Definition: BCBase.hpp:118
BCInterfaceData - The BCInterface data container.
void showMe(std::ostream &output=std::cout) const
Display general information about the content of the class.
BCInterfaceData0D - The BCInterface1D data container.
ZeroDimensionalBCHandler - A boundary conditions handler for zero-dimensional models.
BCInterfaceData dataContainer_Type
const bcFlag_Type & flag() const
Get the flag of the boundary condition.
virtual ~BCInterfaceData0D()
Destructor.
void updateInverseJacobian(const UInt &iQuadPt)
const bcType_Type & type() const
Get the type of the boundary condition.
void readFlag(const GetPot &dataFile, const char *flag)
void readBC(const std::string &fileName, const std::string &dataSection, const std::string &name)
Read parameters for all kind of BC.
int operator()(const char *VarName, int Default) const
Definition: GetPot.hpp:2021
BCInterfaceData0D(const BCInterfaceData0D &data)
Copy constructor.
void setType(const bcType_Type &type)
Set the type of the boundary condition.
void setFlag(const bcFlag_Type &flag)
Set the flag of the boundary condition.
void readType(const GetPot &dataFile, const char *type)