LifeV
EvaluationDerivativeArcTan.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_DERIVATIVEARCTAN_HPP
37 #define EVALUTATION_DERIVATIVEARCTAN_HPP
38 
39 #include <lifev/core/LifeV.hpp>
40 
41 #include <lifev/eta/array/OperationSmallDerivativeArcTan.hpp>
42 #include <lifev/eta/expression/ExpressionDerivativeArcTan.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 EvaluationDerivativeArcTan
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  EvaluationDerivativeArcTan (const EvaluationDerivativeArcTan& eval)
97  : M_evaluationBase (eval.M_evaluationBase),
98  M_epsilon (eval.M_epsilon),
99  M_K (eval.M_K)
100  {}
101 
102  //! Constructor from the corresponding expression
103  template <typename BaseExpressionType>
104  explicit EvaluationDerivativeArcTan (const ExpressionDerivativeArcTan<BaseExpressionType>& expression)
105  : M_evaluationBase (expression.base() ),
106  M_epsilon (expression.epsilon() ),
107  M_K (expression.K() )
108  {}
109 
110  //! Destructor
111  ~EvaluationDerivativeArcTan() {}
112 
113  //@}
114 
115 
116  //! @name Methods
117  //@{
118 
119  //! Internal update method
120  void update (const UInt& iElement)
121  {
122  M_evaluationBase.update (iElement);
123  }
124 
125  //! Display method
126  static void display ( std::ostream& out = std::cout )
127  {
128  out << " atan ( " ;
129  EvaluationBaseType::display (out);
130  out << ")";
131  }
132 
133  //@}
134 
135 
136  //! @name Set Methods
137  //@{
138 
139  //! Setter for the global current FE
140  template< typename CFEType >
141  void setGlobalCFE (const CFEType* globalCFE)
142  {
143  M_evaluationBase.setGlobalCFE (globalCFE);
144  }
145 
146  //! Setter for the test current FE
147  template< typename CFEType >
148  void setTestCFE (const CFEType* testCFE)
149  {
150  M_evaluationBase.setTestCFE (testCFE);
151  }
152 
153  //! Setter for the solution current FE
154  template< typename CFEType >
155  void setSolutionCFE (const CFEType* solutionCFE)
156  {
157  M_evaluationBase.setSolutionCFE (solutionCFE);
158  }
159 
160  //! Setter for the quadrature rule
161  void setQuadrature (const QuadratureRule& qr)
162  {
163  M_evaluationBase.setQuadrature (qr);
164  }
165 
166  //@}
167 
168 
169  //! @name Get Methods
170  //@{
171 
172  //! Getter a value
173  return_Type value_q (const UInt& q) const
174  {
175  return ( M_epsilon * M_K ) * ( 1.0/ ( 1.0 + ( M_epsilon * M_epsilon * M_evaluationBase.value_q (q) * M_evaluationBase.value_q (q) ) ) );
176  }
177 
178  //! Getter for the value for a vector
179  return_Type value_qi (const UInt& q, const UInt& i) const
180  {
181  return ( M_epsilon * M_K ) * ( 1.0/ ( 1.0 + ( M_epsilon * M_epsilon * M_evaluationBase.value_qi (q, i) * M_evaluationBase.value_qi (q, i) ) ) );
182  }
183 
184  //! Getter for the value for a matrix
185  return_Type value_qij (const UInt& q, const UInt& i, const UInt& j) const
186  {
187  return ( M_epsilon * M_K ) * ( 1.0/ ( 1.0 + ( M_epsilon * M_epsilon * M_evaluationBase.value_qij (q, i, j) * M_evaluationBase.value_qij (q, i, j) ) ) );
188  }
189 
190  //@}
191 
192 private:
193 
194  //! @name Private Methods
195  //@{
196 
197  //! No empty constructor
198  EvaluationDerivativeArcTan();
199 
200  //@}
201 
202  //! Internal storage
203  EvaluationBaseType M_evaluationBase;
204  Real M_epsilon;
205  Real M_K;
206 };
207 
208 template< typename EvaluationBaseType>
209 const flag_Type EvaluationDerivativeArcTan<EvaluationBaseType>::S_globalUpdateFlag
210  = EvaluationBaseType::S_globalUpdateFlag;
211 
212 template< typename EvaluationBaseType>
213 const flag_Type EvaluationDerivativeArcTan<EvaluationBaseType>::S_testUpdateFlag
214  = EvaluationBaseType::S_testUpdateFlag;
215 
216 template< typename EvaluationBaseType>
217 const flag_Type EvaluationDerivativeArcTan<EvaluationBaseType>::S_solutionUpdateFlag
218  = EvaluationBaseType::S_solutionUpdateFlag;
219 
220 } // Namespace ExpressionAssembly
221 
222 } // Namespace LifeV
223 #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