LifeV
MatrixGraph.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 MatrixGraph class.
31 
32  This function is used to perform an efficient assembly of FE matrices
33  graph.
34 
35  @date 06/2016
36  @author Davide Forti <davide.forti@epfl.ch>
37  */
38 
39 #ifndef MATRIXGRAPH_HPP
40 #define MATRIXGRAPH_HPP
41 
42 #include <lifev/core/LifeV.hpp>
43 #include <lifev/core/mesh/RegionMesh.hpp>
44 #include <lifev/core/fem/ReferenceFE.hpp>
45 #include <lifev/core/fem/CurrentFE.hpp>
46 #include <lifev/core/fem/FESpace.hpp>
47 #include <Epetra_FECrsGraph.h>
48 
49 namespace LifeV
50 {
51 
53 {
54 public:
55 
57  typedef boost::shared_ptr<mesh_Type> meshPtr_Type;
58 
60  typedef boost::shared_ptr< comm_Type > commPtr_Type;
61 
63  typedef boost::shared_ptr<graph_Type> graphPtr_Type;
64 
65  typedef FESpace<mesh_Type, MapEpetra> fespace_Type;
66  typedef boost::shared_ptr<fespace_Type> fespacePtr_Type;
67 
68  //! Constructor
69  /*!
70  * @param mesh - input mesh
71  * @param comm - communicator
72  */
73  MatrixGraph( const meshPtr_Type& mesh, const commPtr_Type& comm, const ReferenceFE* refFE );
74 
75  //! Destructor
76  ~MatrixGraph();
77 
78  //! @name Methods
79  //@{
80 
81  //! Build the matrix graph
82  /*!
83  * @param numElements - data file
84  * @param fe - current FE
85  * @param fespace - FE space
86  */
87  void buildGraph( const int& numElements, CurrentFE* fe, const fespacePtr_Type& fespace, graphPtr_Type& matrix_graph );
88 
89  //@}
90 
91 private:
92 
95 
98 
99  double ** M_elements;
101 
102  int** M_rows;
103  int** M_cols;
104 
105  // methods
106 
107 };
108 
109 } // Namespace LifeV
110 
111 #endif // MATRIXGRAPH_HPP
void buildGraph(const int &numElements, CurrentFE *fe, const fespacePtr_Type &fespace, graphPtr_Type &matrix_graph)
Build the matrix graph.
Definition: MatrixGraph.cpp:41
commPtr_Type M_comm
Definition: MatrixGraph.hpp:94
RegionMesh< LinearTetra > mesh_Type
Definition: MatrixGraph.hpp:56
const ReferenceFE * M_referenceFE
Epetra_FECrsGraph graph_Type
Definition: MatrixGraph.hpp:62
void updateInverseJacobian(const UInt &iQuadPt)
~MatrixGraph()
Destructor.
Definition: MatrixGraph.cpp:19
Epetra_Import const & importer()
Getter for the Epetra_Import.
Definition: MapEpetra.cpp:394
boost::shared_ptr< graph_Type > graphPtr_Type
Definition: MatrixGraph.hpp:63
Epetra_Comm comm_Type
Definition: MatrixGraph.hpp:59
CurrentFE - A primordial class for the assembly of the local matrices/vectors retaining the values on...
Definition: CurrentFE.hpp:243
The class for a reference Lagrangian finite element.
FESpace< mesh_Type, MapEpetra > fespace_Type
Definition: MatrixGraph.hpp:65
double ** M_elements
Definition: MatrixGraph.hpp:99
boost::shared_ptr< fespace_Type > fespacePtr_Type
Definition: MatrixGraph.hpp:66
meshPtr_Type M_mesh
Definition: MatrixGraph.hpp:93
MatrixGraph(const meshPtr_Type &mesh, const commPtr_Type &comm, const ReferenceFE *refFE)
Constructor.
Definition: MatrixGraph.cpp:11
boost::shared_ptr< comm_Type > commPtr_Type
Definition: MatrixGraph.hpp:60
boost::shared_ptr< mesh_Type > meshPtr_Type
Definition: MatrixGraph.hpp:57