patch.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2018 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_PATCH_H
21 #define LIBMESH_PATCH_H
22 
23 // Local includes
24 #include "libmesh/id_types.h"
25 
26 // C++ includes
27 #include <vector>
28 #include <string>
29 #include <set>
30 
31 namespace libMesh
32 {
33 
34 // Forward Declarations
35 class Elem;
36 
47 class Patch : public std::set<const Elem *>
48 {
49 public:
50 
54  Patch(const processor_id_type my_procid = static_cast<processor_id_type>(-1)) :
55  _my_procid(my_procid)
56  {}
57 
61  ~Patch() {}
62 
67  void add_face_neighbors();
68 
74 
81 
86  void add_point_neighbors();
87 
93 
100 
104  typedef void (Patch::*PMF)();
105 
113  void build_around_element(const Elem * elem,
114  const unsigned int target_patch_size = 10,
115  PMF patchtype = &Patch::add_local_face_neighbors);
116 
117 protected:
118 
123  void find_face_neighbors(std::set<const Elem *> & neighbor_set);
124 
129  void find_point_neighbors(std::set<const Elem *> & neighbor_set);
130 
132 };
133 
134 } // namespace libMesh
135 
136 
137 #endif // LIBMESH_PATCH_H
void add_local_point_neighbors()
Definition: patch.C:129
The base class for all geometric element types.
Definition: elem.h:100
uint8_t processor_id_type
Definition: id_types.h:99
Patch(const processor_id_type my_procid=static_cast< processor_id_type >(-1))
Definition: patch.h:54
void build_around_element(const Elem *elem, const unsigned int target_patch_size=10, PMF patchtype=&Patch::add_local_face_neighbors)
Definition: patch.C:156
void find_face_neighbors(std::set< const Elem *> &neighbor_set)
Definition: patch.C:37
void add_point_neighbors()
Definition: patch.C:118
void add_semilocal_point_neighbors()
Definition: patch.C:143
void add_local_face_neighbors()
Definition: patch.C:75
void find_point_neighbors(std::set< const Elem *> &neighbor_set)
Definition: patch.C:102
void(Patch::* PMF)()
Definition: patch.h:104
void add_face_neighbors()
Definition: patch.C:64
void add_semilocal_face_neighbors()
Definition: patch.C:89
const processor_id_type _my_procid
Definition: patch.h:131