TreeRoot is a Tree that forms the root of a (recursive) tree. The "root node" is special as it holds additional information about its neighbours and their relative rotation (inside a TreeForest). More...
#include <tree.h>
Public Member Functions | |
TreeRoot (RefineableElement *const &object_pt) | |
Constructor for the (empty) root tree. More... | |
TreeRoot (const TreeRoot &dummy)=delete | |
Broken copy constructor. More... | |
void | operator= (const TreeRoot &)=delete |
Broken assignment operator. More... | |
TreeRoot *& | neighbour_pt (const int &direction) |
Return the pointer to the neighbouring TreeRoots in specified direction. Returns NULL if there's no neighbour in this direction. More... | |
bool | is_neighbour_periodic (const int &direction) |
Return whether the neighbour in the particular direction is periodic. More... | |
void | set_neighbour_periodic (const int &direction) |
Set the neighbour in particular direction to be periodic. More... | |
void | set_neighbour_nonperiodic (const int &direction) |
Set the neighbour in particular direction to be nonperiodic. More... | |
unsigned | nneighbour () |
Return the number of neighbours. More... | |
Public Member Functions inherited from oomph::Tree | |
virtual | ~Tree () |
Destructor. Note: Deleting a tree also deletes the objects associated with its non-leave nodes. More... | |
Tree (const Tree &dummy)=delete | |
Broken copy constructor. More... | |
void | operator= (const Tree &)=delete |
Broken assignment operator. More... | |
RefineableElement * | object_pt () const |
Return the pointer to the object (RefineableElement) represented by the tree. More... | |
void | flush_object () |
Flush the object represented by the tree. More... | |
Tree * | son_pt (const int &son_index) const |
Return pointer to the son for a given index. Note that to aid code readability specific enums have been defined for specific trees. However, these are simply aliases for ints and the general interface can be implemented once, here. More... | |
void | set_son_pt (const Vector< Tree * > &son_pt) |
Set vector of pointers to sons, indexed by the appropriate enum that identies son types. (To aid code readability specific enums have been defined for specific trees. However, these are simply aliases for ints and the general interface can be implemented once, here). More... | |
unsigned | nsons () const |
Return number of sons (zero if it's a leaf node) More... | |
void | flush_sons () |
Flush the sons. More... | |
TreeRoot *& | root_pt () |
Return pointer to root of the tree. More... | |
TreeRoot * | root_pt () const |
Return pointer to root of the tree (const version) More... | |
template<class ELEMENT > | |
void | split_if_required () |
If required, split the leaf and create its sons – criterion: bool object_pt()-> to_be_refined() = true. More... | |
template<class ELEMENT > | |
void | p_refine_if_required (Mesh *&mesh_pt) |
If required, p-refine the leaf – criterion: bool object_pt()-> to_be_p_refined() = true or bool object_pt()-> to_be_p_unrefined() = true. More... | |
void | merge_sons_if_required (Mesh *&mesh_pt) |
If required, merge the four sons for unrefinement – criterion: bool object_pt()-> sons_to_be_unrefined() = true. More... | |
void | deactivate_object () |
Call the RefineableElement's deactivate_element() function. More... | |
virtual Tree * | construct_son (RefineableElement *const &object_pt, Tree *const &father_pt, const int &son_type)=0 |
A function that constructs a specific type of tree. This MUST be overloaded for each specific tree type. The use of such a function allows the generic implementation of split_if_required(). More... | |
void | traverse_all (Tree::VoidMemberFctPt member_function) |
Traverse the tree and execute void Tree member function member_function() at all its "nodes". More... | |
void | traverse_all (Tree::VoidMeshPtArgumentMemberFctPt member_function, Mesh *&mesh_pt) |
Traverse the tree and excute void Tree member function that takes a pointer to a mesh as an argument. More... | |
void | traverse_all_but_leaves (Tree::VoidMemberFctPt member_function) |
Traverse the tree and execute void Tree member function member_function() at all its "nodes" aparat from the leaves. More... | |
void | traverse_leaves (Tree::VoidMemberFctPt member_function) |
Traverse the tree and execute void Tree member function member_function() only at its leaves. More... | |
void | traverse_leaves (Tree::VoidMeshPtArgumentMemberFctPt member_function, Mesh *&mesh_pt) |
Traverse the tree and execute void Tree member function that takes a pointer to a mesh as an argument only at its leaves. More... | |
void | stick_leaves_into_vector (Vector< Tree * > &) |
Traverse tree and stick pointers to leaf "nodes" (only) into Vector. More... | |
void | stick_all_tree_nodes_into_vector (Vector< Tree * > &) |
Traverse and stick pointers to all "nodes" into Vector. More... | |
int | son_type () const |
Return son type. More... | |
bool | is_leaf () |
Return true if the tree is a leaf node. More... | |
Tree * | father_pt () const |
Return pointer to father: NULL if it's a root node. More... | |
void | set_father_pt (Tree *const &father_pt) |
Set the father. More... | |
unsigned | level () const |
Return the level of the Tree (root=0) More... | |
Protected Attributes | |
std::map< int, TreeRoot * > | Neighbour_pt |
Map of pointers to the neighbouring TreeRoots: Neighbour_pt[direction] returns the pointer to the TreeRoot's neighbour in the (enumerated) direction. Returns NULL if there's no neighbour in this direction. More... | |
std::map< int, bool > | Neighbour_periodic |
Map of booleans used for periodic boundaries: Neighbour_periodic_direction[directon] returns true if the neighbour in that direction is actually a periodic neighbour — shared data values, but independent position. The default return of the map is false. More... | |
Protected Attributes inherited from oomph::Tree | |
TreeRoot * | Root_pt |
Pointer to the root of the tree. More... | |
Tree * | Father_pt |
Pointer to the Father of the Tree. More... | |
Vector< Tree * > | Son_pt |
Vector of pointers to the sons of the Tree. More... | |
int | Level |
Level of the Tree (level 0 = root) More... | |
int | Son_type |
Son type (e.g. SW/SE/NW/NE in a quadtree) More... | |
RefineableElement * | Object_pt |
Pointer to the object represented by the tree. More... | |
Additional Inherited Members | |
Public Types inherited from oomph::Tree | |
typedef void(Tree::* | VoidMemberFctPt) () |
Function pointer to argument-free void Tree member function. More... | |
typedef void(Tree::* | VoidMeshPtArgumentMemberFctPt) (Mesh *&mesh_pt) |
Function pointer to a void Tree member function that takes a pointer to a mesh as its argument. More... | |
Static Public Member Functions inherited from oomph::Tree | |
static double & | max_neighbour_finding_tolerance () |
Max. allowed discrepancy in neighbour finding routine (distance between points when identified from two neighbouring elements) More... | |
Static Public Attributes inherited from oomph::Tree | |
static const int | OMEGA = 26 |
Default value for an unassigned neighbour. More... | |
Protected Member Functions inherited from oomph::Tree | |
Tree () | |
Default constructor (empty and broken) More... | |
Tree (RefineableElement *const &object_pt) | |
Default constructor for empty (root) tree: no father, no sons; just pass a pointer to its object Protected because Trees can only be created internally, during the split operation. Only TreeRoots can be created externally. More... | |
Tree (RefineableElement *const &object_pt, Tree *const &father_pt, const int &son_type) | |
Constructor for tree that has a father: Pass it the pointer to its object, the pointer to its father and tell it what type of son it is. Protected because Trees can only be created internally, during the split operation. Only TreeRoots can be created externally. More... | |
Static Protected Attributes inherited from oomph::Tree | |
static double | Max_neighbour_finding_tolerance = 1.0e-14 |
Max. allowed discrepancy in neighbour finding routine (distance between points when identified from two neighbouring elements) More... | |
TreeRoot is a Tree that forms the root of a (recursive) tree. The "root node" is special as it holds additional information about its neighbours and their relative rotation (inside a TreeForest).
|
inline |
Constructor for the (empty) root tree.
Definition at line 342 of file tree.h.
References oomph::Tree::Root_pt.
|
delete |
Broken copy constructor.
|
inline |
Return whether the neighbour in the particular direction is periodic.
Definition at line 364 of file tree.h.
References Neighbour_periodic.
Referenced by oomph::PRefineableQElement< 2, INITIAL_NNODE_1D >::check_integrity(), oomph::RefineableQElement< 3 >::check_integrity(), oomph::RefineableQElement< 1 >::check_integrity(), oomph::RefineableQElement< 2 >::check_integrity(), oomph::OcTree::doc_face_neighbours(), oomph::BinaryTree::doc_neighbours(), oomph::QuadTree::doc_neighbours(), oomph::OcTree::doc_true_edge_neighbours(), oomph::RefineableQElement< 3 >::oc_hang_helper(), and oomph::RefineableQElement< 2 >::quad_hang_helper().
|
inline |
Return the pointer to the neighbouring TreeRoots in specified direction. Returns NULL if there's no neighbour in this direction.
Definition at line 357 of file tree.h.
References Neighbour_pt.
Referenced by oomph::BinaryTree::gteq_edge_neighbour(), oomph::QuadTree::gteq_edge_neighbour(), and oomph::OcTree::gteq_face_neighbour().
|
inline |
|
delete |
Broken assignment operator.
|
inline |
Set the neighbour in particular direction to be nonperiodic.
Definition at line 376 of file tree.h.
References Neighbour_periodic.
|
inline |
Set the neighbour in particular direction to be periodic.
Definition at line 370 of file tree.h.
References Neighbour_periodic.
|
protected |
Map of booleans used for periodic boundaries: Neighbour_periodic_direction[directon] returns true if the neighbour in that direction is actually a periodic neighbour — shared data values, but independent position. The default return of the map is false.
Definition at line 338 of file tree.h.
Referenced by is_neighbour_periodic(), set_neighbour_nonperiodic(), and set_neighbour_periodic().
|
protected |
Map of pointers to the neighbouring TreeRoots: Neighbour_pt[direction] returns the pointer to the TreeRoot's neighbour in the (enumerated) direction. Returns NULL if there's no neighbour in this direction.
Definition at line 330 of file tree.h.
Referenced by oomph::BinaryTreeRoot::direction_of_neighbour(), oomph::QuadTreeRoot::direction_of_neighbour(), oomph::OcTreeRoot::direction_of_neighbour(), neighbour_pt(), and nneighbour().