LifeV
EvaluationMatrix.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 EvaluationMatrix class.
31 
32  @date 06/2011
33  @author Samuel Quinodoz <samuel.quinodoz@epfl.ch>
34  */
35 #ifndef EVALUATION_MATRIX_HPP
36 #define EVALUATION_MATRIX_HPP
37 
38 #include <lifev/core/LifeV.hpp>
39 
40 #include <lifev/core/array/MatrixSmall.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/ExpressionMatrix.hpp>
47 
48 
49 namespace LifeV
50 {
51 
52 namespace ExpressionAssembly
53 {
54 
55 //! Evaluation for a matricial constant
56 /*!
57  @author Samuel Quinodoz <samuel.quinodoz@epfl.ch>
58 
59  This class aims at representing a matricial constant in the assembly
60 
61  This class is an Evaluation class, and therefore, has all the methods
62  required to work within the Evaluation trees.
63  */
64 template <UInt MatrixDim1, UInt MatrixDim2>
65 class EvaluationMatrix
66 {
67 public:
68 
69  //! @name Public Types
70  //@{
71 
72  //! Type of the value returned by this class
73  typedef MatrixSmall<MatrixDim1, MatrixDim2> return_Type;
74 
75  //@}
76 
77 
78  //! @name Static constants
79  //@{
80 
81  //! Flag for the global current FE
82  const static flag_Type S_globalUpdateFlag;
83 
84  //! Flag for the test current FE
85  const static flag_Type S_testUpdateFlag;
86 
87  //! Flag for the solution current FE
88  const static flag_Type S_solutionUpdateFlag;
89 
90  //@}
91 
92 
93  //! @name Constructors, destructor
94  //@{
95 
96  //! Empty constructor
97  EvaluationMatrix()
98  {}
99 
100  //! Copy constructor
101  EvaluationMatrix (const EvaluationMatrix<MatrixDim1, MatrixDim2>& evaluation)
102  : M_value (evaluation.M_value)
103  {}
104 
105  //! Expression-based constructor
106  explicit EvaluationMatrix (const ExpressionMatrix<MatrixDim1, MatrixDim2>& expression)
107  : M_value (expression.value() )
108  {}
109 
110  //! Destructor
111  ~EvaluationMatrix()
112  {}
113 
114  //@}
115 
116 
117  //! @name Methods
118  //@{
119 
120  //! Do nothing internal update
121  void update (const UInt& /*iElement*/)
122  {}
123 
124  //! Display method
125  static void display (std::ostream& out = std::cout)
126  {
127  out << "matrix[" << MatrixDim1 << "][" << MatrixDim2 << "]";
128  }
129 
130  //@}
131 
132 
133  //! @name Set Methods
134  //@{
135 
136  //! Do nothing setter for the global current FE
137  template< typename CFEType >
138  void setGlobalCFE (const CFEType* /*globalCFE*/)
139  {}
140 
141  //! Do nothing setter for the test current FE
142  template< typename CFEType >
143  void setTestCFE (const CFEType* /*testCFE*/)
144  {}
145 
146  //! Do nothing setter for the solution current FE
147  template< typename CFEType >
148  void setSolutionCFE (const CFEType* /*solutionCFE*/)
149  {}
150 
151  //! Setter for the quadrature rule
152  void setQuadrature (const QuadratureRule&)
153  {}
154 
155  //@}
156 
157 
158  //! @name Get Methods
159  //@{
160 
161  //! Getter for a value
162  return_Type value_q (const UInt& /*q*/) const
163  {
164  return M_value;
165  }
166 
167  //! Getter for the value for a vector
168  return_Type value_qi (const UInt& /*q*/, const UInt& /*i*/) const
169  {
170  return M_value;
171  }
172 
173  //! Getter for the value for a matrix
174  return_Type value_qij (const UInt& /*q*/, const UInt& /*i*/, const UInt& /*j*/) const
175  {
176  return M_value;
177  }
178 
179  //@}
180 
181 private:
182 
183  // Storage
184  MatrixSmall<MatrixDim1, MatrixDim2> M_value;
185 };
186 
187 
188 template<UInt MatrixDim1, UInt MatrixDim2>
189 const flag_Type EvaluationMatrix<MatrixDim1, MatrixDim2>::S_globalUpdateFlag = ET_UPDATE_NONE;
190 
191 template<UInt MatrixDim1, UInt MatrixDim2>
192 const flag_Type EvaluationMatrix<MatrixDim1, MatrixDim2>::S_testUpdateFlag = ET_UPDATE_NONE;
193 
194 template<UInt MatrixDim1, UInt MatrixDim2>
195 const flag_Type EvaluationMatrix<MatrixDim1, MatrixDim2>::S_solutionUpdateFlag = ET_UPDATE_NONE;
196 
197 
198 } // Namespace ExpressionAssembly
199 
200 } // Namespace LifeV
201 #endif
uint32_type flag_Type
bit-flag with up to 32 different flags
Definition: LifeV.hpp:197
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