31 #ifndef OOMPH_BINARY_TREE_HEADER 32 #define OOMPH_BINARY_TREE_HEADER 36 #include <oomph-lib-config.h> 48 namespace BinaryTreeNames
113 Tree*
const &father_pt,
const int &son_type)
116 return temp_binary_pt;
139 BinaryTree* gteq_edge_neighbour(
const int& direction,
141 int& edge,
int& diff_level,
142 bool &in_neighbouring_tree)
const;
151 static void setup_static_data();
160 std::ofstream& neighbours_file,
161 std::ofstream& neighbours_txt_file,
173 (
"Don't call an empty constructor for a BinaryTree object",
174 OOMPH_CURRENT_FUNCTION,OOMPH_EXCEPTION_LOCATION);
189 Tree*
const &father_pt,
const int& son_type)
190 :
Tree(object_pt,father_pt,son_type) {}
199 BinaryTree* gteq_edge_neighbour(
const int& direction,
202 bool& in_neighbouring_tree,
245 if(!Static_data_has_been_setup)
248 "Static member data hasn't been setup yet.\n";
250 "Call BinaryTree::setup_static_data() before creating\n";
251 error_message +=
"any BinaryTreeRoots\n";
254 OOMPH_CURRENT_FUNCTION,
255 OOMPH_EXCEPTION_LOCATION);
277 using namespace BinaryTreeNames;
279 if(Neighbour_pt[
L]==binary_tree_root_pt) {
return L; }
280 if(Neighbour_pt[
R]==binary_tree_root_pt) {
return R; }
303 "Don't call an empty constructor for a BinaryTreeForest object",
304 OOMPH_CURRENT_FUNCTION,OOMPH_EXCEPTION_LOCATION);
331 void check_all_neighbours(
DocInfo &doc_info);
346 void find_neighbours();
359 return dynamic_cast<BinaryTreeRoot*
>(Trees_pt[
i]->neighbour_pt(direction));
void broken_copy(const std::string &class_name)
Issue error message and terminate execution.
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 bool Static_data_has_been_setup
Boolean indicating that static member data has been setup.
Information for documentation of results: Directory and file number to enable output in the form RESL...
BinaryTree(const BinaryTree &dummy)
Broken copy constructor.
BinaryTreeRoot(const BinaryTreeRoot &dummy)
Broken copy constructor.
static Vector< std::string > Direct_string
Translate (enumerated) directions into strings.
BinaryTree(RefineableElement *const &object_pt)
Default constructor for empty (root) tree: no father, no sons; just pass a pointer to its object...
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...
BinaryTreeRoot * binary_tree_pt(const unsigned &i)
static DenseMatrix< int > Reflect
Reflection scheme: Reflect(direction,segment): Get mirror of segment in specified direction...
static Vector< std::string > Colour
Colours for neighbours in various directions.
unsigned self_test()
Self-test: Return 0 for OK.
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 ...
void operator=(const BinaryTreeForest &)
Broken assignment operator.
static DenseMatrix< bool > Is_adjacent
Array of direction/segment adjacency scheme: Is_adjacent(i_vertex,j_segment): Is vertex adjacent to s...
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.
void operator=(const BinaryTree &)
Broken assignment operator.
BinaryTree()
Default constructor (empty and broken)
BinaryTreeForest()
Default constructor (empty and broken)
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.
static Vector< int > Reflect_edge
Get opposite edge, e.g. Reflect_edge[L]=R.
static Vector< double > S_base
S_base(direction): Initial value for coordinate s on the edge indicated by direction (L/R) ...
BinaryTreeForest(const BinaryTreeForest &dummy)
Broken copy constructor.
void broken_assign(const std::string &class_name)
Issue error message and terminate execution.
std::string string(const unsigned &i)
Return the i-th string or "" if the relevant string hasn't been defined.
void operator=(const BinaryTreeRoot &)
Broken assignment operator.
BinaryTreeRoot(RefineableElement *const &object_pt)
virtual ~BinaryTreeForest()
Destructor: Delete the constituent binary trees (and thus the objects associated with its non-leaf no...
virtual ~BinaryTree()
Destructor. Note: Deleting a binary tree also deletes the objects associated with all non-leaf nodes!...