LifeV
BCInterfaceData.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 BCInterfaceData 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 BCInterfaceData_H
38 #define BCInterfaceData_H 1
39 
40 #include <lifev/bc_interface/core/bc/BCInterfaceDefinitions.hpp>
41 
42 namespace LifeV
43 {
44 
45 //! BCInterfaceData - The BCInterface data container
46 /*!
47  * @author Cristiano Malossi
48  *
49  * The BCInterfaceData class provides a general interface for the data container in order to pass information
50  * to all the BCInterface classes.
51  */
53 {
54 public:
55 
56  //! @name Type definitions
57  //@{
58 
60 
61  //@}
62 
63 
64  //! @name Constructors & Destructor
65  //@{
66 
67  //! Constructor
68  explicit BCInterfaceData();
69 
70  //! Copy constructor
71  /*!
72  * @param data BCInterfaceData
73  */
74  BCInterfaceData ( const BCInterfaceData& data );
75 
76  //! Destructor
77  virtual ~BCInterfaceData() {}
78 
79  //@}
80 
81 
82  //! @name Operators
83  //@{
84 
85  //! Operator =
86  /*!
87  * @param data BCInterfaceData
88  * @return reference to a copy of the class
89  */
90  BCInterfaceData& operator= ( const BCInterfaceData& data );
91 
92  //@}
93 
94 
95  //! @name Methods
96  //@{
97 
98  //! Read parameters for all kind of BC
99  /*!
100  * @param fileName Name of the data file.
101  * @param dataSection BC section
102  * @param name name of the boundary condition
103  */
104  virtual void readBC ( const std::string& fileName, const std::string& dataSection, const std::string& name );
105 
106  //! Display general information about the content of the class
107  /*!
108  * @param output specify the output format (std::cout by default)
109  */
110  virtual void showMe ( std::ostream& output = std::cout ) const;
111 
112  //@}
113 
114 
115  //! @name Set Methods
116  //@{
117 
118  //! Set the base string of the boundary condition
119  /*!
120  * @param baseString Boundary condition base string
121  */
122  void setBaseString ( const std::string& baseString );
123 
124  //! Set the base type of the boundary condition
125  /*!
126  * @param base Boundary condition base type
127  */
128  void setBase ( const std::pair< std::string, baseList_Type >& base )
129  {
130  M_base = base;
131  }
132 
133  //! Set the boundary ID
134  /*!
135  * @param boundaryID boundary ID
136  */
137  void boundaryID ( const ID& boundaryID)
138  {
139  M_boundaryID = boundaryID;
140  }
141 
142  //@}
143 
144 
145  //! @name Get Methods
146  //@{
147 
148  //! Get the base string of the boundary condition
149  /*!
150  * @return Boundary condition base string
151  */
152  const std::string& baseString() const
153  {
154  return M_baseString;
155  }
156 
157  //! Get the base type of the boundary condition
158  /*!
159  * @return Boundary condition base
160  */
161  const std::pair< std::string, baseList_Type >& base() const
162  {
163  return M_base;
164  }
165 
166  //! Get the base map of the boundary condition
167  /*!
168  * @return Boundary condition base map
169  */
170  const std::map< std::string, baseList_Type >& mapBase() const
171  {
172  return M_mapBase;
173  }
174 
175  //! Get the boundary ID
176  /*!
177  * @return boundaryID
178  */
179  const ID& boundaryID() const
180  {
181  return M_boundaryID;
182  }
183 
184  //! Get the parameters vector {A, B, C, ...}
185  /*!
186  * @return Boundary condition parameters vector
187  */
189  {
190  return M_parameters;
191  }
192 
193  //@}
194 
195 protected:
196 
197  //! @name Private Methods
198  //@{
199 
200  void readBase ( const GetPot& dataFile, const std::string& path, std::pair< std::string, baseList_Type >& base, std::string& baseString );
201 
202  bool isBase ( const GetPot& dataFile, const char* base, std::string& baseString );
203 
204  void readParameters ( const GetPot& dataFile, const char* parameters );
205 
206  //@}
207 
208 
209  //! @name Common Private Members
210  //@{
211 
212  std::pair< std::string, baseList_Type > M_base;
213  std::string M_baseString;
214 
216 
218 
220 
221  //@}
222 };
223 
224 } // Namespace LifeV
225 
226 #endif /* BCInterfaceData_H */
const ID & boundaryID() const
Get the boundary ID.
void boundaryID(const ID &boundaryID)
Set the boundary ID.
void setBaseString(const std::string &baseString)
Set the base string of the boundary condition.
BCInterfaceData - The BCInterface data container.
virtual void readBC(const std::string &fileName, const std::string &dataSection, const std::string &name)
Read parameters for all kind of BC.
void setBase(const std::pair< std::string, baseList_Type > &base)
Set the base type of the boundary condition.
bool isBase(const GetPot &dataFile, const char *base, std::string &baseString)
void updateInverseJacobian(const UInt &iQuadPt)
void readParameters(const GetPot &dataFile, const char *parameters)
void readBase(const GetPot &dataFile, const std::string &path, std::pair< std::string, baseList_Type > &base, std::string &baseString)
std::pair< std::string, baseList_Type > M_base
uint32_type ID
IDs.
Definition: LifeV.hpp:194
const std::pair< std::string, baseList_Type > & base() const
Get the base type of the boundary condition.
std::vector< Real > parametersContainer_Type
BCInterfaceData(const BCInterfaceData &data)
Copy constructor.
BCInterfaceData & operator=(const BCInterfaceData &data)
Operator =.
virtual void showMe(std::ostream &output=std::cout) const
Display general information about the content of the class.
const std::map< std::string, baseList_Type > & mapBase() const
Get the base map of the boundary condition.
std::map< std::string, baseList_Type > M_mapBase
virtual ~BCInterfaceData()
Destructor.
parametersContainer_Type M_parameters
const std::string & baseString() const
Get the base string of the boundary condition.
BCInterfaceData()
Constructor.
const parametersContainer_Type & parameters() const
Get the parameters vector {A, B, C, ...}.