20 #ifndef LIBMESH_TREE_NODE_H 21 #define LIBMESH_TREE_NODE_H 24 #include "libmesh/libmesh_common.h" 25 #include "libmesh/bounding_box.h" 26 #include "libmesh/point.h" 31 #include <unordered_map> 53 template <
unsigned int N>
120 Real relative_tol = 0)
const;
127 Real relative_tol = 0)
const;
132 unsigned int level ()
const;
167 const std::set<subdomain_id_type> * allowed_subdomains =
nullptr,
177 std::set<const Elem *> & candidate_elements,
178 const std::set<subdomain_id_type> * allowed_subdomains =
nullptr,
187 const std::set<subdomain_id_type> * allowed_subdomains,
188 Real relative_tol)
const;
195 std::set<const Elem *> & candidate_elements,
196 const std::set<subdomain_id_type> * allowed_subdomains,
197 Real relative_tol)
const;
218 std::vector<std::unique_ptr<TreeNode<N>>>
children;
262 template <
unsigned int N>
270 target_bin_size_increase_level(10),
271 contains_ifems (false)
284 template <
unsigned int N>
288 if (parent !=
nullptr)
289 return parent->level()+1;
299 #endif // LIBMESH_TREE_NODE_H unsigned int target_bin_size_increase_level
This specifies the refinement level beyond which we will scale up the target bin size in child TreeNo...
BoundingBox create_bounding_box(unsigned int c) const
Constructs the bounding box for child c.
A Node is like a Point, but with more information.
void refine()
Refine the tree node into N children if it contains more than tol nodes.
static constexpr Real TOLERANCE
const TreeNode< N > * parent
Pointer to this node's parent.
bool bounds_point(const Point &p, Real relative_tol=0) const
unsigned int n_active_bins() const
This is the base class from which all geometric element types are derived.
std::vector< const Node * > nodes
The node numbers contained in this portion of the tree.
void transform_nodes_to_elements(std::vector< std::vector< const Elem *>> &nodes_to_elem)
Transforms node numbers to element pointers.
bool bounds_node(const Node *nd, Real relative_tol=0) const
The libMesh namespace provides an interface to certain functionality in the library.
std::vector< const Elem * > elements
Pointers to the elements in this tree node.
This is the MeshBase class.
bool insert(const Node *nd)
Tries to insert Node nd into the TreeNode.
const Elem * find_element_in_children(const Point &p, const std::set< subdomain_id_type > *allowed_subdomains, Real relative_tol) const
Look for point p in our children, optionally restricted to a set of allowed subdomains.
std::vector< std::unique_ptr< TreeNode< N > > > children
Pointers to our children.
~TreeNode()=default
Destructor.
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
Fills candidate_elements with any elements containing the specified point p, optionally restricted to...
void print_nodes(std::ostream &out_stream=libMesh::out) const
Prints the contents of the node_numbers vector if we are active.
const unsigned int tgt_bin_size
The maximum number of things we should store before refining ourself.
BoundingBox bounding_box
The Cartesian bounding box for the node.
This class defines a node on a tree.
void find_elements_in_children(const Point &p, std::set< const Elem *> &candidate_elements, const std::set< subdomain_id_type > *allowed_subdomains, Real relative_tol) const
Look for points in our children, optionally restricted to a set of allowed subdomains.
Defines a Cartesian bounding box by the two corner extremum.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const MeshBase & mesh
Reference to the mesh.
unsigned int level() const
const Elem * find_element(const Point &p, const std::set< subdomain_id_type > *allowed_subdomains=nullptr, Real relative_tol=TOLERANCE) const
void print_elements(std::ostream &out_stream=libMesh::out) const
Prints the contents of the elements set if we are active.
void set_bounding_box(const std::pair< Point, Point > &bbox)
Sets the bounding box;.
A Point defines a location in LIBMESH_DIM dimensional Real space.
TreeNode(const MeshBase &m, unsigned int tbs, const TreeNode< N > *p=nullptr)
Constructor.
bool contains_ifems
Does this node contain any infinite elements.