oomph::BinaryTreeRoot Class Reference

#include <binary_tree.h>

+ Inheritance diagram for oomph::BinaryTreeRoot:

Public Member Functions

 BinaryTreeRoot (RefineableElement *const &object_pt)
 
 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)
 
- Public Member Functions inherited from oomph::BinaryTree
virtual ~BinaryTree ()
 
 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)
 
BinaryTreegteq_edge_neighbour (const int &direction, Vector< double > &s_in_neighbour, int &edge, int &diff_level, bool &in_neighbouring_tree) const
 
unsigned self_test ()
 
- Public Member Functions inherited from oomph::Tree
virtual ~Tree ()
 
 Tree (const Tree &dummy)=delete
 Broken copy constructor. More...
 
void operator= (const Tree &)=delete
 Broken assignment operator. More...
 
RefineableElementobject_pt () const
 
void flush_object ()
 Flush the object represented by the tree. More...
 
Treeson_pt (const int &son_index) const
 
void set_son_pt (const Vector< Tree * > &son_pt)
 
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 ()
 
template<class ELEMENT >
void p_refine_if_required (Mesh *&mesh_pt)
 
void merge_sons_if_required (Mesh *&mesh_pt)
 
void deactivate_object ()
 Call the RefineableElement's deactivate_element() function. More...
 
void traverse_all (Tree::VoidMemberFctPt member_function)
 
void traverse_all (Tree::VoidMeshPtArgumentMemberFctPt member_function, Mesh *&mesh_pt)
 
void traverse_all_but_leaves (Tree::VoidMemberFctPt member_function)
 
void traverse_leaves (Tree::VoidMemberFctPt member_function)
 
void traverse_leaves (Tree::VoidMeshPtArgumentMemberFctPt member_function, Mesh *&mesh_pt)
 
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)
 
bool is_neighbour_periodic (const int &direction)
 
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)
 
- 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)
 
- Static Public Member Functions inherited from oomph::Tree
static doublemax_neighbour_finding_tolerance ()
 
- 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)
 
 BinaryTree (RefineableElement *const &object_pt, Tree *const &father_pt, const int &son_type)
 
- Protected Member Functions inherited from oomph::Tree
 Tree ()
 Default constructor (empty and broken) More...
 
 Tree (RefineableElement *const &object_pt)
 
 Tree (RefineableElement *const &object_pt, Tree *const &father_pt, const int &son_type)
 
- 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
 
std::map< int, boolNeighbour_periodic
 
- 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
 

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.

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>.

237  {
238 #ifdef PARANOID
239  // Check that static member data has been setup
241  {
242  std::string error_message =
243  "Static member data hasn't been setup yet.\n";
244  error_message +=
245  "Call BinaryTree::setup_static_data() before creating\n";
246  error_message += "any BinaryTreeRoots\n";
247 
248  throw OomphLibError(
250  }
251 #endif
252  }
BinaryTree()
Default constructor (empty and broken)
Definition: binary_tree.h:166
static bool Static_data_has_been_setup
Boolean indicating that static member data has been setup.
Definition: binary_tree.h:193
TreeRoot(RefineableElement *const &object_pt)
Constructor for the (empty) root tree.
Definition: tree.h:342
RefineableElement * object_pt() const
Definition: tree.h:88
Tree()
Default constructor (empty and broken)
Definition: tree.h:266
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86

References OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, 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

263  {
264  using namespace BinaryTreeNames;
265 
266  if (Neighbour_pt[L] == binary_tree_root_pt)
267  {
268  return L;
269  }
270  if (Neighbour_pt[R] == binary_tree_root_pt)
271  {
272  return R;
273  }
274 
275  // If we get here, it's not a neighbour
276  return OMEGA;
277  }
MatrixXd L
Definition: LLT_example.cpp:6
@ R
Definition: StatisticsVector.h:21
std::map< int, TreeRoot * > Neighbour_pt
Definition: tree.h:330
static const int OMEGA
Default value for an unassigned neighbour.
Definition: tree.h:262

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

◆ operator=()

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

Broken assignment operator.


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