LifeV
ExpressionPatchArea.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 File for the definition of the expression used to interpolate FE functions.
30 
31  @author Samuel Quinodoz <samuel.quinodoz@epfl.ch>
32 
33  @date 07-2011
34  */
35 
36 #ifndef EXPRESSION_PATCHAREA_HPP
37 #define EXPRESSION_PATCHAREA_HPP
38 
39 #include <lifev/core/LifeV.hpp>
40 
41 #include <lifev/core/array/VectorEpetra.hpp>
42 
43 #include <lifev/eta/expression/ExpressionBase.hpp>
44 #include <lifev/eta/fem/ETFESpace.hpp>
45 
46 #include <iostream>
47 
48 namespace LifeV
49 {
50 
51 namespace ExpressionAssembly
52 {
53 
54 //! class ExpressionInterpolateValue Class representing an interpolation in an expression.
55 /*!
56  @author Samuel Quinodoz <samuel.quinodoz@epfl.ch>
57 
58  This class is meant to be used only in the expression tree, it does not perform
59  any computation.
60 
61  <b> Template parameters </b>
62 
63  <i>MeshType</i>: The type of the mesh
64 
65  <i>MapType</i>: The type of the algebraic map (for parallel computations)
66 
67  <i>SpaceDim</i>: The ambiant space (for the finite element space)
68 
69  <i>FieldDim</i>: The dimension of the field to interpolate (scalar vs vectorial)
70 
71  <b> Template requirements </b>
72 
73  <i>MeshType</i>: Same as in LifeV::ETFESpace
74 
75  <i>MapType</i>: Same as in LifeV::ETFESpace
76 
77 */
78 template<typename MeshType, typename MapType, UInt SpaceDim, UInt FieldDim>
79 class ExpressionPatchArea
80  : public ExpressionBase<ExpressionPatchArea<MeshType, MapType, SpaceDim, FieldDim> >
81 {
82 public:
83 
84  //! @name Public Types
85  //@{
86 
87  // Base class, used only to make the code cleaner
88  typedef ExpressionBase<ExpressionPatchArea<MeshType, MapType, SpaceDim, FieldDim> > base_Type;
89 
90  typedef ETFESpace<MeshType, MapType, SpaceDim, FieldDim> ETFESpace_Type;
91  typedef std::shared_ptr<ETFESpace_Type> ETFESpacePtr_Type;
92  //@}
93 
94 
95  //! @name Constructors & Destructor
96  //@{
97 
98  //! Constructor using the finite element space and the data vector
99  ExpressionPatchArea (const ETFESpacePtr_Type feSpace )
100  : base_Type(), M_feSpace ( feSpace ) {}
101 
102  //! Copy constructor
103  ExpressionPatchArea (const ExpressionPatchArea<MeshType, MapType, SpaceDim, FieldDim>& expr)
104  : base_Type(), M_feSpace (expr.M_feSpace){}
105 
106  //! Destructor
107  ~ExpressionPatchArea() {}
108 
109  //@}
110 
111 
112  //! @name Methods
113  //@{
114 
115  //! Display method
116  static void display (std::ostream& out = std::cout)
117  {
118  out << "patch area" << std::endl;
119  }
120 
121  //@}
122 
123 
124  //! @name Get Methods
125  //@{
126 
127  //! Getter for the finite element space
128  const ETFESpacePtr_Type fespace() const
129  {
130  return M_feSpace;
131  }
132 
133  // @}
134 
135 private:
136 
137  //! @name Private Methods
138  //@{
139 
140  //! No default constructor
141  ExpressionPatchArea();
142 
143  //@}
144 
145  // Storage for the finite element space
146  ETFESpacePtr_Type M_feSpace;
147 };
148 
149 //! Simple function to be used in the construction of an expression
150 /*!
151  @author Samuel Quinodoz <samuel.quinodoz@epfl.ch>
152 
153  <b> Template parameters </b>
154 
155  <i>MeshType</i>: The type of the mesh stored in the finite element space
156 
157  <i>MapType</i>: The type of map used in the finite element space
158 
159  <i>SpaceDim</i>: The dimension of the ambient space.
160 
161  <i>FieldDim</i>: The dimension of the finite element space (scalar vs vectorial)
162 
163  <b> Template requirements </b>
164 
165  <i>MeshType</i>: Same as in LifeV::ETFESpace
166 
167  <i>MapType</i>: Same as in LifeV::ETFESpace
168 
169 */
170 template<typename MeshType, typename MapType, UInt SpaceDim, UInt FieldDim>
171 inline ExpressionPatchArea<MeshType, MapType, SpaceDim, FieldDim>
172 patchArea (const std::shared_ptr<ETFESpace<MeshType, MapType, SpaceDim, FieldDim> > fespace)
173 {
174  return ExpressionPatchArea<MeshType, MapType, SpaceDim, FieldDim> ( fespace );
175 }
176 
177 
178 } // Namespace ExpressionAssembly
179 
180 } // Namespace LifeV
181 
182 #endif
void updateInverseJacobian(const UInt &iQuadPt)
class ExpressionBase Base class (static polymorphism, CRTP sense) for all the expressions used in ass...
uint32_type UInt
generic unsigned integer (used mainly for addressing)
Definition: LifeV.hpp:191