point_locator_base.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_BASE_H
21 #define LIBMESH_POINT_LOCATOR_BASE_H
22 
23 // Local Includes
25 #include "libmesh/libmesh_common.h"
26 #include "libmesh/auto_ptr.h" // deprecated
27 
28 #ifdef LIBMESH_FORWARD_DECLARE_ENUMS
29 namespace libMesh
30 {
31 enum PointLocatorType : int;
32 }
33 #else
35 #endif
36 
37 // C++ includes
38 #include <cstddef>
39 #include <vector>
40 #include <memory>
41 
42 namespace libMesh
43 {
44 
45 // Forward Declarations
46 class PointLocatorBase;
47 class MeshBase;
48 class Point;
49 class TreeBase;
50 class Elem;
51 class Node;
52 
53 
62 class PointLocatorBase : public ReferenceCountedObject<PointLocatorBase>
63 {
64 protected:
71  const PointLocatorBase * master);
72 
73 public:
77  virtual ~PointLocatorBase ();
78 
85  static std::unique_ptr<PointLocatorBase> build (PointLocatorType t,
86  const MeshBase & mesh,
87  const PointLocatorBase * master = nullptr);
88 
92  virtual void clear() = 0;
93 
98  virtual void init() = 0;
99 
105  virtual const Elem * operator() (const Point & p,
106  const std::set<subdomain_id_type> * allowed_subdomains = nullptr) const = 0;
107 
112  virtual void operator() (const Point & p,
113  std::set<const Elem *> & candidate_elements,
114  const std::set<subdomain_id_type> * allowed_subdomains = nullptr) const = 0;
115 
132  virtual const Node *
133  locate_node (const Point & p,
134  const std::set<subdomain_id_type> * allowed_subdomains = nullptr,
135  Real tol = TOLERANCE) const;
136 
141  bool initialized () const;
142 
149  virtual void enable_out_of_mesh_mode () = 0;
150 
156  virtual void disable_out_of_mesh_mode () = 0;
157 
162  virtual void set_close_to_point_tol(Real close_to_point_tol);
163 
168  virtual void unset_close_to_point_tol();
169 
173  const MeshBase & get_mesh() const;
174 
178  bool _verbose;
179 
180 protected:
187 
191  const MeshBase & _mesh;
192 
197 
203 
208 };
209 
210 } // namespace libMesh
211 
212 #endif // LIBMESH_POINT_LOCATOR_BASE_H
virtual void disable_out_of_mesh_mode()=0
A geometric point in (x,y,z) space associated with a DOF.
Definition: node.h:52
virtual void set_close_to_point_tol(Real close_to_point_tol)
The base class for all geometric element types.
Definition: elem.h:100
MeshBase & mesh
static const Real TOLERANCE
virtual void init()=0
Base class for Mesh.
Definition: mesh_base.h:77
virtual void clear()=0
virtual const Node * locate_node(const Point &p, const std::set< subdomain_id_type > *allowed_subdomains=nullptr, Real tol=TOLERANCE) const
PointLocatorBase(const MeshBase &mesh, const PointLocatorBase *master)
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 =0
const PointLocatorBase * _master
virtual void unset_close_to_point_tol()
virtual void enable_out_of_mesh_mode()=0
static std::unique_ptr< PointLocatorBase > build(PointLocatorType t, const MeshBase &mesh, const PointLocatorBase *master=nullptr)
A geometric point in (x,y,z) space.
Definition: point.h:38
const MeshBase & get_mesh() const