Public Member Functions | Protected Attributes | List of all members
oomph::TreeForest Class Referenceabstract

A TreeForest consists of a collection of TreeRoots. Each member tree can have neighbours in various enumerated directions (e.g. S/W/N/E for a QuadTreeForest) and the orientation of their compasses can differ, allowing for complex, unstructured meshes. More...

#include <tree.h>

+ Inheritance diagram for oomph::TreeForest:

Public Member Functions

 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)=delete
 Broken copy constructor. More...
 
void operator= (const TreeForest &)=delete
 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...
 
virtual void check_all_neighbours (DocInfo &doc_info)=0
 Document/check the neighbours of all the nodes in the forest. This must be overloaded for different types of forest. More...
 
virtual void open_hanging_node_files (DocInfo &doc_info, Vector< std::ofstream * > &output_stream)=0
 Open output files that will store any hanging nodes in the forest. Return a vector of the output streams. This is included in the tree structure, so that we can use generic routines for mesh adaptation in two and three dimensions. The need for pointers to the output streams is because one cannot copy a stream! 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...
 

Protected Attributes

Vector< TreeRoot * > Trees_pt
 Vector containing the pointers to the trees. More...
 

Detailed Description

A TreeForest consists of a collection of TreeRoots. Each member tree can have neighbours in various enumerated directions (e.g. S/W/N/E for a QuadTreeForest) and the orientation of their compasses can differ, allowing for complex, unstructured meshes.

Definition at line 408 of file tree.h.

Constructor & Destructor Documentation

◆ TreeForest() [1/3]

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

Constructor for Tree forest: Pass Vector of (pointers to) constituents trees.

Constructor for TreeForest:

Pass:

  • trees_pt[], the Vector of pointers to the constituent trees (TreeRoot objects)

Note that the pointers to the neighbour's of each tree must have been allocated before the constructor is called, otherwise the relative rotation scheme will not be constructed correctly.

Definition at line 359 of file tree.cc.

◆ TreeForest() [2/3]

oomph::TreeForest::TreeForest ( )
inline

Default constructor (empty and broken)

Definition at line 416 of file tree.h.

◆ TreeForest() [3/3]

oomph::TreeForest::TreeForest ( const TreeForest dummy)
delete

Broken copy constructor.

◆ ~TreeForest()

oomph::TreeForest::~TreeForest ( )
virtual

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

Kill tree forest: Delete the constituent trees.

Definition at line 364 of file tree.cc.

References i, and Trees_pt.

Member Function Documentation

◆ check_all_neighbours()

virtual void oomph::TreeForest::check_all_neighbours ( DocInfo doc_info)
pure virtual

Document/check the neighbours of all the nodes in the forest. This must be overloaded for different types of forest.

Implemented in oomph::QuadTreeForest, oomph::OcTreeForest, and oomph::BinaryTreeForest.

Referenced by oomph::TreeBasedRefineableMeshBase::adapt_mesh(), and oomph::TreeBasedRefineableMeshBase::p_adapt_mesh().

◆ close_hanging_node_files()

void oomph::TreeForest::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.

Close the hanging node output files and delete storage allocated at the pointers. This can be done generically at the base level.

Definition at line 432 of file tree.cc.

References oomph::DocInfo::is_doc_enabled().

Referenced by oomph::TreeBasedRefineableMeshBase::adapt_mesh(), and oomph::TreeBasedRefineableMeshBase::p_adapt_mesh().

◆ flush_trees()

void oomph::TreeForest::flush_trees ( )
inline

◆ ntree()

unsigned oomph::TreeForest::ntree ( )
inline

◆ open_hanging_node_files()

virtual void oomph::TreeForest::open_hanging_node_files ( DocInfo doc_info,
Vector< std::ofstream * > &  output_stream 
)
pure virtual

Open output files that will store any hanging nodes in the forest. Return a vector of the output streams. This is included in the tree structure, so that we can use generic routines for mesh adaptation in two and three dimensions. The need for pointers to the output streams is because one cannot copy a stream!

Implemented in oomph::QuadTreeForest, oomph::OcTreeForest, and oomph::BinaryTreeForest.

Referenced by oomph::TreeBasedRefineableMeshBase::adapt_mesh(), and oomph::TreeBasedRefineableMeshBase::p_adapt_mesh().

◆ operator=()

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

Broken assignment operator.

◆ stick_all_tree_nodes_into_vector()

void oomph::TreeForest::stick_all_tree_nodes_into_vector ( Vector< Tree * > &  all_forest_nodes)

◆ stick_leaves_into_vector()

void oomph::TreeForest::stick_leaves_into_vector ( Vector< Tree * > &  forest_nodes)

Traverse forst and stick pointers to leaf "nodes" into Vector.

Traverse TreeForest: Preorder traverse and stick pointers to leaf nodes (only) into Vector.

Definition at line 379 of file tree.cc.

References i, oomph::Tree::nsons(), ntree(), oomph::Tree::son_pt(), oomph::Tree::stick_leaves_into_vector(), and tree_pt().

Referenced by oomph::TreeBasedRefineableMeshBase::adapt_mesh(), oomph::TreeBasedRefineableMeshBase::p_adapt_mesh(), and oomph::TreeBasedRefineableMeshBase::refine_as_in_reference_mesh().

◆ tree_pt()

TreeRoot* oomph::TreeForest::tree_pt ( const unsigned &  i) const
inline

Member Data Documentation

◆ Trees_pt

Vector<TreeRoot*> oomph::TreeForest::Trees_pt
protected

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