LifeV
BCFunction.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 contains BCManageNormal class for handling normal essential boundary conditions
30 
31  @author Miguel Fernandez <miguel.fernandez@inria.fr>
32  @contributor Christophe Prud'homme <christophe.prudhomme@epfl.ch>
33  @contributor Mauro Perego <perego.mauro@gmail.com>
34  @maintainer Mauro Perego <perego.mauro@gmail.com>
35 
36  @date 10-12-2004
37  *///@HEADER
38 
39 
40 #include <lifev/core/LifeV.hpp>
41 #include <lifev/core/fem/BCFunction.hpp>
42 
43 namespace LifeV
44 {
45 
46 //==================================================
47 // BCFunctionBase
48 //==================================================
49 
50 
51 //==================================================
52 // Constructors
53 //==================================================
54 
55 
57  :
58  M_userDefinedFunction ( userDefinedFunction )
59 {
60 }
61 
62 BCFunctionBase::BCFunctionBase ( const BCFunctionBase& bcFunctionBase )
63  :
65 {
66 }
67 
68 
69 //==================================================
70 // Operators
71 //==================================================
72 
73 
75 BCFunctionBase::operator= ( const BCFunctionBase& bcFunctionBase )
76 {
77  if (this != &bcFunctionBase)
78  {
80  }
81  return *this;
82 }
83 
84 
86 createBCFunctionBase ( BCFunctionBase const* bcFunctionBase )
87 {
88  return new BCFunctionBase ( ( BCFunctionBase const& ) * bcFunctionBase );
89 }
90 
91 
92 
93 
94 //==================================================
95 // BCFunctionRobin
96 //==================================================
97 
98 //==================================================
99 // Constructors
100 //==================================================
101 
103  :
104  BCFunctionBase ( bcFunctionRobin ),
106 {
107 }
108 
109 BCFunctionRobin::BCFunctionRobin ( const function_Type& rightHandSideFunction, const function_Type& massCoeffFunction )
110  :
111  BCFunctionBase ( rightHandSideFunction ),
112  M_robinBoundaryMassCoeffFunction ( massCoeffFunction )
113 
114 {
115 }
116 
117 
118 //==================================================
119 // Assignment Operator
120 //==================================================
121 
122 
124 BCFunctionRobin::operator= ( const BCFunctionRobin& bcFunctionRobin )
125 {
126  if ( this != &bcFunctionRobin )
127  {
128  this->BCFunctionBase::operator= ( bcFunctionRobin );
130  }
131  return *this;
132 }
133 
134 
135 //==================================================
136 // Set Methods
137 //==================================================
138 
139 void
140 BCFunctionRobin::setFunctions_Robin ( const function_Type& rightHandSideFunction, const function_Type& massCoeffFunction )
141 {
142  setFunction ( rightHandSideFunction );
143  M_robinBoundaryMassCoeffFunction = massCoeffFunction;
144 }
145 
146 
147 
150 {
151  return new BCFunctionRobin ( ( BCFunctionRobin const& ) *__bc );
152 }
153 
154 
155 //==================================================
156 // BCFunctionUDepBase
157 //==================================================
158 
159 //==================================================
160 // Constructors
161 //==================================================
162 
163 
164 BCFunctionUDepBase::BCFunctionUDepBase (const function_Type& userDefinedFunction ) : M_userDefinedFunction (userDefinedFunction)
165 {
166 }
167 
168 
171 {
172 }
173 
174 
175 //==================================================
176 // Operators
177 //==================================================
178 
180 BCFunctionUDepBase::operator= ( const BCFunctionUDepBase& bcFunctionUDepBase )
181 {
182  if (this != &bcFunctionUDepBase)
183  {
184  M_userDefinedFunction = bcFunctionUDepBase.M_userDefinedFunction;
185  }
186  return *this;
187 }
188 
189 
191 createBCFunctionUDep ( BCFunctionUDepBase const* bcFunctionUDepBase )
192 {
193  return new BCFunctionUDepBase ( ( BCFunctionUDepBase const& ) * bcFunctionUDepBase );
194 }
195 
196 
197 //==================================================
198 // BCFunctionUDepRobin
199 //==================================================
200 
201 
202 //==================================================
203 // Constructor
204 //==================================================
205 
207  :
208  BCFunctionUDepBase ( bcFunctionUDepRobin ),
210 {
211 }
212 
213 BCFunctionUDepRobin::BCFunctionUDepRobin ( const function_Type& rightHandSideFunction, const function_Type& massCoeffFunction )
214  :
215  BCFunctionUDepBase ( rightHandSideFunction ),
216  M_robinBoundaryMassCoeffFunction ( massCoeffFunction )
217 
218 {
219 }
220 
221 
222 //==================================================
223 // Operators
224 //==================================================
225 
227 BCFunctionUDepRobin::operator= ( const BCFunctionUDepRobin& bcFunctionUDepRobin )
228 {
229  if ( this != &bcFunctionUDepRobin )
230  {
231  this->BCFunctionUDepBase::operator= ( bcFunctionUDepRobin );
233  }
234  return *this;
235 }
236 
237 
238 //==================================================
239 // Set Methods
240 //==================================================
241 
242 void
243 BCFunctionUDepRobin::setFunctions_Robin ( const function_Type& rightHandSideFunction, const function_Type& massCoeffFunction )
244 {
245  setFunction ( rightHandSideFunction );
246  M_robinBoundaryMassCoeffFunction = massCoeffFunction;
247 }
248 
249 
251 createBCFunctionUDepRobin ( BCFunctionUDepBase const* bcFunctionUDepRobin )
252 {
253  return new BCFunctionUDepRobin ( ( BCFunctionUDepRobin const& ) * bcFunctionUDepRobin );
254 }
255 
256 
257 //==================================================
258 // BCFunctionDirectional
259 //==================================================
260 
261 //==================================================
262 // Constructors
263 //==================================================
265  :
266  BCFunctionBase ( bcFunctionDirectional ),
268 {
269 }
270 
271 BCFunctionDirectional::BCFunctionDirectional ( const function_Type& userDefinedFunction, const function_Type& userDefinedVersorsFunction )
272  :
273  BCFunctionBase ( userDefinedFunction ),
274  M_userDefinedVersorsFunction ( userDefinedVersorsFunction )
275 
276 {
277 }
278 
279 //==================================================
280 // Operators
281 //==================================================
282 
284 BCFunctionDirectional::operator= ( const BCFunctionDirectional& bcFunctionDirectional )
285 {
286  if ( this != &bcFunctionDirectional )
287  {
288  this->BCFunctionBase::operator= ( bcFunctionDirectional );
290  }
291  return *this;
292 }
293 
294 
295 //==================================================
296 // Set Method
297 //==================================================
298 void
299 BCFunctionDirectional::setFunctions_Directional ( const function_Type& userDefinedFunction, const function_Type& userDefinedVersorsFunction )
300 {
301  setFunction ( userDefinedFunction );
302  M_userDefinedVersorsFunction = userDefinedVersorsFunction;
303 }
304 
305 
307 createBCFunctionDirectional ( BCFunctionBase const* bcFunctionDirectional )
308 {
309  return new BCFunctionDirectional ( ( BCFunctionDirectional const& ) * bcFunctionDirectional);
310 }
311 
312 } //End of namespace LifeV
BCFunctionUDepBase * createBCFunctionUDep(BCFunctionUDepBase const *bcFunctionUDepBase)
Definition: BCFunction.cpp:191
BCFunctionRobin(const function_Type &rightHandSideFunction, const function_Type &massTermFunction)
Constructing from user defined functions.
Definition: BCFunction.cpp:109
BCFunctionUDepBase - class that holds the function used for prescribing boundary conditions.
Definition: BCFunction.hpp:380
BCFunctionUDepBase(const BCFunctionUDepBase &bcFunctionUDepBase)
Copy Constructor.
Definition: BCFunction.cpp:169
BCFunctionUDepBase * createBCFunctionUDepRobin(BCFunctionUDepBase const *bcFunctionUDepRobin)
Definition: BCFunction.cpp:251
BCFunctionDirectional(const BCFunctionDirectional &bcFunctionDirectional)
Copy Constructor.
Definition: BCFunction.cpp:264
BCFunctionBase(function_Type userDefinedFunction)
Constructor for a user defined function.
Definition: BCFunction.cpp:56
virtual BCFunctionUDepBase & operator=(const BCFunctionUDepBase &bcFunctionUDepBase)
Assignment Operator.
Definition: BCFunction.cpp:180
BCFunctionRobin(const BCFunctionRobin &bcFunctionUDepRobin)
Copy Constructor.
Definition: BCFunction.cpp:102
std::function< Real(const Real &, const Real &, const Real &, const Real &, const ID &, const Real &) > function_Type
Definition: BCFunction.hpp:387
void setFunctions_Robin(const function_Type &rightHandSideFunction, const function_Type &massCoeffFunction)
Set the functions.
Definition: BCFunction.cpp:243
void updateInverseJacobian(const UInt &iQuadPt)
function_Type M_robinBoundaryMassCoeffFunction
user defined function for the boundary mass coefficient in Robin conditions
Definition: BCFunction.hpp:649
BCFunctionBase * createBCFunctionDirectional(BCFunctionBase const *bcFunctionDirectional)
Definition: BCFunction.cpp:307
BCFunctionRobin - class that holds the function used for prescribing Robin boundary conditions...
Definition: BCFunction.hpp:231
BCFunctionBase - class that holds the function used for prescribing boundary conditions.
Definition: BCFunction.hpp:77
BCFunctionBase * createBCFunctionRobin(BCFunctionBase const *__bc)
Definition: BCFunction.cpp:149
BCFunctionUDepRobin(const BCFunctionUDepRobin &bcFunctionUDepRobin)
Copy Constructor.
Definition: BCFunction.cpp:206
BCFunctionRobin & operator=(const BCFunctionRobin &bcFunctionUDepRobin)
Assignment operator.
Definition: BCFunction.cpp:124
void setFunction(const function_Type &userDefinedFunction)
Set the user defined function.
Definition: BCFunction.hpp:468
void setFunctions_Directional(const function_Type &userDefinedFunctional, const function_Type &userDefinedVersorsFunction)
Set the functions.
Definition: BCFunction.cpp:299
BCFunctionBase * createBCFunctionBase(BCFunctionBase const *bcFunctionBase)
Definition: BCFunction.cpp:86
virtual BCFunctionBase & operator=(const BCFunctionBase &bcFunctionBase)
Assignment Operator.
Definition: BCFunction.cpp:75
BCFunctionBase(const BCFunctionBase &bcFunctionBase)
Copy Constructor.
Definition: BCFunction.cpp:62
void setFunction(function_Type userDefinedFunction)
Set the user defined function.
Definition: BCFunction.hpp:152
BCFunctionDirectional(const function_Type &userDefinedFunctional, const function_Type &userDefinedVersorsFunction)
Constructing from user defined functions.
Definition: BCFunction.cpp:271
function_Type M_userDefinedFunction
user defined function
Definition: BCFunction.hpp:192
void setFunctions_Robin(const function_Type &rightHandSideFunction, const function_Type &massCoeffFunction)
Set the functions.
Definition: BCFunction.cpp:140
BCFunctionUDepRobin - class that holds the function used for prescribing Robin boundary conditions...
Definition: BCFunction.hpp:526
BCFunctionUDepBase - class that holds the function used for prescribing boundary conditions.
Definition: BCFunction.hpp:683
function_Type M_robinBoundaryMassCoeffFunction
user defined function for the boundary mass coefficient in Robin conditions
Definition: BCFunction.hpp:349
std::function< Real(const Real &, const Real &, const Real &, const Real &, const ID &) > function_Type
Definition: BCFunction.hpp:84
BCFunctionDirectional & operator=(const BCFunctionDirectional &bcFunctionDirectional)
Assignment operator.
Definition: BCFunction.cpp:284
function_Type M_userDefinedFunction
user defined function
Definition: BCFunction.hpp:493
function_Type M_userDefinedVersorsFunction
user defined function returning versors along which the essential boundary condition will be prescrib...
Definition: BCFunction.hpp:793
BCFunctionUDepRobin & operator=(const BCFunctionUDepRobin &bcFunctionUDepRobin)
Assignment operator.
Definition: BCFunction.cpp:227
BCFunctionUDepRobin(const function_Type &rightHandSideFunction, const function_Type &massTermFunction)
Constructing from user defined functions.
Definition: BCFunction.cpp:213
BCFunctionUDepBase(const function_Type &userDefinedFunction)
Constructor for a user defined function.
Definition: BCFunction.cpp:164