Public Member Functions | List of all members
oomph::BinaryTreeRoot Class Reference

BinaryTreeRoot is a BinaryTree that forms the root of a (recursive) binary tree. The "root node" is special as it holds additional information about its neighbours. More...

#include <binary_tree.h>

+ Inheritance diagram for oomph::BinaryTreeRoot:

Public Member Functions

 BinaryTreeRoot (RefineableElement *const &object_pt)
 Constructor for the (empty) root binary tree: Pass pointer to associated object, a RefineableQElement<1>. More...
 
 BinaryTreeRoot (const BinaryTreeRoot &dummy)=delete
 Broken copy constructor. More...
 
void operator= (const BinaryTreeRoot &)=delete
 Broken assignment operator. More...
 
int direction_of_neighbour (BinaryTreeRoot *binary_tree_root_pt)
 If binary_tree_root_pt is a neighbour, return the direction (L/R) in which it is found, otherwise return OMEGA. More...
 
- Public Member Functions inherited from oomph::BinaryTree
virtual ~BinaryTree ()
 Destructor. Note: Deleting a binary tree also deletes the objects associated with all non-leaf nodes! More...
 
 BinaryTree (const BinaryTree &dummy)=delete
 Broken copy constructor. More...
 
void operator= (const BinaryTree &)=delete
 Broken assignment operator. More...
 
Treeconstruct_son (RefineableElement *const &object_pt, Tree *const &father_pt, const int &son_type)
 Overload the function construct_son to ensure that the son is a specific BinaryTree and not a general Tree. More...
 
BinaryTreegteq_edge_neighbour (const int &direction, Vector< double > &s_in_neighbour, int &edge, int &diff_level, bool &in_neighbouring_tree) const
 Return pointer to greater or equal-sized edge neighbour in specified direction; also provide info regarding the relative size of the neighbour: More...
 
unsigned self_test ()
 Self-test: Check all neighbours. Return success (0) if the maximum distance between corresponding points in the neighbours is less than the tolerance specified in the static value BinaryTree::Max_neighbour_finding_tolerance. 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...
 
RefineableElementobject_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...
 
Treeson_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...
 
TreeRootroot_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...
 
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...
 
Treefather_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...
 
- Public Member Functions inherited from oomph::TreeRoot
 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...
 

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::BinaryTree
static void setup_static_data ()
 Set up the static data, reflection schemes, etc. More...
 
static void doc_neighbours (Vector< Tree * > forest_nodes_pt, std::ofstream &neighbours_file, std::ofstream &neighbours_txt_file, double &max_error)
 Doc/check all neighbours of binary tree (nodes) contained in the Vector forest_node_pt. Output into neighbours_file which can be viewed from tecplot with BinaryTreeNeighbours.mcr. Neighbour info and errors are displayed on neighbours_txt_file. Finally, compute the maximum error between vertices when viewed from the neighbouring element. If the two filestreams are closed, output is suppressed. 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::BinaryTree
static Vector< std::string > Direct_string
 Translate (enumerated) directions into strings. 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::BinaryTree
 BinaryTree ()
 Default constructor (empty and broken) More...
 
 BinaryTree (RefineableElement *const &object_pt)
 Default constructor for empty (root) tree: no father, no sons; just pass a pointer to its object. Protected because BinaryTrees can only be created internally, during the split operation. Only BinaryTreeRoots can be created externally. More...
 
 BinaryTree (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 (L/R) it is. Protected because BinaryTrees can only be created internally, during the split operation. Only BinaryTreeRoots can be created externally. 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...
 
- Protected Attributes inherited from oomph::Tree
TreeRootRoot_pt
 Pointer to the root of the tree. More...
 
TreeFather_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...
 
RefineableElementObject_pt
 Pointer to the object represented by the tree. More...
 
- Protected Attributes inherited from oomph::TreeRoot
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...
 
- Static Protected Attributes inherited from oomph::BinaryTree
static bool Static_data_has_been_setup = false
 Boolean indicating that static member data has been setup. 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...
 

Detailed Description

BinaryTreeRoot is a BinaryTree that forms the root of a (recursive) binary tree. The "root node" is special as it holds additional information about its neighbours.

Definition at line 230 of file binary_tree.h.

Constructor & Destructor Documentation

◆ BinaryTreeRoot() [1/2]

oomph::BinaryTreeRoot::BinaryTreeRoot ( RefineableElement *const &  object_pt)
inline

Constructor for the (empty) root binary tree: Pass pointer to associated object, a RefineableQElement<1>.

Definition at line 235 of file binary_tree.h.

References oomph::BinaryTree::Static_data_has_been_setup, and oomph::Global_string_for_annotation::string().

◆ BinaryTreeRoot() [2/2]

oomph::BinaryTreeRoot::BinaryTreeRoot ( const BinaryTreeRoot dummy)
delete

Broken copy constructor.

Member Function Documentation

◆ direction_of_neighbour()

int oomph::BinaryTreeRoot::direction_of_neighbour ( BinaryTreeRoot binary_tree_root_pt)
inline

If binary_tree_root_pt is a neighbour, return the direction (L/R) in which it is found, otherwise return OMEGA.

Definition at line 262 of file binary_tree.h.

References oomph::BinaryTreeNames::L, oomph::TreeRoot::Neighbour_pt, oomph::Tree::OMEGA, and oomph::BinaryTreeNames::R.

◆ operator=()

void oomph::BinaryTreeRoot::operator= ( const BinaryTreeRoot )
delete

Broken assignment operator.


The documentation for this class was generated from the following file: