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>
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... | |
TreeRoot * | tree_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... | |
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.
Constructor for Tree forest: Pass Vector of (pointers to) constituents trees.
Constructor for TreeForest:
Pass:
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.
|
inline |
|
delete |
Broken copy constructor.
|
virtual |
|
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().
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().
|
inline |
Flush trees from forest.
Definition at line 472 of file tree.h.
References Trees_pt.
Referenced by oomph::RefineableBrickMesh< ELEMENT >::setup_octree_forest(), and oomph::RefineableQuadMesh< ELEMENT >::setup_quadtree_forest().
|
inline |
Number of trees in forest.
Definition at line 460 of file tree.h.
References Trees_pt.
Referenced by oomph::TreeBasedRefineableMeshBase::adapt_mesh(), oomph::QuadTreeForest::construct_north_equivalents(), oomph::OcTreeForest::construct_up_right_equivalents(), oomph::BinaryTreeForest::find_neighbours(), oomph::OcTreeForest::find_neighbours(), oomph::QuadTreeForest::find_neighbours(), oomph::TreeBasedRefineableMeshBase::p_adapt_mesh(), oomph::TreeBasedRefineableMesh< ELEMENT >::p_refine_elements_if_required(), oomph::TreeBasedRefineableMesh< ELEMENT >::split_elements_if_required(), stick_all_tree_nodes_into_vector(), and stick_leaves_into_vector().
|
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().
|
delete |
Broken assignment operator.
Traverse forest and stick pointers to all "nodes" into Vector.
Traverse TreeForest: Preorder traverse and stick pointers to all nodes into Vector.
Definition at line 405 of file tree.cc.
References i, oomph::Tree::nsons(), ntree(), oomph::Tree::son_pt(), oomph::Tree::stick_all_tree_nodes_into_vector(), and tree_pt().
Referenced by oomph::TreeBasedRefineableMeshBase::adapt_mesh(), oomph::BinaryTreeForest::check_all_neighbours(), oomph::OcTreeForest::check_all_neighbours(), oomph::QuadTreeForest::check_all_neighbours(), oomph::TreeBasedRefineableMeshBase::get_elements_at_refinement_level(), oomph::TreeBasedRefineableMeshBase::get_refinement_pattern(), oomph::TreeBasedRefineableMeshBase::p_adapt_mesh(), oomph::BinaryTreeForest::self_test(), oomph::OcTreeForest::self_test(), oomph::QuadTreeForest::self_test(), oomph::RefineableBrickMesh< ELEMENT >::setup_octree_forest(), and oomph::RefineableQuadMesh< ELEMENT >::setup_quadtree_forest().
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().
|
inline |
Return pointer to i-th tree in forest.
Definition at line 466 of file tree.h.
Referenced by oomph::TreeBasedRefineableMeshBase::adapt_mesh(), oomph::TreeBasedRefineableMeshBase::p_adapt_mesh(), oomph::TreeBasedRefineableMesh< ELEMENT >::p_refine_elements_if_required(), oomph::TreeBasedRefineableMesh< ELEMENT >::split_elements_if_required(), stick_all_tree_nodes_into_vector(), and stick_leaves_into_vector().
Vector containing the pointers to the trees.
Definition at line 480 of file tree.h.
Referenced by oomph::OcTreeForest::construct_up_right_equivalents(), oomph::BinaryTreeForest::find_neighbours(), oomph::OcTreeForest::find_neighbours(), oomph::QuadTreeForest::find_neighbours(), flush_trees(), ntree(), tree_pt(), and ~TreeForest().