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