parmetis_partitioner.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2014 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
3 
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License, or (at your option) any later version.
8 
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
13 
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 
18 
19 
20 #ifndef LIBMESH_PARMETIS_PARTITIONER_H
21 #define LIBMESH_PARMETIS_PARTITIONER_H
22 
23 // Local Includes -----------------------------------
24 #include "libmesh/id_types.h"
25 #include "libmesh/partitioner.h"
26 #include "libmesh/vectormap.h"
27 
28 // C++ Includes -----------------------------------
29 #include <cstddef>
30 #include <vector>
31 
32 namespace libMesh
33 {
34 
35 
36 
42 // ------------------------------------------------------------
43 // ParmetisPartitioner class definition
45 {
46  public:
47 
52 
57  virtual AutoPtr<Partitioner> clone () const {
58  AutoPtr<Partitioner> cloned_partitioner
59  (new ParmetisPartitioner());
60  return cloned_partitioner;
61  }
62 
63 
64 protected:
65 
72  virtual void _do_repartition (MeshBase& mesh,
73  const unsigned int n);
74 
78  virtual void _do_partition (MeshBase& mesh,
79  const unsigned int n);
80 
81 private:
82 
83 // These methods & data only need to be available if the
84 // ParMETIS library is available.
85 #ifdef LIBMESH_HAVE_PARMETIS
86 
90  void initialize (const MeshBase& mesh, const unsigned int n_sbdmns);
91 
95  void build_graph (const MeshBase& mesh);
96 
101 
107  std::vector<dof_id_type> _n_active_elem_on_proc;
108 
113 
118  std::vector<int> _vtxdist;
119  std::vector<int> _xadj;
120  std::vector<int> _adjncy;
121  std::vector<int> _part;
122  std::vector<float> _tpwgts;
123  std::vector<float> _ubvec;
124  std::vector<int> _options;
125  std::vector<int> _vwgt;
126 
127  int _wgtflag;
128  int _ncon;
129  int _numflag;
130  int _nparts;
131  int _edgecut;
132 
133 #endif
134 };
135 
136 
137 } // namespace libMesh
138 
139 
140 
141 #endif // LIBMESH_PARMETIS_PARTITIONER_H

Site Created By: libMesh Developers
Last modified: February 07 2014 16:57:06 UTC

Hosted By:
SourceForge.net Logo