LifeV
MeshColoring.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 containing a class for coloring meshes.
30 
31  @author D. Forti
32  @date 06-2016
33  */
34 
35 #ifndef MESHCOLORING_H
36 #define MESHCOLORING_H
37 
38 #include <lifev/core/LifeV.hpp>
39 #include <lifev/core/mesh/RegionMesh.hpp>
40 #include <lifev/core/array/VectorEpetra.hpp>
41 
42 namespace LifeV
43 {
44 
45 //! MeshData - class for coloring mesh.
46 /*!
47  @author D. Forti
48 
49  The class color the mesh
50  */
51 
53 {
54 public:
55 
58 
61 
64 
65  //! @name Constructors & Destructor
66  //@{
67 
68  //! Empty Constructor
69  MeshColoring( const commPtr_Type& communicator );
70 
71  //! Destructor
72  ~MeshColoring();
73 
74  //@}
75 
76 
77  //! @name Methods
78  //@{
79 
80  //! Print node to volume connections
81  void printNodesToVolumes ( );
82 
83  //! Print volume to node connections
84  void printVolumesToNodes ( );
85 
86  //! Print number of element neighbors per node
87  void printNumNeighbors ( );
88 
89  //! Print volume to volume connections
90  void printVolumesToVolumes ( );
91 
92  //! Print vector of colors
93  void printColors ( );
94 
95  //! Check if colors have been assigned correctly
96  /*!
97  @return integer to check if there have been errors
98  */
99  int performCheck ( );
100 
101  //! Initial setup of the class
102  void setup ( );
103 
104  //! Perform the coloring of the mesh
105  void colorMesh ( );
106 
107  //! Vector of colors for the assembly
108  void colorsForAssembly ( );
109 
110  //! Vector of colors used in the assembly
111  void printColorsForAssembly ( );
112 
113  //! Info about coloring
114  void printInfo ( );
115 
116  //@}
117 
118 
119  //! @name Set Methods
120  //@{
121 
122  //! Set the mesh
123  /*!
124  @param mesh mesh to be colored
125  */
126 
127  void setMesh ( const meshPtr_Type& local_mesh );
128 
129  //@}
130 
131 
132  //! @name Get Methods
133  //@{
134 
135  //! Get the VectorEpetra with colors
136  /*!
137  @return Vector of colors
138  */
140 
141  std::vector<std::vector<UInt>> getColorsForAssembly ( ) { return M_colorsForAssembly; }
142 
143  //@}
144 
145 private:
146 
147  // mesh
149 
150  // communicator
152 
153  // Element to Vertices connectivity
155 
156  // Vertices to Element connectivity
158 
160 
162 
164 
165  // Vector with colors
167 
168  // Number of colors
170 
171  // finding neighbors
173 
174  // epetra vector with colors
176 
178 
179 };
180 
181 
182 } // namespace LifeV
183 
184 #endif /* MESHCOLORING_H */
VectorEpetra - The Epetra Vector format Wrapper.
vectorPtr_Type M_vectorColors
std::shared_ptr< comm_Type > commPtr_Type
Epetra_Comm comm_Type
int performCheck()
Check if colors have been assigned correctly.
std::vector< std::vector< UInt > > getColorsForAssembly()
void printInfo()
Info about coloring.
std::vector< std::vector< UInt > > M_volumesToVolumes
void printVolumesToNodes()
Print volume to node connections.
void colorsForAssembly()
Vector of colors for the assembly.
void printNodesToVolumes()
Print node to volume connections.
void printColorsForAssembly()
Vector of colors used in the assembly.
void updateInverseJacobian(const UInt &iQuadPt)
void printVolumesToVolumes()
Print volume to volume connections.
~MeshColoring()
Destructor.
void setMesh(const meshPtr_Type &local_mesh)
Set the mesh.
MeshColoring(const commPtr_Type &communicator)
Empty Constructor.
Definition: MeshColoring.cpp:7
vectorPtr_Type getColors()
Get the VectorEpetra with colors.
std::vector< std::vector< UInt > > M_volumesToNodes
std::shared_ptr< mesh_Type > meshPtr_Type
std::vector< std::vector< UInt > > M_colorsForAssembly
std::vector< UInt > M_numNeighbors
void setup()
Initial setup of the class.
void colorMesh()
Perform the coloring of the mesh.
void printColors()
Print vector of colors.
std::shared_ptr< vector_Type > vectorPtr_Type
std::vector< std::vector< UInt > > M_nodesToVolumes
RegionMesh< LinearTetra > mesh_Type
VectorEpetra vector_Type
void printNumNeighbors()
Print number of element neighbors per node.
uint32_type UInt
generic unsigned integer (used mainly for addressing)
Definition: LifeV.hpp:191
std::vector< int > M_colors
MeshData - class for coloring mesh.