LifeV
Evaluate.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 integrate function.
31 
32  @date 06/2011
33  @author Samuel Quinodoz <samuel.quinodoz@epfl.ch>
34  */
35 
36 #ifndef EVALUATE_HPP
37 #define EVALUATE_HPP
38 
39 #include <lifev/core/LifeV.hpp>
40 
41 #include <lifev/eta/expression/RequestLoopElement.hpp>
42 #include <lifev/eta/expression/RequestLoopFaceID.hpp>
43 
44 #include <lifev/core/fem/QuadratureRule.hpp>
45 #include <lifev/eta/fem/QRAdapterBase.hpp>
46 #include <lifev/eta/fem/QRAdapterNeverAdapt.hpp>
47 
48 #include <lifev/eta/expression/EvaluateNodalExpressionVectorElement.hpp>
49 #include <lifev/eta/expression/EvaluateNodalExpressionVectorElementFaceID.hpp>
50 
51 namespace LifeV
52 {
53 
54 /*!
55  \namespace ExpressionAssembly
56 
57  Namespace for the assembly via expressions
58 
59  */
60 namespace ExpressionAssembly
61 {
62 
63 
64 //! Integrate function for vectorial expressions
65 /*!
66  @author Samuel Quinodoz <samuel.quinodoz@epfl.ch>
67 
68  This class is an helper function to instantiate the class
69  for performing an integration, here to assemble a vector
70  with a loop on the elements.
71  */
72 template < typename MeshType, typename SolutionSpaceType, typename ExpressionType, typename QRAdapterType>
73 EvaluateNodalExpressionVectorElement<MeshType, SolutionSpaceType, ExpressionType, QRAdapterType>
74 evaluateNode ( const RequestLoopElement<MeshType>& request,
75  const QRAdapterBase<QRAdapterType>& qrAdapterBase,
76  const std::shared_ptr<SolutionSpaceType>& solutionSpace,
77  const ExpressionType& expression)
78 {
79  return EvaluateNodalExpressionVectorElement<MeshType, SolutionSpaceType, ExpressionType, QRAdapterType>
80  (request.mesh(), qrAdapterBase.implementation(), solutionSpace, expression);
81 }
82 
83 template < typename MeshType, typename SolutionSpaceType, typename ExpressionType>
84 EvaluateNodalExpressionVectorElement<MeshType, SolutionSpaceType, ExpressionType, QRAdapterNeverAdapt>
85 evaluateNode ( const RequestLoopElement<MeshType>& request,
86  const QuadratureRule& quadrature,
87  const std::shared_ptr<SolutionSpaceType>& solutionSpace,
88  const ExpressionType& expression)
89 {
90  return EvaluateNodalExpressionVectorElement<MeshType, SolutionSpaceType, ExpressionType, QRAdapterNeverAdapt>
91  (request.mesh(), QRAdapterNeverAdapt (quadrature), solutionSpace, expression);
92 }
93 
94 template < typename MeshType, typename SolutionSpaceType, typename ExpressionType>
95 EvaluateNodalExpressionVectorElementFaceID<MeshType, SolutionSpaceType, ExpressionType>
96 evaluateNode ( const RequestLoopFaceID<MeshType>& request,
97  const QuadratureBoundary& quadrature,
98  const std::shared_ptr<SolutionSpaceType>& solutionSpace,
99  const ExpressionType& expression)
100 {
101  return EvaluateNodalExpressionVectorElementFaceID<MeshType, SolutionSpaceType, ExpressionType>
102  (request.mesh(), request.id(), quadrature, solutionSpace, expression);
103 }
104 
105 
106 } // Namespace ExpressionAssembly
107 
108 } // Namespace LifeV
109 #endif
QuadratureRule - The basis class for storing and accessing quadrature rules.