27 #ifndef OOMPH_BINARY_TREE_HEADER
28 #define OOMPH_BINARY_TREE_HEADER
32 #include <oomph-lib-config.h>
44 namespace BinaryTreeNames
112 return temp_binary_pt;
139 bool& in_neighbouring_tree)
const;
157 std::ofstream& neighbours_file,
158 std::ofstream& neighbours_txt_file,
169 "Don't call an empty constructor for a BinaryTree object",
170 OOMPH_CURRENT_FUNCTION,
171 OOMPH_EXCEPTION_LOCATION);
201 bool& in_neighbouring_tree,
243 "Static member data hasn't been setup yet.\n";
245 "Call BinaryTree::setup_static_data() before creating\n";
246 error_message +=
"any BinaryTreeRoots\n";
249 error_message, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
264 using namespace BinaryTreeNames;
293 "Don't call an empty constructor for a BinaryTreeForest object",
294 OOMPH_CURRENT_FUNCTION,
295 OOMPH_EXCEPTION_LOCATION);
316 void check_all_neighbours(
DocInfo& doc_info);
332 void find_neighbours();
348 Trees_pt[
i]->neighbour_pt(direction));
A BinaryTreeForest consists of a collection of BinaryTreeRoots. Each member tree can have neighbours ...
BinaryTreeForest()
Default constructor (empty and broken)
BinaryTreeRoot * binary_tree_pt(const unsigned &i)
Return pointer to i-th root binary tree in this forest (performs a dynamic cast from the TreeRoot to ...
virtual ~BinaryTreeForest()
Destructor: Delete the constituent binary trees (and thus the objects associated with its non-leaf no...
void operator=(const BinaryTreeForest &)=delete
Broken assignment operator.
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.
BinaryTreeRoot * binary_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 s...
BinaryTreeForest(const BinaryTreeForest &dummy)=delete
Broken copy constructor.
BinaryTreeRoot is a BinaryTree that forms the root of a (recursive) binary tree. The "root node" is s...
BinaryTreeRoot(RefineableElement *const &object_pt)
Constructor for the (empty) root binary tree: Pass pointer to associated object, a RefineableQElement...
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,...
void operator=(const BinaryTreeRoot &)=delete
Broken assignment operator.
BinaryTreeRoot(const BinaryTreeRoot &dummy)=delete
Broken copy constructor.
BinaryTree class: Recursively defined, generalised binary tree.
static Vector< double > S_base
S_base(direction): Initial value for coordinate s on the edge indicated by direction (L/R)
static Vector< std::string > Colour
Colours for neighbours in various directions.
BinaryTree(RefineableElement *const &object_pt)
Default constructor for empty (root) tree: no father, no sons; just pass a pointer to its object....
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 ...
static Vector< std::string > Direct_string
Translate (enumerated) directions into strings.
BinaryTree()
Default constructor (empty and broken)
static void setup_static_data()
Set up the static data, reflection schemes, etc.
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....
static bool Static_data_has_been_setup
Boolean indicating that static member data has been setup.
virtual ~BinaryTree()
Destructor. Note: Deleting a binary tree also deletes the objects associated with all non-leaf nodes!
void operator=(const BinaryTree &)=delete
Broken assignment operator.
BinaryTree(const BinaryTree &dummy)=delete
Broken copy constructor.
static DenseMatrix< int > Reflect
Reflection scheme: Reflect(direction,segment): Get mirror of segment in specified direction....
BinaryTree * gteq_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 reg...
unsigned self_test()
Self-test: Check all neighbours. Return success (0) if the maximum distance between corresponding poi...
Tree * construct_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...
static DenseMatrix< bool > Is_adjacent
Array of direction/segment adjacency scheme: Is_adjacent(i_vertex,j_segment): Is vertex adjacent to s...
static Vector< int > Reflect_edge
Get opposite edge, e.g. Reflect_edge[L]=R.
Information for documentation of results: Directory and file number to enable output in the form RESL...
An OomphLibError object which should be thrown when an run-time error is encountered....
RefineableElements are FiniteElements that may be subdivided into children to provide a better local ...
A TreeForest consists of a collection of TreeRoots. Each member tree can have neighbours in various e...
TreeRoot is a Tree that forms the root of a (recursive) tree. The "root node" is special as it holds ...
std::map< int, TreeRoot * > Neighbour_pt
Map of pointers to the neighbouring TreeRoots: Neighbour_pt[direction] returns the pointer to the Tre...
A generalised tree base class that abstracts the common functionality between the quad- and octrees u...
RefineableElement * object_pt() const
Return the pointer to the object (RefineableElement) represented by the tree.
Tree * father_pt() const
Return pointer to father: NULL if it's a root node.
int son_type() const
Return son type.
static const int OMEGA
Default value for an unassigned neighbour.
std::string string(const unsigned &i)
Return the i-th string or "" if the relevant string hasn't been defined.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...