35 #include <oomph-lib-config.h> 155 (this->*member_function)();
158 unsigned numsons=
Son_pt.size();
159 for(
unsigned i=0;
i<numsons;
i++)
160 {
Son_pt[
i]->traverse_all(member_function);}
175 (this->*member_function)(mesh_pt);
178 unsigned numsons=
Son_pt.size();
179 for(
unsigned i=0;
i<numsons;
i++)
180 {
Son_pt[
i]->traverse_all(member_function,mesh_pt);}
191 unsigned n_sons =
Son_pt.size();
196 (this->*member_function)();
198 for(
unsigned i=0;
i<n_sons;
i++)
200 Son_pt[
i]->traverse_all_but_leaves(member_function);
214 unsigned numsons=
Son_pt.size();
218 for(
unsigned i=0;
i<numsons;
i++)
219 {
Son_pt[
i]->traverse_leaves(member_function);}
224 (this->*member_function)();
237 unsigned numsons=
Son_pt.size();
241 for(
unsigned i=0;
i<numsons;
i++)
242 {
Son_pt[
i]->traverse_leaves(member_function,mesh_pt);}
247 (this->*member_function)(mesh_pt);
258 unsigned numsons=
Son_pt.size();
262 for(
unsigned i=0;
i<numsons;
i++)
263 {
Son_pt[
i]->stick_leaves_into_vector(tree_nodes);}
267 tree_nodes.push_back(
this);
278 all_tree_nodes.push_back(
this);
281 unsigned numsons=
Son_pt.size();
285 for(
unsigned i=0;
i<numsons;
i++)
286 {
Son_pt[
i]->stick_all_tree_nodes_into_vector(all_tree_nodes);}
308 unsigned n_sons =
nsons();
310 for(
unsigned ison=0;ison<n_sons;ison++)
357 Trees_pt(trees_pt) {}
365 for (
long int i=0;
i<numtrees;
i++)
380 unsigned numtrees=
ntree();
381 for (
unsigned itree=0;itree<numtrees;itree++)
387 for (
unsigned i=0;
i<numsons;
i++)
394 forest_nodes.push_back(
tree_pt(itree));
408 unsigned numtrees=
ntree();
409 for (
unsigned itree=0;itree<numtrees;itree++)
411 all_forest_nodes.push_back(
tree_pt(itree));
418 for (
unsigned i=0;
i<numsons;
i++)
438 unsigned n_file = output_stream.size();
442 for(
unsigned n=0;n<n_file;n++) {output_stream[n]->close();}
446 for(
unsigned n=n_file;n>0;n--)
447 {
delete output_stream[n-1]; output_stream[n-1] = 0;}
450 output_stream.clear();
Vector< Tree * > Son_pt
Vector of pointers to the sons of the Tree.
unsigned nsons() const
Return number of sons (zero if it's a leaf node)
void(Tree::* VoidMemberFctPt)()
Function pointer to argument-free void Tree member function.
RefineableElement * Object_pt
Pointer to the object represented by the tree.
Vector< TreeRoot * > Trees_pt
Vector containing the pointers to the trees.
unsigned ntree()
Number of trees in forest.
virtual ~Tree()
Destructor. Note: Deleting a tree also deletes the objects associated with its non-leave nodes...
bool is_doc_enabled() const
Are we documenting?
void deactivate_object()
Call the RefineableElement's deactivate_element() function.
TreeRoot * tree_pt(const unsigned &i) const
Return pointer to i-th tree in forest.
Information for documentation of results: Directory and file number to enable output in the form RESL...
TreeForest()
Default constructor (empty and broken)
void stick_all_tree_nodes_into_vector(Vector< Tree * > &all_forest_nodes)
Traverse forest and stick pointers to all "nodes" into Vector.
static double Max_neighbour_finding_tolerance
Max. allowed discrepancy in neighbour finding routine (distance between points when identified from t...
void stick_leaves_into_vector(Vector< Tree * > &forest_nodes)
Traverse forst and stick pointers to leaf "nodes" into Vector.
TreeRoot * Root_pt
Pointer to the root of the tree.
void merge_sons_if_required(Mesh *&mesh_pt)
If required, merge the four sons for unrefinement – criterion: bool object_pt()-> sons_to_be_unrefin...
virtual void unbuild()
Unbuild the element, i.e. mark the nodes that were created during its creation for possible deletion...
void traverse_all_but_leaves(Tree::VoidMemberFctPt member_function)
Traverse the tree and execute void Tree member function.
void(Tree::* VoidMeshPtArgumentMemberFctPt)(Mesh *&mesh_pt)
int Level
Level of the Tree (level 0 = root)
void set_tree_pt(Tree *my_tree_pt)
Set pointer to quadtree representation of this element.
void traverse_leaves(Tree::VoidMemberFctPt member_function)
Traverse the tree and execute void Tree member function member_function() only at its leaves...
void deselect_sons_for_unrefinement()
No unrefinement will be performed by merging the four sons of this element.
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...
virtual void rebuild_from_sons(Mesh *&mesh_pt)=0
Rebuild the element, e.g. set internal values in line with those of the sons that have now merged...
Tree * Father_pt
Pointer to the Father of the Tree.
virtual ~TreeForest()
Destructor: Delete the constituent trees (and thus the objects associated with its non-leaf nodes!) ...
static const int OMEGA
Default value for an unassigned neighbour.
void stick_all_tree_nodes_into_vector(Vector< Tree * > &)
Traverse and stick pointers to all "nodes" into Vector.
void traverse_all(Tree::VoidMemberFctPt member_function)
Traverse the tree and execute void Tree member function member_function() at all its "nodes"...
Tree * son_pt(const int &son_index) const
Return pointer to the son for a given index. Note that to aid code readability specific enums have be...
Tree * father_pt() const
Return pointer to father: NULL if it's a root node.
virtual void deactivate_element()
Final operations that must be performed when the element is no longer active in the mesh...
bool sons_to_be_unrefined()
Has the element been selected for unrefinement?
int son_type() const
Return son type.
RefineableElement * object_pt() const
Return the pointer to the object (RefineableElement) represented by the tree.
void stick_leaves_into_vector(Vector< Tree * > &)
Traverse tree and stick pointers to leaf "nodes" (only) into Vector.
Tree()
Default constructor (empty and broken)
int Son_type
Son type (e.g. SW/SE/NW/NE in a quadtree)