42 _out_of_mesh_mode(false),
43 _target_bin_size (200),
44 _build_type(Trees::
NODES)
57 _out_of_mesh_mode(false),
58 _target_bin_size (200),
59 _build_type(build_type)
76 if (this->
_tree !=
nullptr)
83 this->
_tree =
nullptr;
101 libmesh_assert (!this->
_tree);
106 libMesh::err <<
"Warning: PointLocatorTree already initialized! Will ignore this call..." << std::endl;
112 <<
"Your requested build_type, " << build_type <<
" will not be used!" << std::endl;
125 LOG_SCOPE(
"init(no master)",
"PointLocatorTree");
136 bool is_planar_xy =
false;
144 Dx = bbox.second(0) - bbox.first(0),
145 Dz = bbox.second(2) - bbox.first(2);
147 if (
std::abs(Dz/(Dx + 1.e-20)) < 1e-10)
170 cast_ptr<const PointLocatorTree *>(this->
_master);
175 libmesh_error_msg(
"ERROR: Initialize master first, then servants!");
194 const std::set<subdomain_id_type> * allowed_subdomains)
const 198 LOG_SCOPE(
"operator()",
"PointLocatorTree");
201 if (allowed_subdomains && this->
_element && !allowed_subdomains->count(this->_element->subdomain_id())) this->
_element =
nullptr;
217 libMesh::out <<
"Performing linear search using close-to-point tolerance " 246 libmesh_assert (!this->
_element || !allowed_subdomains || allowed_subdomains->count(this->_element->subdomain_id()));
254 std::set<const Elem *> & candidate_elements,
255 const std::set<subdomain_id_type> * allowed_subdomains)
const 259 LOG_SCOPE(
"operator() - Version 2",
"PointLocatorTree");
268 const std::set<subdomain_id_type> * allowed_subdomains,
269 bool use_close_to_point,
270 Real close_to_point_tolerance)
const 272 LOG_SCOPE(
"perform_linear_search",
"PointLocatorTree");
283 for (
const auto & elem : r)
285 if (!allowed_subdomains ||
286 allowed_subdomains->count(elem->subdomain_id()))
288 if (!use_close_to_point)
290 if (elem->contains_point(p))
295 if (elem->close_to_point(p, close_to_point_tolerance))
306 const std::set<subdomain_id_type> * allowed_subdomains,
307 Real close_to_point_tolerance)
const 309 LOG_SCOPE(
"perform_fuzzy_linear_search",
"PointLocatorTree");
311 std::set<const Elem *> candidate_elements;
322 for (
const auto & elem : r)
323 if ((!allowed_subdomains || allowed_subdomains->count(elem->subdomain_id())) && elem->close_to_point(p, close_to_point_tolerance))
324 candidate_elements.insert(elem);
326 return candidate_elements;
bool _use_close_to_point_tol
Tree class templated on the number of leaves on each node.
virtual void init() override
unsigned int get_target_bin_size() const
The base class for all geometric element types.
virtual SimpleRange< element_iterator > active_element_ptr_range()=0
virtual void disable_out_of_mesh_mode() override
virtual SimpleRange< element_iterator > active_local_element_ptr_range()=0
PointLocatorTree(const MeshBase &mesh, const PointLocatorBase *master=nullptr)
virtual bool contains_point(const Point &p, Real tol=TOLERANCE) const
virtual const Elem * find_element(const Point &p, const std::set< subdomain_id_type > *allowed_subdomains=nullptr, Real relative_tol=TOLERANCE) const =0
OStreamProxy err(std::cerr)
Trees::BuildType _build_type
unsigned int _target_bin_size
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
unsigned int mesh_dimension() const
BuildType
Base class for different Tree types.
const PointLocatorBase * _master
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)
OStreamProxy out(std::cout)
A geometric point in (x,y,z) space.
virtual void enable_out_of_mesh_mode() override
virtual void clear() override