LifeV
BCInterfaceData1D.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 BCInterfaceData1D 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 BCInterfaceData1D_H
38 #define BCInterfaceData1D_H 1
39 
40 // 1D BCHandler include
41 #include <lifev/one_d_fsi/fem/OneDFSIBCHandler.hpp>
42 
43 // BCInterface includes
44 #include <lifev/bc_interface/core/bc/BCInterfaceData.hpp>
45 
46 namespace LifeV
47 {
48 
49 //! BCInterfaceData1D - The BCInterface1D data container
50 /*!
51  * @author Cristiano Malossi
52  *
53  * The BCInterfaceData1D class provides a general container for all the data
54  * required by the 1D boundary conditions.
55  */
56 class BCInterfaceData1D: public virtual BCInterfaceData
57 {
58 public:
59 
60  //! @name Type definitions
61  //@{
62 
65 
66  //@}
67 
68 
69  //! @name Constructors & Destructor
70  //@{
71 
72  //! Constructor
73  explicit BCInterfaceData1D();
74 
75  //! Copy constructor
76  /*!
77  * @param data BCInterfaceData1D
78  */
79  BCInterfaceData1D ( const BCInterfaceData1D& data );
80 
81  //! Destructor
82  virtual ~BCInterfaceData1D() {}
83 
84  //@}
85 
86 
87  //! @name Operators
88  //@{
89 
90  //! Operator =
91  /*!
92  * @param data BCInterfaceData1D
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 side of the boundary condition
124  /*!
125  * @param side Boundary condition side
126  */
127  void setSide ( const OneDFSI::bcSide_Type& side )
128  {
129  M_boundaryID = ( side == OneDFSI::left ) ? 0 : 1;
130  }
131 
132  //! Set the line of the boundary condition
133  /*!
134  * @param line Boundary condition line
135  */
136  void setLine ( const OneDFSI::bcLine_Type& line )
137  {
138  M_line = line;
139  }
140 
141  //! Set the quantity of the boundary condition
142  /*!
143  * @param quantity Boundary condition quantity
144  */
145  void setQuantity ( const OneDFSI::bcType_Type& quantity )
146  {
147  M_quantity = quantity;
148  }
149 
150  //@}
151 
152 
153  //! @name Get Methods
154  //@{
155 
156  //! Get the flag of the boundary condition
157  /*!
158  * @return Boundary condition side
159  */
161  {
162  return ( M_boundaryID == 0 ) ? OneDFSI::left : OneDFSI::right;
163  }
164 
165  //! Get the mode of the boundary condition
166  /*!
167  * @return Boundary condition line
168  */
169  const OneDFSI::bcLine_Type& line() const
170  {
171  return M_line;
172  }
173 
174  //! Get the quantity of the boundary condition
175  /*!
176  * @return Boundary condition quantity
177  */
178  const OneDFSI::bcType_Type& quantity() const
179  {
180  return M_quantity;
181  }
182 
183  //! Get the resistance vector {R1, R2, R3 ...}
184  /*!
185  * @return Boundary condition resistance vector
186  */
188  {
189  return M_resistance;
190  }
191 
192  //! Get the capacitance
193  /*!
194  * @return Boundary condition capacitance
195  */
196  const Real& capacitance() const
197  {
198  return M_capacitance;
199  }
200 
201  //@}
202 
203 private:
204 
205  //! @name Private Methods
206  //@{
207 
208  void readSide ( const GetPot& dataFile, const char* side )
209  {
210  M_boundaryID = ( M_mapSide[dataFile ( side, "left" )] == OneDFSI::left ) ? 0 : 1;
211  }
212 
213  void readLine ( const GetPot& dataFile, const char* line )
214  {
215  M_line = M_mapLine[dataFile ( line, "first" )];
216  }
217 
218  void readQuantity ( const GetPot& dataFile, const char* quantity )
219  {
220  M_quantity = M_mapQuantity[dataFile ( quantity, "A" )];
221  }
222 
223  void readResistance ( const GetPot& dataFile, const char* resistance );
224 
225  void readCapacitance ( const GetPot& dataFile, const char* capacitance )
226  {
227  M_capacitance = dataFile ( capacitance, 0 );
228  }
229 
230  //@}
231 
232 
233  //! @name Private Members
234  //@{
235 
238 
241 
242  // Maps
246 
247  //@}
248 };
249 
250 } // Namespace LifeV
251 
252 #endif /* BCInterfaceData1D_H */
void readLine(const GetPot &dataFile, const char *line)
BCInterfaceData - The BCInterface data container.
virtual ~BCInterfaceData1D()
Destructor.
void readQuantity(const GetPot &dataFile, const char *quantity)
std::map< std::string, OneDFSI::bcSide_Type > M_mapSide
void readCapacitance(const GetPot &dataFile, const char *capacitance)
void setLine(const OneDFSI::bcLine_Type &line)
Set the line of the boundary condition.
OneDFSI::bcLine_Type M_line
void updateInverseJacobian(const UInt &iQuadPt)
void setSide(const OneDFSI::bcSide_Type &side)
Set the side of the boundary condition.
std::vector< Real > resistanceContainer_Type
OneDFSI::bcType_Type M_quantity
BCInterfaceData1D(const BCInterfaceData1D &data)
Copy constructor.
const Real & capacitance() const
Get the capacitance.
void readBC(const std::string &fileName, const std::string &dataSection, const std::string &name)
Read parameters for all kind of BC.
void readSide(const GetPot &dataFile, const char *side)
BCInterfaceData1D - The BCInterface1D data container.
std::map< std::string, OneDFSI::bcLine_Type > M_mapLine
double Real
Generic real data.
Definition: LifeV.hpp:175
void showMe(std::ostream &output=std::cout) const
Display general information about the content of the class.
resistanceContainer_Type M_resistance
std::map< std::string, OneDFSI::bcType_Type > M_mapQuantity
int operator()(const char *VarName, int Default) const
Definition: GetPot.hpp:2021
OneDFSI::bcSide_Type side() const
Get the flag of the boundary condition.
const resistanceContainer_Type & resistance() const
Get the resistance vector {R1, R2, R3 ...}.
BCInterfaceData1D & operator=(const BCInterfaceData1D &data)
Operator =.
void setQuantity(const OneDFSI::bcType_Type &quantity)
Set the quantity of the boundary condition.
BCInterfaceData dataContainer_Type
const OneDFSI::bcType_Type & quantity() const
Get the quantity of the boundary condition.
const OneDFSI::bcLine_Type & line() const
Get the mode of the boundary condition.
void readResistance(const GetPot &dataFile, const char *resistance)