BuildGraph.hpp 3.64 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
//@HEADER
/*
*******************************************************************************

   Copyright (C) 2004, 2005, 2007 EPFL, Politecnico di Milano, INRIA
   Copyright (C) 2010 EPFL, Politecnico di Milano, Emory UNiversity

   This file is part of the LifeV library

   LifeV is free software; you can redistribute it and/or modify
   it under the terms of the GNU Lesser General Public License as published by
   the Free Software Foundation; either version 3 of the License, or
   (at your option) any later version.

   LifeV is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, see <http://www.gnu.org/licenses/>


*******************************************************************************
*/
//@HEADER

/*!
 *   @file
     @brief This file contains the definition of the buildGraph function.

     This function is used to precompute the graph of a finite element
     matrix, allowing the matrix to be build in closed, optimized form,
     which makes the assembly procedure more efficient

     @date 03/2013
     @author Radu Popescu <radu.popescu@epfl.ch>
 */

#ifndef BUILD_GRAPH_HPP
#define BUILD_GRAPH_HPP

#include <lifev/core/LifeV.hpp>

#include <lifev/eta/expression/RequestLoopElement.hpp>

#include <lifev/core/fem/QuadratureRule.hpp>

#include <lifev/eta/expression/GraphElement.hpp>

#include <boost/shared_ptr.hpp>

namespace LifeV
{

/*!
  \namespace ExpressionAssembly

  Namespace for the assembly via expressions

 */
namespace ExpressionAssembly
{

//! Function to precompute the matrix graph
/*!
  @author Radu Popescu <radu.popescu@epfl.ch>

  This is a helper function to precompute the Crs graph used to build
  a FECrsMatrix in closed optimized form
 */
template < typename MeshType,
73
74
75
76
77
78
79
80
81
82
83
         typename TestSpaceType,
         typename SolutionSpaceType,
         typename ExpressionType >
GraphElement < MeshType,
             TestSpaceType,
             SolutionSpaceType,
             ExpressionType >
             buildGraph ( const RequestLoopElement<MeshType>& request,
                          const QuadratureRule& quadrature,
                          const boost::shared_ptr<TestSpaceType>& testSpace,
                          const boost::shared_ptr<SolutionSpaceType>& solutionSpace,
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
                          const ExpressionType& expression,
                          const UInt offsetUp = 0,
                          const UInt offsetLeft = 0);
template < typename MeshType,
         typename TestSpaceType,
         typename SolutionSpaceType,
         typename ExpressionType >
GraphElement < MeshType,
             TestSpaceType,
             SolutionSpaceType,
             ExpressionType >
             buildGraph ( const RequestLoopElement<MeshType>& request,
                          const QuadratureRule& quadrature,
                          const boost::shared_ptr<TestSpaceType>& testSpace,
                          const boost::shared_ptr<SolutionSpaceType>& solutionSpace,
                          const ExpressionType& expression,
                          const UInt offsetUp,
                          const UInt offsetLeft)
102
{
103
104
105
106
    return GraphElement < MeshType,
           TestSpaceType,
           SolutionSpaceType,
           ExpressionType >
107
108
           (request.mesh(), quadrature, testSpace, solutionSpace, expression,
            offsetUp, offsetLeft );
109
110
}

111

112
113
114
115
116
} // Namespace ExpressionAssembly

} // Namespace LifeV

#endif // BUILD_GRAPH_HPP