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

#include <binary_tree.h>

+ Inheritance diagram for oomph::BinaryTreeForest:

Public Member Functions

 BinaryTreeForest ()
 Default constructor (empty and broken) More...
 
 BinaryTreeForest (Vector< TreeRoot * > &trees_pt)
 Constructor: Pass vector of pointers to the roots of the constituent BinaryTrees. More...
 
 BinaryTreeForest (const BinaryTreeForest &dummy)
 Broken copy constructor. More...
 
void operator= (const BinaryTreeForest &)
 Broken assignment operator. More...
 
virtual ~BinaryTreeForest ()
 Destructor: Delete the constituent binary trees (and thus the objects associated with its non-leaf nodes!) More...
 
void check_all_neighbours (DocInfo &doc_info)
 Document and check all the neighbours of all the nodes in the forest. DocInfo object specifies the output directory and file numbers for the various files. If doc_info.disable_doc() has been called, no output is created. More...
 
void open_hanging_node_files (DocInfo &doc_info, Vector< std::ofstream * > &output_stream)
 A line mesh cannot have hanging nodes so make this function empty. 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::TreeForest
 TreeForest (Vector< TreeRoot * > &trees_pt)
 Constructor for Tree forest: Pass Vector of (pointers to) constituents trees. More...
 
 TreeForest ()
 Default constructor (empty and broken) More...
 
 TreeForest (const TreeForest &dummy)
 Broken copy constructor. More...
 
void operator= (const TreeForest &)
 Broken assignment operator. More...
 
virtual ~TreeForest ()
 Destructor: Delete the constituent trees (and thus the objects associated with its non-leaf nodes!) More...
 
void stick_leaves_into_vector (Vector< Tree * > &forest_nodes)
 Traverse forst and stick pointers to leaf "nodes" into Vector. More...
 
void stick_all_tree_nodes_into_vector (Vector< Tree * > &all_forest_nodes)
 Traverse forest and stick pointers to all "nodes" into Vector. More...
 
void close_hanging_node_files (DocInfo &doc_info, Vector< std::ofstream * > &output_stream)
 Close output files that will store any hanging nodes in the forest and delete any associated storage. This can be performed genercially in this base class. More...
 
unsigned ntree ()
 Number of trees in forest. More...
 
TreeRoottree_pt (const unsigned &i) const
 Return pointer to i-th tree in forest. More...
 
void flush_trees ()
 Flush trees from forest. More...
 

Private Member Functions

void find_neighbours ()
 Construct the neighbour lookup scheme. More...
 
BinaryTreeRootbinary_tree_pt (const unsigned &i)
 
BinaryTreeRootbinary_neigh_pt (const unsigned &i, const int &direction)
 Given the number i of the root binary tree in this forest, return a pointer to its neighbour in the specified direction. NULL if neighbour doesn't exist. (This does the dynamic cast from a TreeRoot to a BinaryTreeRoot internally). More...
 

Additional Inherited Members

- Protected Attributes inherited from oomph::TreeForest
Vector< TreeRoot * > Trees_pt
 Vector containing the pointers to the trees. More...
 

Detailed Description

A BinaryTreeForest consists of a collection of BinaryTreeRoots. Each member tree can have neighbours to its left and right.

Definition at line 293 of file binary_tree.h.

Constructor & Destructor Documentation

oomph::BinaryTreeForest::BinaryTreeForest ( )
inline

Default constructor (empty and broken)

Definition at line 299 of file binary_tree.h.

oomph::BinaryTreeForest::BinaryTreeForest ( Vector< TreeRoot * > &  trees_pt)

Constructor: Pass vector of pointers to the roots of the constituent BinaryTrees.

Constructor for BinaryTreeForest:

Pass:

Definition at line 439 of file binary_tree.cc.

References find_neighbours().

oomph::BinaryTreeForest::BinaryTreeForest ( const BinaryTreeForest dummy)
inline

Broken copy constructor.

Definition at line 312 of file binary_tree.h.

References oomph::BrokenCopy::broken_copy().

virtual oomph::BinaryTreeForest::~BinaryTreeForest ( )
inlinevirtual

Destructor: Delete the constituent binary trees (and thus the objects associated with its non-leaf nodes!)

Definition at line 325 of file binary_tree.h.

Member Function Documentation

BinaryTreeRoot* oomph::BinaryTreeForest::binary_neigh_pt ( const unsigned &  i,
const int &  direction 
)
inlineprivate

Given the number i of the root binary tree in this forest, return a pointer to its neighbour in the specified direction. NULL if neighbour doesn't exist. (This does the dynamic cast from a TreeRoot to a BinaryTreeRoot internally).

Definition at line 357 of file binary_tree.h.

References i.

BinaryTreeRoot* oomph::BinaryTreeForest::binary_tree_pt ( const unsigned &  i)
inlineprivate

Return pointer to i-th root binary tree in this forest (performs a dynamic cast from the TreeRoot to a BinaryTreeRoot).

Definition at line 350 of file binary_tree.h.

References i.

void oomph::BinaryTreeForest::check_all_neighbours ( DocInfo doc_info)
virtual

Document and check all the neighbours of all the nodes in the forest. DocInfo object specifies the output directory and file numbers for the various files. If doc_info.disable_doc() has been called, no output is created.

Document and check all the neighbours in all the nodes in the forest.

Implements oomph::TreeForest.

Definition at line 547 of file binary_tree.cc.

References oomph::DocInfo::directory(), oomph::BinaryTree::doc_neighbours(), oomph::DocInfo::is_doc_enabled(), oomph::Tree::max_neighbour_finding_tolerance(), oomph::DocInfo::number(), oomph::oomph_info, and oomph::TreeForest::stick_all_tree_nodes_into_vector().

void oomph::BinaryTreeForest::find_neighbours ( )
private

Construct the neighbour lookup scheme.

Set up the neighbour lookup schemes for all constituent binary trees.

Definition at line 455 of file binary_tree.cc.

References i, oomph::BinaryTreeNames::L, oomph::TreeForest::ntree(), oomph::BinaryTreeNames::R, and oomph::TreeForest::Trees_pt.

Referenced by BinaryTreeForest().

void oomph::BinaryTreeForest::open_hanging_node_files ( DocInfo doc_info,
Vector< std::ofstream * > &  output_stream 
)
inlinevirtual

A line mesh cannot have hanging nodes so make this function empty.

Implements oomph::TreeForest.

Definition at line 334 of file binary_tree.h.

void oomph::BinaryTreeForest::operator= ( const BinaryTreeForest )
inline

Broken assignment operator.

Definition at line 318 of file binary_tree.h.

References oomph::BrokenCopy::broken_assign().

unsigned oomph::BinaryTreeForest::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.

Self test: Check neighbour finding routine. For each element in the tree and for each vertex, determine the distance between the vertex and its position in the neighbour. If the difference is less than Tree::Max_neighbour_finding_tolerance return success (0), otherwise failure (1).

Definition at line 624 of file binary_tree.cc.

References oomph::BinaryTree::doc_neighbours(), i, oomph::Tree::max_neighbour_finding_tolerance(), oomph::oomph_info, and oomph::TreeForest::stick_all_tree_nodes_into_vector().


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