Go to the documentation of this file.
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>
52 template <
unsigned int N>
114 Real relative_tol = 0)
const;
121 Real relative_tol = 0)
const;
126 unsigned int level ()
const;
161 const std::set<subdomain_id_type> * allowed_subdomains =
nullptr,
171 std::set<const Elem *> & candidate_elements,
172 const std::set<subdomain_id_type> * allowed_subdomains =
nullptr,
181 const std::set<subdomain_id_type> * allowed_subdomains,
182 Real relative_tol)
const;
189 std::set<const Elem *> & candidate_elements,
190 const std::set<subdomain_id_type> * allowed_subdomains,
191 Real relative_tol)
const;
256 template <
unsigned int N>
264 target_bin_size_increase_level(10),
265 contains_ifems (false)
278 template <
unsigned int N>
285 for (
auto c : children)
291 template <
unsigned int N>
295 if (parent !=
nullptr)
296 return parent->level()+1;
306 #endif // LIBMESH_TREE_NODE_H
const MeshBase & mesh
Reference to the mesh.
std::vector< const Elem * > elements
Pointers to the elements in this tree node.
std::vector< const Node * > nodes
The node numbers contained in this portion of the tree.
void print_elements(std::ostream &out=libMesh::out) const
Prints the contents of the elements set if we are active.
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...
BoundingBox create_bounding_box(unsigned int c) const
Constructs the bounding box for child c.
Defines a Cartesian bounding box by the two corner extremum.
The libMesh namespace provides an interface to certain functionality in the library.
const unsigned int tgt_bin_size
The maximum number of things we should store before refining ourself.
static const Real TOLERANCE
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.
This class defines a node on a tree.
bool contains_ifems
Does this node contain any infinite elements.
void refine()
Refine the tree node into N children if it contains more than tol nodes.
std::vector< TreeNode< N > * > children
Pointers to our children.
This is the MeshBase class.
void transform_nodes_to_elements(std::vector< std::vector< const Elem * >> &nodes_to_elem)
Transforms node numbers to element pointers.
BoundingBox bounding_box
The Cartesian bounding box for the node.
bool insert(const Node *nd)
Tries to insert Node nd into the TreeNode.
A Point defines a location in LIBMESH_DIM dimensional Real space.
A Node is like a Point, but with more information.
void set_bounding_box(const std::pair< Point, Point > &bbox)
Sets the bounding box;.
void print_nodes(std::ostream &out=libMesh::out) const
Prints the contents of the node_numbers vector if we are active.
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...
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.
bool bounds_point(const Point &p, Real relative_tol=0) const
unsigned int level() const
bool bounds_node(const Node *nd, Real relative_tol=0) const
const Elem * find_element(const Point &p, const std::set< subdomain_id_type > *allowed_subdomains=nullptr, Real relative_tol=TOLERANCE) const
This is the base class from which all geometric element types are derived.
unsigned int n_active_bins() const
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
TreeNode(const MeshBase &m, unsigned int tbs, const TreeNode< N > *p=nullptr)
Constructor.
const TreeNode< N > * parent
Pointer to this node's parent.