Go to the documentation of this file.
   21 #include "libmesh/point_locator_base.h" 
   22 #include "libmesh/point_locator_tree.h" 
   23 #include "libmesh/elem.h" 
   24 #include "libmesh/enum_point_locator_type.h" 
   40   _use_close_to_point_tol  (false),
 
   73       return libmesh_make_unique<PointLocatorTree>(
mesh,  master);
 
   82       libmesh_error_msg(
"ERROR: Bad PointLocatorType = " << t);
 
  115             const std::set<subdomain_id_type> * allowed_subdomains,
 
  118   std::set<const Elem *> candidate_elements;
 
  119   this->
operator()(p, candidate_elements, allowed_subdomains);
 
  121   for (
const auto & elem : candidate_elements)
 
  123       const int elem_n_nodes = elem->n_nodes();
 
  124       const Real hmax = elem->hmax();
 
  125       const Real dist_tol_sq = (tol * hmax) * (tol * hmax);
 
  127       for (
int n=0; n != elem_n_nodes; ++n)
 
  128         if ((elem->point(n) - p).
norm_sq() < dist_tol_sq)
 
  129           return elem->node_ptr(n);
 
  
const PointLocatorBase * _master
Const pointer to our master, initialized to nullptr if none given.
 
virtual void set_close_to_point_tol(Real close_to_point_tol)
Set a tolerance to use when determining if a point is contained within the mesh.
 
The libMesh namespace provides an interface to certain functionality in the library.
 
static const Real TOLERANCE
 
Real _close_to_point_tol
The tolerance to use.
 
Real get_close_to_point_tol() const
Get the close-to-point tolerance.
 
bool _use_close_to_point_tol
true if we will use a user-specified tolerance for locating the element.
 
This is the MeshBase class.
 
static std::unique_ptr< PointLocatorBase > build(PointLocatorType t, const MeshBase &mesh, const PointLocatorBase *master=nullptr)
Builds an PointLocator for the mesh mesh.
 
virtual const Elem * operator()(const Point &p, const std::set< subdomain_id_type > *allowed_subdomains=nullptr) const =0
Locates the element in which the point with global coordinates p is located.
 
A Point defines a location in LIBMESH_DIM dimensional Real space.
 
A Node is like a Point, but with more information.
 
virtual const Node * locate_node(const Point &p, const std::set< subdomain_id_type > *allowed_subdomains=nullptr, Real tol=TOLERANCE) const
 
const MeshBase & get_mesh() const
Get a const reference to this PointLocator's mesh.
 
virtual ~PointLocatorBase()
Destructor.
 
const MeshBase & _mesh
constant reference to the mesh in which the point is looked for.
 
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
 
virtual void unset_close_to_point_tol()
Specify that we do not want to use a user-specified tolerance to determine if a point is contained wi...
 
This is the base class for point locators.
 
bool _initialized
true when properly initialized, false otherwise.
 
PointLocatorBase(const MeshBase &mesh, const PointLocatorBase *master)
Constructor.