LifeV
BCInterfaceFunction.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 BCInterfaceFunction class
30  *
31  * @date 06-04-2009
32  * @author Cristiano Malossi <cristiano.malossi@epfl.ch>
33  *
34  * @maintainer Cristiano Malossi <cristiano.malossi@epfl.ch>
35  */
36 
37 #ifndef BCInterfaceFunction_H
38 #define BCInterfaceFunction_H 1
39 
40 #include <lifev/bc_interface/core/bc/BCInterfaceData.hpp>
41 
42 namespace LifeV
43 {
44 
45 //! BCInterfaceFunction - Base class for \c BCInterface boundary functions
46 /*!
47  * @author Cristiano Malossi
48  *
49  * This class provides the interface between the \c BCInterface and the boundary functions.
50  *
51  * \cond \TODO It may be a good idea (or not) to use this interface also for the \c BCInterfaceFunctionSolverDefined functions \endcond
52  */
53 template< typename BcHandlerType, typename PhysicalSolverType >
55 {
56 public:
57 
58  //! @name Type definitions
59  //@{
60 
61  typedef BcHandlerType bcHandler_Type;
62  typedef PhysicalSolverType physicalSolver_Type;
63 
65 
68 
71  typedef std::function<Real ( const Real&, const Real&, const Real&, const Real&, const ID& ) > boundaryFunctionTimeSpaceID_Type;
72 
73  //@}
74 
75 
76  //! @name Constructors & Destructor
77  //@{
78 
79  //! Empty Constructor
80  explicit BCInterfaceFunction() {}
81 
82  //! Destructor
83  virtual ~BCInterfaceFunction() {}
84 
85  //@}
86 
87 
88  //! @name Methods
89  //@{
90 
91  //! Assign the function to the base of the \c BCHandler
92  /*!
93  * @param base base of the boundary condition
94  */
95  virtual void assignFunction ( bcBase_Type& base ) = 0;
96 
97  //! Function of time
98  /*!
99  * @param t time
100  * @return boundary condition value
101  */
102  virtual Real functionTime ( const Real& t ) = 0;
103 
104  //! Function of time and time step
105  /*!
106  * @param t time
107  * @param timeStep time step
108  * @return boundary condition value
109  */
110  virtual Real functionTimeTimeStep ( const Real& t, const Real& timeStep ) = 0;
111 
112  //! Function of time and space
113  /*!
114  * @param t time
115  * @param x x coordinate
116  * @param y y coordinate
117  * @param z z coordinate
118  * @param id id of the boundary condition (not used)
119  * @return boundary condition value
120  */
121  virtual Real functionTimeSpace ( const Real& t, const Real& x, const Real& y, const Real& z, const ID& /*id*/) = 0;
122 
123  //! Function of time and space with ID
124  /*!
125  * @param t time
126  * @param x x coordinate
127  * @param y y coordinate
128  * @param z z coordinate
129  * @param id id of the boundary condition
130  * @return boundary condition value
131  */
132  virtual Real functionTimeSpaceID ( const Real& t, const Real& x, const Real& y, const Real& z, const ID& id ) = 0;
133 
134  //@}
135 
136 
137  //! @name Set Methods
138  //@{
139 
140  //! Set data for boundary conditions
141  /*!
142  * @param data boundary condition data loaded from \c GetPot file
143  */
144  virtual void setData ( const dataPtr_Type& data ) = 0;
145 
146  //@}
147 
148 private:
149 
150  //! @name Unimplemented Methods
151  //@{
152 
153  BCInterfaceFunction ( const BCInterfaceFunction& function );
154 
155  BCInterfaceFunction& operator= ( const BCInterfaceFunction& function );
156 
157  //@}
158 };
159 
160 } // Namespace LifeV
161 
162 #endif /* BCInterfaceFunction_H */
virtual Real functionTimeTimeStep(const Real &t, const Real &timeStep)=0
Function of time and time step.
virtual void setData(const dataPtr_Type &data)=0
Set data for boundary conditions.
BCInterfaceData - The BCInterface data container.
std::function< Real(const Real &) > boundaryFunctionTime_Type
std::shared_ptr< data_Type > dataPtr_Type
std::function< Real(const Real &, const Real &, const Real &, const Real &, const ID &) > boundaryFunctionTimeSpaceID_Type
void updateInverseJacobian(const UInt &iQuadPt)
virtual Real functionTimeSpaceID(const Real &t, const Real &x, const Real &y, const Real &z, const ID &id)=0
Function of time and space with ID.
PhysicalSolverType physicalSolver_Type
virtual ~BCInterfaceFunction()
Destructor.
uint32_type ID
IDs.
Definition: LifeV.hpp:194
std::function< Real(const Real &, const Real &) > boundaryFunctionTimeTimeStep_Type
virtual void assignFunction(bcBase_Type &base)=0
Assign the function to the base of the BCHandler.
double Real
Generic real data.
Definition: LifeV.hpp:175
BCInterfaceFunction()
Empty Constructor.
virtual Real functionTime(const Real &t)=0
Function of time.
BCInterfaceFunction & operator=(const BCInterfaceFunction &function)
bcHandler_Type::bcFunction_Type bcBase_Type
BCInterfaceFunction - Base class for BCInterface boundary functions.
BCInterfaceFunction(const BCInterfaceFunction &function)
virtual Real functionTimeSpace(const Real &t, const Real &x, const Real &y, const Real &z, const ID &)=0
Function of time and space.