centroid_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 #ifndef LIBMESH_CENTROID_PARTITIONER_H
20 #define LIBMESH_CENTROID_PARTITIONER_H
21 
22 // Local includes
23 #include "libmesh/partitioner.h"
24 #include "libmesh/point.h"
25 
26 // C++ includes
27 #include <utility> // pair
28 #include <vector>
29 
30 namespace libMesh
31 {
32 
33 
34 // Forward declarations
35 class Elem;
36 
37 
51 // CentroidPartitioner class definition
53 {
54 public:
55 
56 
63  Y,
64  Z,
67 
72  explicit
74 
79  virtual AutoPtr<Partitioner> clone () const {
80  AutoPtr<Partitioner> cloned_partitioner
82  return cloned_partitioner;
83  }
84 
89 
94 
95 
96 protected:
101  virtual void _do_partition (MeshBase& mesh,
102  const unsigned int n);
103 
104 private:
105 
112 
119  static bool sort_x (const std::pair<Point, Elem*>& lhs,
120  const std::pair<Point, Elem*>& rhs);
121 
128  static bool sort_y (const std::pair<Point, Elem*>& lhs,
129  const std::pair<Point, Elem*>& rhs);
130 
137  static bool sort_z (const std::pair<Point, Elem*>& lhs,
138  const std::pair<Point, Elem*>& rhs);
139 
140 
147  static bool sort_radial (const std::pair<Point, Elem*>& lhs,
148  const std::pair<Point, Elem*>& rhs);
149 
155 
160  std::vector<std::pair<Point, Elem*> > _elem_centroids;
161 };
162 
163 } // namespace libMesh
164 
165 
166 #endif // LIBMESH_CENTROID_PARTITIONER_H

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

Hosted By:
SourceForge.net Logo