LifeV
EvaluationArcTan.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 the LifeV library
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
21  License along with this library; if not, see <http://www.gnu.org/licenses/>
22 
23 
24 *******************************************************************************
25 */
26 //@HEADER
27 
28 /*!
29  * @file
30  @brief This file contains the definition of the EvaluationAddition class.
31 
32  @date 06/2011
33  @author Samuel Quinodoz <samuel.quinodoz@epfl.ch>
34  */
35 
36 #ifndef EVALUTATION_ARCTAN_HPP
37 #define EVALUTATION_ARCTAN_HPP
38 
39 #include <lifev/core/LifeV.hpp>
40 
41 #include <lifev/eta/array/OperationSmallArcTan.hpp>
42 #include <lifev/eta/expression/ExpressionArcTan.hpp>
43 
44 #include <lifev/core/fem/QuadratureRule.hpp>
45 
46 namespace LifeV
47 {
48 
49 namespace ExpressionAssembly
50 {
51 
52 //! Evaluation for the product of two other Evaluations
53 /*!
54  @author Samuel Quinodoz <samuel.quinodoz@epfl.ch>
55 
56  This class aims at representing a product operation during the assembly
57 
58  This class is an Evaluation class, and therefore, has all the methods
59  required to work within the Evaluation trees.
60  */
61 template <typename EvaluationBaseType>
62 class EvaluationArcTan
63 {
64 public:
65 
66  //! @name Public Types
67  //@{
68  typedef typename EvaluationBaseType::return_Type BaseReturn_Type;
69 
70  //! Type of the value returned by this class
71  typedef typename OperationSmallArcTan<BaseReturn_Type>::result_Type return_Type;
72 
73 
74  //@}
75 
76 
77  //! @name Static constants
78  //@{
79 
80  //! Flag for the global current FE
81  const static flag_Type S_globalUpdateFlag;
82 
83  //! Flag for the test current FE
84  const static flag_Type S_testUpdateFlag;
85 
86  //! Flag for the solution current FE
87  const static flag_Type S_solutionUpdateFlag;
88 
89  //@}
90 
91 
92  //! @name Constructors, destructor
93  //@{
94 
95  //! Copy constructor
96  EvaluationArcTan (const EvaluationArcTan& eval)
97  : M_evaluationBase (eval.M_evaluationBase),
98  M_epsilon (eval.M_epsilon),
99  M_K (eval.M_K),
100  M_delta (eval.M_delta)
101  {}
102 
103  //! Constructor from the corresponding expression
104  template <typename BaseExpressionType>
105  explicit EvaluationArcTan (const ExpressionArcTan<BaseExpressionType>& expression)
106  : M_evaluationBase (expression.base() ),
107  M_epsilon (expression.epsilon() ),
108  M_K (expression.K() ),
109  M_delta (expression.delta() )
110  {}
111 
112  //! Destructor
113  ~EvaluationArcTan() {}
114 
115  //@}
116 
117 
118  //! @name Methods
119  //@{
120 
121  //! Internal update method
122  void update (const UInt& iElement)
123  {
124  M_evaluationBase.update (iElement);
125  }
126 
127  //! Display method
128  static void display ( std::ostream& out = std::cout )
129  {
130  out << " atan ( " ;
131  EvaluationBaseType::display (out);
132  out << ")";
133  }
134 
135  //@}
136 
137 
138  //! @name Set Methods
139  //@{
140 
141  //! Setter for the global current FE
142  template< typename CFEType >
143  void setGlobalCFE (const CFEType* globalCFE)
144  {
145  M_evaluationBase.setGlobalCFE (globalCFE);
146  }
147 
148  //! Setter for the test current FE
149  template< typename CFEType >
150  void setTestCFE (const CFEType* testCFE)
151  {
152  M_evaluationBase.setTestCFE (testCFE);
153  }
154 
155  //! Setter for the solution current FE
156  template< typename CFEType >
157  void setSolutionCFE (const CFEType* solutionCFE)
158  {
159  M_evaluationBase.setSolutionCFE (solutionCFE);
160  }
161 
162  //! Setter for the quadrature rule
163  void setQuadrature (const QuadratureRule& qr)
164  {
165  M_evaluationBase.setQuadrature (qr);
166  }
167 
168  //@}
169 
170 
171  //! @name Get Methods
172  //@{
173 
174  //! Getter a value
175  return_Type value_q (const UInt& q) const
176  {
177  return ( M_K ) * std::atan ( M_epsilon * ( M_evaluationBase.value_q (q) ) ) + ( M_delta );
178  }
179 
180  //! Getter for the value for a vector
181  return_Type value_qi (const UInt& q, const UInt& i) const
182  {
183  return ( M_K ) * std::atan ( M_epsilon * ( M_evaluationBase.value_qi (q, i) ) ) + ( M_delta );
184  }
185 
186  //! Getter for the value for a matrix
187  return_Type value_qij (const UInt& q, const UInt& i, const UInt& j) const
188  {
189  return ( M_K ) * std::atan ( M_epsilon * ( M_evaluationBase.value_qij (q, i, j) ) ) + ( M_delta );
190  }
191 
192  //@}
193 
194 private:
195 
196  //! @name Private Methods
197  //@{
198 
199  //! No empty constructor
200  EvaluationArcTan();
201 
202  //@}
203 
204  //! Internal storage
205  EvaluationBaseType M_evaluationBase;
206  Real M_epsilon;
207  Real M_K;
208  Real M_delta;
209 };
210 
211 template< typename EvaluationBaseType>
212 const flag_Type EvaluationArcTan<EvaluationBaseType>::S_globalUpdateFlag
213  = EvaluationBaseType::S_globalUpdateFlag;
214 
215 template< typename EvaluationBaseType>
216 const flag_Type EvaluationArcTan<EvaluationBaseType>::S_testUpdateFlag
217  = EvaluationBaseType::S_testUpdateFlag;
218 
219 template< typename EvaluationBaseType>
220 const flag_Type EvaluationArcTan<EvaluationBaseType>::S_solutionUpdateFlag
221  = EvaluationBaseType::S_solutionUpdateFlag;
222 
223 } // Namespace ExpressionAssembly
224 
225 } // Namespace LifeV
226 #endif
uint32_type flag_Type
bit-flag with up to 32 different flags
Definition: LifeV.hpp:197
void updateInverseJacobian(const UInt &iQuadPt)
double Real
Generic real data.
Definition: LifeV.hpp:175
QuadratureRule - The basis class for storing and accessing quadrature rules.
class OperationSmallAddition Class containing information about the power operation between the *Smal...
uint32_type UInt
generic unsigned integer (used mainly for addressing)
Definition: LifeV.hpp:191