point_locator_tree.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_POINT_LOCATOR_TREE_H
21 #define LIBMESH_POINT_LOCATOR_TREE_H
22 
23 // Local Includes
25 #include "libmesh/tree_base.h"
26 
27 // C++ includes
28 #include <cstddef>
29 
30 namespace libMesh
31 {
32 
33 // Forward Declarations
34 class MeshBase;
35 class Point;
36 class Elem;
37 
49 {
50 public:
60  const PointLocatorBase * master = nullptr);
61 
62 
75  const Trees::BuildType build_type,
76  const PointLocatorBase * master = nullptr);
77 
82 
86  virtual void clear() override;
87 
92  void init(Trees::BuildType build_type);
93 
98  virtual void init() override;
99 
107  virtual const Elem * operator() (const Point & p,
108  const std::set<subdomain_id_type> * allowed_subdomains = nullptr) const override;
109 
114  virtual void operator() (const Point & p,
115  std::set<const Elem *> & candidate_elements,
116  const std::set<subdomain_id_type> * allowed_subdomains = nullptr) const override;
117 
126  const Elem * perform_linear_search(const Point & p,
127  const std::set<subdomain_id_type> * allowed_subdomains,
128  bool use_close_to_point,
129  Real close_to_point_tolerance=TOLERANCE) const;
130 
136  std::set<const Elem *> perform_fuzzy_linear_search(const Point & p,
137  const std::set<subdomain_id_type> * allowed_subdomains,
138  Real close_to_point_tolerance=TOLERANCE) const;
139 
146  virtual void enable_out_of_mesh_mode () override;
147 
153  virtual void disable_out_of_mesh_mode () override;
154 
158  void set_target_bin_size(unsigned int target);
159 
163  unsigned int get_target_bin_size() const;
164 
165 protected:
172 
178  mutable const Elem * _element;
179 
185 
189  unsigned int _target_bin_size;
190 
195 };
196 
197 } // namespace libMesh
198 
199 #endif // LIBMESH_POINT_LOCATOR_TREE_H
virtual void init() override
unsigned int get_target_bin_size() const
The base class for all geometric element types.
Definition: elem.h:100
MeshBase & mesh
static const Real TOLERANCE
virtual void disable_out_of_mesh_mode() override
Base class for Mesh.
Definition: mesh_base.h:77
PointLocatorTree(const MeshBase &mesh, const PointLocatorBase *master=nullptr)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual const Elem * operator()(const Point &p, const std::set< subdomain_id_type > *allowed_subdomains=nullptr) const override
BuildType
Base class for different Tree types.
Definition: tree_base.h:55
const Elem * perform_linear_search(const Point &p, const std::set< subdomain_id_type > *allowed_subdomains, bool use_close_to_point, Real close_to_point_tolerance=TOLERANCE) const
std::set< const Elem * > perform_fuzzy_linear_search(const Point &p, const std::set< subdomain_id_type > *allowed_subdomains, Real close_to_point_tolerance=TOLERANCE) const
void set_target_bin_size(unsigned int target)
A geometric point in (x,y,z) space.
Definition: point.h:38
virtual void enable_out_of_mesh_mode() override
virtual void clear() override