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