$extrastylesheet
point_locator_tree.h
Go to the documentation of this file.
00001 // The libMesh Finite Element Library.
00002 // Copyright (C) 2002-2014 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
00003 
00004 // This library is free software; you can redistribute it and/or
00005 // modify it under the terms of the GNU Lesser General Public
00006 // License as published by the Free Software Foundation; either
00007 // version 2.1 of the License, or (at your option) any later version.
00008 
00009 // This library is distributed in the hope that it will be useful,
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012 // Lesser General Public License for more details.
00013 
00014 // You should have received a copy of the GNU Lesser General Public
00015 // License along with this library; if not, write to the Free Software
00016 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017 
00018 
00019 
00020 #ifndef LIBMESH_POINT_LOCATOR_TREE_H
00021 #define LIBMESH_POINT_LOCATOR_TREE_H
00022 
00023 // Local Includes
00024 #include "libmesh/point_locator_base.h"
00025 #include "libmesh/tree_base.h"
00026 
00027 // C++ includes
00028 #include <cstddef>
00029 
00030 namespace libMesh
00031 {
00032 
00033 
00034 // Forward Declarations
00035 class MeshBase;
00036 class Point;
00037 class Elem;
00038 
00039 
00049 class PointLocatorTree : public PointLocatorBase
00050 {
00051 public:
00060   PointLocatorTree (const MeshBase& mesh,
00061                     const PointLocatorBase* master = NULL);
00062 
00063 
00075   PointLocatorTree (const MeshBase& mesh,
00076                     const Trees::BuildType build_type,
00077                     const PointLocatorBase* master = NULL);
00078 
00082   ~PointLocatorTree ();
00083 
00087   virtual void clear();
00088 
00093   void init(Trees::BuildType build_type);
00094 
00099   virtual void init();
00100 
00108   virtual const Elem* operator() (const Point& p, const std::set<subdomain_id_type> *allowed_subdomains = NULL) const;
00109 
00118   const Elem* perform_linear_search(const Point& p,
00119                                     const std::set<subdomain_id_type> *allowed_subdomains,
00120                                     bool use_close_to_point,
00121                                     Real close_to_point_tolerance=TOLERANCE) const;
00122 
00129   virtual void enable_out_of_mesh_mode ();
00130 
00136   virtual void disable_out_of_mesh_mode ();
00137 
00141   void set_target_bin_size(unsigned int target);
00142 
00146   unsigned int get_target_bin_size() const;
00147 
00148 protected:
00154   TreeBase* _tree;
00155 
00161   mutable const Elem* _element;
00162 
00167   bool _out_of_mesh_mode;
00168 
00172   unsigned int _target_bin_size;
00173 
00177   Trees::BuildType _build_type;
00178 };
00179 
00180 
00181 } // namespace libMesh
00182 
00183 #endif // LIBMESH_POINT_LOCATOR_TREE_H