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_PARTITIONER_H
21 #define LIBMESH_PARTITIONER_H
22 
23 // Local Includes -----------------------------------
24 #include "libmesh/libmesh.h"
25 #include "libmesh/auto_ptr.h"
26 #include "libmesh/id_types.h"
27 
28 // C++ Includes -----------------------------------
29 #include <cstddef>
30 
31 namespace libMesh
32 {
33 
34 // Forward Declarations
35 class MeshBase;
36 class ErrorVector;
37 
38 
46 // ------------------------------------------------------------
47 // Partitioner class definition
49 {
50  public:
51 
55  Partitioner ():_weights(NULL) {}
56 
60  virtual ~Partitioner() {}
61 
68  virtual AutoPtr<Partitioner> clone () const = 0;
69 
70 
77  void partition (MeshBase& mesh,
78  const unsigned int n);
79 
86  void partition (MeshBase& mesh);
87 
94  void repartition (MeshBase& mesh,
95  const unsigned int n);
96 
102  void repartition (MeshBase& mesh);
103 
108 
110  const unsigned int n);
111 
117  static void set_parent_processor_ids(MeshBase& mesh);
118 
124  static void set_node_processor_ids(MeshBase& mesh);
125 
131  virtual void attach_weights(ErrorVector * /*weights*/) { libmesh_not_implemented(); }
132 
133 protected:
134 
142 
148  virtual void _do_partition(MeshBase& mesh,
149  const unsigned int n) = 0;
150 
156  virtual void _do_repartition (MeshBase& mesh,
157  const unsigned int n) { this->_do_partition (mesh, n); }
158 
164 
169 };
170 
171 
172 } // namespace libMesh
173 
174 
175 
176 #endif // LIBMESH_PARTITIONER_H

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

Hosted By:
SourceForge.net Logo