LifeV
EvaluationPosition.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 This file contains the definition of the evaluation for the position
30 
31  @author Samuel Quinodoz <samuel.quinodoz@epfl.ch>
32  @date 03 Jan 2012
33  */
34 
35 #ifndef EVALUATION_POSITION_HPP
36 #define EVALUATION_POSITION_HPP
37 
38 #include <lifev/core/LifeV.hpp>
39 
40 #include <lifev/core/array/VectorSmall.hpp>
41 
42 #include <lifev/eta/fem/ETCurrentFE.hpp>
43 #include <lifev/eta/fem/ETCurrentFlag.hpp>
44 #include <lifev/core/fem/QuadratureRule.hpp>
45 
46 #include <lifev/eta/expression/ExpressionPosition.hpp>
47 
48 namespace LifeV
49 {
50 
51 namespace ExpressionAssembly
52 {
53 
54 //! EvaluationPosition - Evaluation of the position
55 /*!
56  @author Samuel Quinodoz
57  */
58 template< UInt spaceDim>
60 {
61 public:
62 
63  //! @name Public Types
64  //@{
65 
66  //! Type of the values returned by this class
67  typedef VectorSmall<spaceDim> return_Type;
68 
69  //@}
70 
71  //! @name Static constants
72  //@{
73 
74  //! Flag for the global current FE
75  const static flag_Type S_globalUpdateFlag;
76 
77  //! Flag for the test current FE
78  const static flag_Type S_testUpdateFlag;
79 
80  //! Flag for the solution current FE
81  const static flag_Type S_solutionUpdateFlag;
82 
83  //@}
84 
85 
86  //! @name Constructors, destructor
87  //@{
88 
89  //! Empty constructor
90  EvaluationPosition() {}
91 
92  //! Copy constructor
93  EvaluationPosition (const EvaluationPosition<spaceDim>& evaluation)
94  : M_valuePtr (evaluation.M_valuePtr)
95  {}
96 
97  //! Expression-based constructor
98  explicit EvaluationPosition (const ExpressionPosition& /*expression*/) {}
99 
100  //! Destructor
101  ~EvaluationPosition() {}
102 
103  //@}
104 
105 
106  //! @name Methods
107  //@{
108 
109  //! Do nothing update
110  void update (const UInt& /*iElement*/) {}
111 
112  //! Display method
113  static void display (std::ostream& out = std::cout)
114  {
115  out << "X";
116  }
117 
118  //@}
119 
120 
121  //! @name Set Methods
122  //@{
123 
124  //! Setter for the global current FE
125  template< typename CFEType >
126  void setGlobalCFE (const CFEType* globalCFE)
127  {
128  ASSERT (globalCFE != 0, "Nul pointer to the globalCFE cannot be set");
129  M_valuePtr = & (globalCFE->M_quadNode);
130  }
131 
132  //! Setter for the test current FE
133  template< typename CFEType >
134  void setTestCFE (const CFEType* /*testCFE*/) {}
135 
136  //! Do nothing setter for the solution current FE
137  template< typename CFEType >
138  void setSolutionCFE (const CFEType* /*solutionCFE*/) {}
139 
140  //! Do nothing setter for the quadrature rule
141  void setQuadrature (const QuadratureRule&) {}
142 
143  //@}
144 
145 
146  //! @name Get Methods
147  //@{
148 
149  //! Getter for the value for a value
150  return_Type value_q (const UInt& q) const
151  {
152  return (*M_valuePtr) [q];
153  }
154 
155  //! Getter for the value for a vector
156  return_Type value_qi (const UInt& q, const UInt& /*i*/) const
157  {
158  return (*M_valuePtr) [q];
159  }
160 
161  //! Getter for the value for a matrix
162  return_Type value_qij (const UInt& q, const UInt& /*i*/, const UInt& /*j*/) const
163  {
164  return (*M_valuePtr) [q];
165  }
166 
167  //@}
168 
169 private:
170 
171  //! Storage for the pointer to the data
172  std::vector< VectorSmall<spaceDim> > const* M_valuePtr;
173 
174 };
175 
176 template<UInt spaceDim>
177 const flag_Type EvaluationPosition<spaceDim>::S_globalUpdateFlag = ET_UPDATE_QUAD_NODE;
178 
179 template<UInt spaceDim>
180 const flag_Type EvaluationPosition<spaceDim>::S_testUpdateFlag = ET_UPDATE_NONE;
181 
182 template<UInt spaceDim>
183 const flag_Type EvaluationPosition<spaceDim>::S_solutionUpdateFlag = ET_UPDATE_NONE;
184 
185 
186 } // Namespace ExpressionAssembly
187 
188 } // Namespace LifeV
189 
190 #endif /* EVALUATION_POSITION_HPP */
uint32_type flag_Type
bit-flag with up to 32 different flags
Definition: LifeV.hpp:197
friend class ExpressionAssembly::EvaluationPosition
Friend to allow direct access to the raw data.
void updateInverseJacobian(const UInt &iQuadPt)
#define ASSERT(X, A)
Definition: LifeAssert.hpp:90
QuadratureRule - The basis class for storing and accessing quadrature rules.
uint32_type UInt
generic unsigned integer (used mainly for addressing)
Definition: LifeV.hpp:191