$extrastylesheet
patch.h
Go to the documentation of this file.
00001 
00002 // The libMesh Finite Element Library.
00003 // Copyright (C) 2002-2014 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
00004 
00005 // This library is free software; you can redistribute it and/or
00006 // modify it under the terms of the GNU Lesser General Public
00007 // License as published by the Free Software Foundation; either
00008 // version 2.1 of the License, or (at your option) any later version.
00009 
00010 // This library is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013 // Lesser General Public License for more details.
00014 
00015 // You should have received a copy of the GNU Lesser General Public
00016 // License along with this library; if not, write to the Free Software
00017 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 
00019 
00020 
00021 #ifndef LIBMESH_PATCH_H
00022 #define LIBMESH_PATCH_H
00023 
00024 // Local includes
00025 #include "libmesh/id_types.h"
00026 
00027 // C++ includes
00028 #include <vector>
00029 #include <string>
00030 #include <set>
00031 
00032 namespace libMesh
00033 {
00034 
00035 // Forward Declarations
00036 class Elem;
00037 
00038 
00039 
00047 class Patch : public std::set<const Elem *>
00048 {
00049 public:
00050 
00054   Patch(const processor_id_type my_procid = static_cast<processor_id_type>(-1)) :
00055     _my_procid(my_procid)
00056   {}
00057 
00061   ~Patch() {}
00062 
00067   void add_face_neighbors();
00068 
00073   void add_local_face_neighbors();
00074 
00080   void add_semilocal_face_neighbors();
00081 
00086   void add_point_neighbors();
00087 
00092   void add_local_point_neighbors();
00093 
00099   void add_semilocal_point_neighbors();
00100 
00104   typedef void (Patch::*PMF)();
00105 
00113   void build_around_element(const Elem* elem,
00114                             const unsigned int target_patch_size = 10,
00115                             PMF patchtype = &Patch::add_local_face_neighbors);
00116 
00117 protected:
00118 
00123   void find_face_neighbors(std::set<const Elem *> &neighbor_set);
00124 
00129   void find_point_neighbors(std::set<const Elem *> &neighbor_set);
00130 
00131   const processor_id_type _my_procid;
00132 };
00133 
00134 } // namespace libMesh
00135 
00136 
00137 #endif // LIBMESH_PATCH_H