Go to the documentation of this file.
23 #include "libmesh/tree.h"
24 #include "libmesh/mesh_base.h"
25 #include "libmesh/mesh_tools.h"
36 template <
unsigned int N>
38 unsigned int target_bin_size,
41 root(m,target_bin_size),
55 bool node_was_inserted =
64 std::unordered_map<dof_id_type, std::vector<const Elem *>> nodes_to_elem;
67 root.transform_nodes_to_elements (nodes_to_elem);
77 bool elem_was_inserted =
91 bool elem_was_inserted =
99 libmesh_error_msg(
"Unknown build_type = " <<
build_type);
105 template <
unsigned int N>
108 root (other_tree.root),
109 build_type (other_tree.build_type)
111 libmesh_not_implemented();
119 template <
unsigned int N>
122 my_out <<
"Printing nodes...\n";
123 root.print_nodes(my_out);
128 template <
unsigned int N>
131 my_out <<
"Printing elements...\n";
132 root.print_elements(my_out);
137 template <
unsigned int N>
140 const std::set<subdomain_id_type> * allowed_subdomains,
141 Real relative_tol)
const
143 return root.find_element(p, allowed_subdomains, relative_tol);
148 template <
unsigned int N>
151 std::set<const Elem *> & candidate_elements,
152 const std::set<subdomain_id_type> * allowed_subdomains,
153 Real relative_tol)
const
155 return root.find_elements(p, candidate_elements, allowed_subdomains, relative_tol);
160 template <
unsigned int N>
163 const std::set<subdomain_id_type> * allowed_subdomains,
164 Real relative_tol)
const
166 return this->find_element(p, allowed_subdomains, relative_tol);
const Trees::BuildType build_type
How the tree is built.
const MeshBase & mesh
Constant reference to a mesh.
virtual void find_elements(const Point &p, std::set< const Elem * > &candidate_elements, const std::set< subdomain_id_type > *allowed_subdomains=nullptr, Real relative_tol=TOLERANCE) const override
Fills candidate_elements with any elements containing the specified point p, optionally restricted to...
virtual SimpleRange< element_iterator > active_local_element_ptr_range()=0
virtual SimpleRange< element_iterator > active_element_ptr_range()=0
The libMesh namespace provides an interface to certain functionality in the library.
TreeNode< N > root
The tree root.
virtual void print_nodes(std::ostream &my_out=libMesh::out) const override
Prints the nodes.
BuildType
enum defining how to build the tree.
This is the MeshBase class.
virtual SimpleRange< node_iterator > node_ptr_range()=0
A Point defines a location in LIBMESH_DIM dimensional Real space.
This is the base class for trees, it allows pointer usage of trees.
const Elem * operator()(const Point &p, const std::set< subdomain_id_type > *allowed_subdomains=nullptr, Real relative_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 override
This is the base class from which all geometric element types are derived.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
This class defines a tree that may be used for fast point location in space.
virtual void print_elements(std::ostream &my_out=libMesh::out) const override
Prints the nodes.
Tree(const MeshBase &m, unsigned int target_bin_size, Trees::BuildType bt=Trees::NODES)
Constructor.