LifeV
ZeroDimensionalBC.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 zero dimensional BCHandler
30  *
31  * @date 30-03-2011
32  * @author Cristiano Malossi <cristiano.malossi@epfl.ch>
33  *
34  * @maintainer Cristiano Malossi <cristiano.malossi@epfl.ch>
35  */
36 
37 #ifndef ZeroDimensionalBC_H
38 #define ZeroDimensionalBC_H 1
39 
40 #include <lifev/zero_dimensional/function/ZeroDimensionalFunction.hpp>
41 
42 namespace LifeV
43 {
44 
45 //! ZeroDimensionalBC - A boundary condition for zero-dimensional models
46 /*!
47  * @author Cristiano Malossi
48  *
49  * This simple class is a boundary condition for simple zero-dimensional models.
50  */
52 {
53 public:
54 
55  //! @name Type definitions
56  //@{
57 
60 
61  //@}
62 
63 
64  //! @name Constructors & Destructor
65  //@{
66 
67  //! Constructor
69 
71  M_bcType ( bc.M_bcType ),
73 
74  //! Destructor
75  virtual ~ZeroDimensionalBC() {}
76 
77  //@}
78 
79 
80  //! @name Methods
81  //@{
82 
83  //! Evaluate the bc
84  /*!
85  * @param time the current time of the simulation
86  * @return the bc value
87  */
88  Real evaluate ( const Real& time ) const
89  {
90  return M_bcFunction ( time );
91  }
92 
93  //@}
94 
95 
96  //! @name Set Methods
97  //@{
98 
99  //! Set the function
100  /*!
101  @param function the user defined function
102  */
103  void setBC ( const bcType_Type& bcType, const bcFunction_Type& bcFunction )
104  {
105  M_bcType = bcType;
106  M_bcFunction = bcFunction;
107  }
108 
109  //! Set the function
110  /*!
111  @param function the user defined function
112  */
113  void setBCFunction ( const bcFunction_Type& function )
114  {
115  M_bcFunction = function;
116  }
117 
118  //! Set the type
119  /*!
120  @param bcType the bc type
121  */
122  void setBcType ( const bcType_Type& bcType )
123  {
124  M_bcType = bcType;
125  }
126 
127  //@}
128 
129 
130  //! @name Get Methods
131  //@{
132 
133  //! Get the type
134  /*!
135  @return the bc type
136  */
137  const bcType_Type& bcType() const
138  {
139  return M_bcType;
140  }
141 
142  //! Get the bc function
143  /*!
144  @return the user defined bc function
145  */
147  {
148  return M_bcFunction;
149  }
150 
151  //@}
152 
153 private:
154 
157 };
158 
159 } // Namespace LifeV
160 
161 #endif /* ZeroDimensionalBCHandler_H */
const bcFunction_Type & bcFunction() const
Get the bc function.
ZeroDimensionalFunction bcFunction_Type
ZeroDimensionalFunction & operator=(const ZeroDimensionalFunction &bcFunction)
Operator=.
ZeroDimensionalBC - A boundary condition for zero-dimensional models.
Real operator()(const Real &time) const
Operator()
ZeroDimensionalBC(const ZeroDimensionalBC &bc)
void updateInverseJacobian(const UInt &iQuadPt)
virtual ~ZeroDimensionalBC()
Destructor.
ZeroDimensionalFunction(const ZeroDimensionalFunction &bcFunction)
Copy constructor.
void setBcType(const bcType_Type &bcType)
Set the type.
void setBC(const bcType_Type &bcType, const bcFunction_Type &bcFunction)
Set the function.
void setBCFunction(const bcFunction_Type &function)
Set the function.
const bcType_Type & bcType() const
Get the type.
Real evaluate(const Real &time) const
Evaluate the bc.
double Real
Generic real data.
Definition: LifeV.hpp:175
ZeroDimensionalBCType bcType_Type
ZeroDimensionalFunction - A boundary conditions function for zero-dimensional models.