oomph::TreeRoot Class Reference

#include <tree.h>

+ Inheritance diagram for oomph::TreeRoot:

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)
 
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...
 
- 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...
 
virtual Treeconstruct_son (RefineableElement *const &object_pt, Tree *const &father_pt, const int &son_type)=0
 
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...
 

Protected Attributes

std::map< int, TreeRoot * > Neighbour_pt
 
std::map< int, boolNeighbour_periodic
 
- 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...
 

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::Tree
static doublemax_neighbour_finding_tolerance ()
 
- 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)
 
 Tree (RefineableElement *const &object_pt, Tree *const &father_pt, const int &son_type)
 
- Static Protected Attributes inherited from oomph::Tree
static double Max_neighbour_finding_tolerance = 1.0e-14
 

Detailed Description

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

Constructor & Destructor Documentation

◆ TreeRoot() [1/2]

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

Constructor for the (empty) root tree.

342  : Tree(object_pt)
343  {
344  // TreeRoot is the Root
345  Root_pt = this;
346  }
RefineableElement * object_pt() const
Definition: tree.h:88
TreeRoot * Root_pt
Pointer to the root of the tree.
Definition: tree.h:292
Tree()
Default constructor (empty and broken)
Definition: tree.h:266

References oomph::Tree::Root_pt.

◆ TreeRoot() [2/2]

oomph::TreeRoot::TreeRoot ( const TreeRoot dummy)
delete

Broken copy constructor.

Member Function Documentation

◆ is_neighbour_periodic()

bool oomph::TreeRoot::is_neighbour_periodic ( const int direction)
inline

Return whether the neighbour in the particular direction is periodic.

365  {
366  return Neighbour_periodic[direction];
367  }
std::map< int, bool > Neighbour_periodic
Definition: tree.h:338

References Neighbour_periodic.

Referenced by oomph::OcTree::doc_face_neighbours(), oomph::BinaryTree::doc_neighbours(), oomph::QuadTree::doc_neighbours(), and oomph::OcTree::doc_true_edge_neighbours().

◆ neighbour_pt()

TreeRoot*& oomph::TreeRoot::neighbour_pt ( const int direction)
inline

Return the pointer to the neighbouring TreeRoots in specified direction. Returns NULL if there's no neighbour in this direction.

358  {
359  return Neighbour_pt[direction];
360  }
std::map< int, TreeRoot * > Neighbour_pt
Definition: tree.h:330

References Neighbour_pt.

Referenced by UnsteadyHeatProblem< ELEMENT >::enforce_time_periodic_boundary_conditions(), oomph::BinaryTree::gteq_edge_neighbour(), oomph::QuadTree::gteq_edge_neighbour(), oomph::OcTree::gteq_face_neighbour(), and UnsteadyHeatProblem< ELEMENT >::set_neighbour_periodic_and_up_right_equivalents().

◆ nneighbour()

unsigned oomph::TreeRoot::nneighbour ( )
inline

Return the number of neighbours.

383  {
384  // Loop over the neighbours and test whether they are non-null
385  unsigned count = 0;
386  for (std::map<int, TreeRoot*>::iterator it = Neighbour_pt.begin();
387  it != Neighbour_pt.end();
388  it++)
389  {
390  if (Neighbour_pt[it->first] != 0)
391  {
392  count++;
393  }
394  }
395  // Return number counted
396  return count;
397  }

References Neighbour_pt.

◆ operator=()

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

Broken assignment operator.

◆ set_neighbour_nonperiodic()

void oomph::TreeRoot::set_neighbour_nonperiodic ( const int direction)
inline

Set the neighbour in particular direction to be nonperiodic.

377  {
378  Neighbour_periodic[direction] = false;
379  }

References Neighbour_periodic.

◆ set_neighbour_periodic()

void oomph::TreeRoot::set_neighbour_periodic ( const int direction)
inline

Set the neighbour in particular direction to be periodic.

371  {
372  Neighbour_periodic[direction] = true;
373  }

References Neighbour_periodic.

Referenced by UnsteadyHeatProblem< ELEMENT >::set_neighbour_periodic_and_up_right_equivalents().

Member Data Documentation

◆ Neighbour_periodic

std::map<int, bool> oomph::TreeRoot::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.

Referenced by is_neighbour_periodic(), set_neighbour_nonperiodic(), and set_neighbour_periodic().

◆ Neighbour_pt

std::map<int, TreeRoot*> oomph::TreeRoot::Neighbour_pt
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.

Referenced by oomph::BinaryTreeRoot::direction_of_neighbour(), oomph::QuadTreeRoot::direction_of_neighbour(), oomph::OcTreeRoot::direction_of_neighbour(), neighbour_pt(), and nneighbour().


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