Public Member Functions | Private Attributes | List of all members
oomph::QuadTreeRoot Class Reference

#include <quadtree.h>

+ Inheritance diagram for oomph::QuadTreeRoot:

Public Member Functions

 QuadTreeRoot (RefineableElement *const &object_pt)
 
 QuadTreeRoot (const QuadTreeRoot &dummy)
 Broken copy constructor. More...
 
void operator= (const QuadTreeRoot &)
 Broken assignment operator. More...
 
int & north_equivalent (const int &neighbour)
 Return north equivalent of the neighbours in specified direction: When viewed from the current quadtree's neighbour neighbour, our northern direction is the neighbour's north_equivalent(neighbour) direction. If there's no rotation, this map contains the identify so that, e.g. north_equivalent(W)=N (read as: "in my Western neighbour, my North is its North"). If the western neighbour is rotated by 180 degrees relative to the current quadtree, say, we have north_equivalent(W)=S (read as: "in my Western neighbour, my North is its South"); etc. More...
 
int direction_of_neighbour (QuadTreeRoot *quadtree_root_pt)
 If quadtree_root_pt is a neighbour, return the direction [N/S/E/W] in which it is found, otherwise return OMEGA. More...
 
- Public Member Functions inherited from oomph::QuadTree
virtual ~QuadTree ()
 Destructor. Note: Deleting a quadtree also deletes the objects associated with all non-leaf nodes! More...
 
 QuadTree (const QuadTree &dummy)
 Broken copy constructor. More...
 
void operator= (const QuadTree &)
 Broken assignment operator. More...
 
Treeconstruct_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 QuadTree and not a general Tree. More...
 
QuadTreegteq_edge_neighbour (const int &direction, Vector< unsigned > &translate_s, Vector< double > &s_lo, Vector< double > &s_hi, 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 regarding the relative size and orientation of neighbour: More...
 
void stick_neighbouring_leaves_into_vector (Vector< const QuadTree * > &tree_neighbouring_nodes, Vector< Vector< double > > &tree_neighbouring_s_lo, Vector< Vector< double > > &tree_neighbouring_s_hi, Vector< int > &tree_neighbouring_diff_level, const QuadTree *my_neigh_pt, const int &direction) const
 Traverse Tree: Preorder traverse and stick pointers to neighbouring leaf nodes (only) into Vector. More...
 
unsigned self_test ()
 Self-test: Check all neighbours. Return success (0) if the max. distance between corresponding points in the neighbours is less than the tolerance specified in the static value QuadTree::Max_neighbour_finding_tolerance. More...
 
- Public Member Functions inherited from oomph::Tree
virtual ~Tree ()
 Destructor. Note: Deleting a tree also deletes the objects associated with its non-leave nodes. More...
 
 Tree (const Tree &dummy)
 Broken copy constructor. More...
 
void operator= (const Tree &)
 Broken assignment operator. More...
 
RefineableElementobject_pt () const
 Return the pointer to the object (RefineableElement) represented by the tree. More...
 
void flush_object ()
 Flush the object represented by the tree. More...
 
Treeson_pt (const int &son_index) const
 Return pointer to the son for a given index. Note that to aid code readability specific enums have been defined for specific trees. However, these are simply aliases for ints and the general interface can be implemented once, here. More...
 
void set_son_pt (const Vector< Tree * > &son_pt)
 Set vector of pointers to sons, indexed by the appropriate enum that identies son types. (To aid code readability specific enums have been defined for specific trees. However, these are simply aliases for ints and the general interface can be implemented once, here). More...
 
unsigned nsons () const
 Return number of sons (zero if it's a leaf node) More...
 
void flush_sons ()
 Flush the sons. More...
 
TreeRoot *& root_pt ()
 Return pointer to root of the tree. More...
 
TreeRootroot_pt () const
 Return pointer to root of the tree (const version) More...
 
template<class ELEMENT >
void split_if_required ()
 If required, split the leaf and create its sons – criterion: bool object_pt()-> to_be_refined() = true. More...
 
template<class ELEMENT >
void p_refine_if_required (Mesh *&mesh_pt)
 If required, p-refine the leaf – criterion: bool object_pt()-> to_be_p_refined() = true or bool object_pt()-> to_be_p_unrefined() = true. More...
 
void merge_sons_if_required (Mesh *&mesh_pt)
 If required, merge the four sons for unrefinement – criterion: bool object_pt()-> sons_to_be_unrefined() = true. More...
 
void deactivate_object ()
 Call the RefineableElement's deactivate_element() function. More...
 
void traverse_all (Tree::VoidMemberFctPt member_function)
 Traverse the tree and execute void Tree member function member_function() at all its "nodes". More...
 
void traverse_all (Tree::VoidMeshPtArgumentMemberFctPt member_function, Mesh *&mesh_pt)
 Traverse the tree and excute void Tree member function that takes a pointer to a mesh as an argument. More...
 
void traverse_all_but_leaves (Tree::VoidMemberFctPt member_function)
 Traverse the tree and execute void Tree member function. More...
 
void traverse_leaves (Tree::VoidMemberFctPt member_function)
 Traverse the tree and execute void Tree member function member_function() only at its leaves. More...
 
void traverse_leaves (Tree::VoidMeshPtArgumentMemberFctPt member_function, Mesh *&mesh_pt)
 Traverse the tree and execute void Tree member function that takes a pointer to a mesh as an argument only at its leaves. More...
 
void stick_leaves_into_vector (Vector< Tree * > &)
 Traverse tree and stick pointers to leaf "nodes" (only) into Vector. More...
 
void stick_all_tree_nodes_into_vector (Vector< Tree * > &)
 Traverse and stick pointers to all "nodes" into Vector. More...
 
int son_type () const
 Return son type. More...
 
bool is_leaf ()
 Return true if the tree is a leaf node. More...
 
Treefather_pt () const
 Return pointer to father: NULL if it's a root node. More...
 
void set_father_pt (Tree *const &father_pt)
 Set the father. More...
 
unsigned level () const
 Return the level of the Tree (root=0) More...
 
- Public Member Functions inherited from oomph::TreeRoot
 TreeRoot (RefineableElement *const &object_pt)
 Constructor for the (empty) root tree. More...
 
 TreeRoot (const TreeRoot &dummy)
 Broken copy constructor. More...
 
void operator= (const TreeRoot &)
 Broken assignment operator. More...
 
TreeRoot *& neighbour_pt (const int &direction)
 Return the pointer to the neighbouring TreeRoots in specified direction. Returns NULL if there's no neighbour in this direction. More...
 
bool is_neighbour_periodic (const int &direction)
 Return whether the neighbour in the particular direction is periodic. More...
 
void set_neighbour_periodic (const int &direction)
 Set the neighbour in particular direction to be periodic. More...
 
void set_neighbour_nonperiodic (const int &direction)
 Set the neighbour in particular direction to be nonperiodic. More...
 
unsigned nneighbour ()
 Return the number of neighbours. More...
 

Private Attributes

Vector< int > North_equivalent
 Vector giving the north equivalent of the neighbours: When viewed from the current quadtree's neighbour neighbour, our northern direction is the neighbour's North_equivalent[neighbour] direction. If there's no rotation, this map contains the identify so that, e.g. North_equivalent[W]=N (read as: "in my Western neighbour, my North is its North"). If the western neighbour is rotated by 180 degrees relative to the current quadtree, say, we have North_equivalent[W]=S (read as: "in my Western neighbour, my North is its South"); etc. More...
 

Additional Inherited Members

- Public Types inherited from oomph::Tree
typedef void(Tree::* VoidMemberFctPt )()
 Function pointer to argument-free void Tree member function. More...
 
typedef void(Tree::* VoidMeshPtArgumentMemberFctPt )(Mesh *&mesh_pt)
 
- Static Public Member Functions inherited from oomph::QuadTree
static void setup_static_data ()
 Setup the static data, rotation and reflection schemes, etc. More...
 
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 quadtree (nodes) contained in the Vector forest_node_pt. Output into neighbours_file which can be viewed from tecplot with QuadTreeNeighbours.mcr Neighbour info and errors are displayed on neighbours_txt_file. Finally, compute the max. error between vertices when viewed from neighhbouring element. If the two filestreams are closed, output is suppressed. More...
 
- Static Public Member Functions inherited from oomph::Tree
static double & max_neighbour_finding_tolerance ()
 Max. allowed discrepancy in neighbour finding routine (distance between points when identified from two neighbouring elements) More...
 
- Static Public Attributes inherited from oomph::QuadTree
static Vector< std::string > Direct_string
 Translate (enumerated) directions into strings. More...
 
- Static Public Attributes inherited from oomph::Tree
static const int OMEGA =26
 Default value for an unassigned neighbour. More...
 
- Protected Member Functions inherited from oomph::QuadTree
 QuadTree ()
 Default constructor (empty and broken) More...
 
 QuadTree (RefineableElement *const &object_pt)
 Default constructor for empty (root) tree: no father, no sons; just pass a pointer to its object Protected because QuadTrees can only be created internally, during the split operation. Only QuadTreeRoots can be created externally. More...
 
 QuadTree (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 and tell it what type of son (SE/SW/NE/NW) it is. Protected because QuadTrees can only be created internally, during the split operation. Only QuadTreeRoots can be created externally. More...
 
- Protected Member Functions inherited from oomph::Tree
 Tree ()
 Default constructor (empty and broken) More...
 
 Tree (RefineableElement *const &object_pt)
 Default constructor for empty (root) tree: no father, no sons; just pass a pointer to its object Protected because Trees can only be created internally, during the split operation. Only TreeRoots can be created externally. More...
 
 Tree (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 and tell it what type of son it is. Protected because Trees can only be created internally, during the split operation. Only TreeRoots can be created externally. More...
 
- Protected Attributes inherited from oomph::Tree
TreeRootRoot_pt
 Pointer to the root of the tree. More...
 
TreeFather_pt
 Pointer to the Father of the Tree. More...
 
Vector< Tree * > Son_pt
 Vector of pointers to the sons of the Tree. More...
 
int Level
 Level of the Tree (level 0 = root) More...
 
int Son_type
 Son type (e.g. SW/SE/NW/NE in a quadtree) More...
 
RefineableElementObject_pt
 Pointer to the object represented by the tree. More...
 
- Protected Attributes inherited from oomph::TreeRoot
std::map< int, TreeRoot * > Neighbour_pt
 Map of pointers to the neighbouring TreeRoots: Neighbour_pt[direction] returns the pointer to the TreeRoot's neighbour in the (enumerated) direction. Returns NULL if there's no neighbour in this direction. More...
 
std::map< int, bool > Neighbour_periodic
 Map of booleans used for periodic boundaries: Neighbour_periodic_direction[directon] returns true if the neighbour in that direction is actually a periodic neighbour — shared data values, but independent position. The default return of the map is false. More...
 
- Static Protected Attributes inherited from oomph::QuadTree
static bool Static_data_has_been_setup =false
 Bool indicating that static member data has been setup. More...
 
- Static Protected Attributes inherited from oomph::Tree
static double Max_neighbour_finding_tolerance =1.0e-14
 Max. allowed discrepancy in neighbour finding routine (distance between points when identified from two neighbouring elements) More...
 

Detailed Description

QuadTreeRoot is a QuadTree that forms the root of a (recursive) quadtree. The "root node" is special as it holds additional information about its neighbours and their relative rotation (inside a QuadTreeForest).

Definition at line 290 of file quadtree.h.

Constructor & Destructor Documentation

oomph::QuadTreeRoot::QuadTreeRoot ( RefineableElement *const &  object_pt)
inline
oomph::QuadTreeRoot::QuadTreeRoot ( const QuadTreeRoot dummy)
inline

Broken copy constructor.

Definition at line 342 of file quadtree.h.

References oomph::BrokenCopy::broken_copy().

Member Function Documentation

int oomph::QuadTreeRoot::direction_of_neighbour ( QuadTreeRoot quadtree_root_pt)
inline

If quadtree_root_pt is a neighbour, return the direction [N/S/E/W] in which it is found, otherwise return OMEGA.

Definition at line 385 of file quadtree.h.

References oomph::QuadTreeNames::E, oomph::QuadTreeNames::N, oomph::TreeRoot::Neighbour_pt, oomph::Tree::OMEGA, oomph::QuadTreeNames::S, and oomph::QuadTreeNames::W.

Referenced by oomph::QuadTreeForest::construct_north_equivalents().

int& oomph::QuadTreeRoot::north_equivalent ( const int &  neighbour)
inline

Return north equivalent of the neighbours in specified direction: When viewed from the current quadtree's neighbour neighbour, our northern direction is the neighbour's north_equivalent(neighbour) direction. If there's no rotation, this map contains the identify so that, e.g. north_equivalent(W)=N (read as: "in my Western neighbour, my North is its North"). If the western neighbour is rotated by 180 degrees relative to the current quadtree, say, we have north_equivalent(W)=S (read as: "in my Western neighbour, my North is its South"); etc.

Definition at line 363 of file quadtree.h.

References oomph::QuadTree::Direct_string, oomph::QuadTreeNames::E, oomph::QuadTreeNames::N, North_equivalent, oomph::QuadTreeNames::S, and oomph::QuadTreeNames::W.

Referenced by oomph::QuadTreeForest::construct_north_equivalents().

void oomph::QuadTreeRoot::operator= ( const QuadTreeRoot )
inline

Broken assignment operator.

Definition at line 348 of file quadtree.h.

References oomph::BrokenCopy::broken_assign().

Member Data Documentation

Vector<int> oomph::QuadTreeRoot::North_equivalent
private

Vector giving the north equivalent of the neighbours: When viewed from the current quadtree's neighbour neighbour, our northern direction is the neighbour's North_equivalent[neighbour] direction. If there's no rotation, this map contains the identify so that, e.g. North_equivalent[W]=N (read as: "in my Western neighbour, my North is its North"). If the western neighbour is rotated by 180 degrees relative to the current quadtree, say, we have North_equivalent[W]=S (read as: "in my Western neighbour, my North is its South"); etc.

Definition at line 303 of file quadtree.h.

Referenced by north_equivalent(), and QuadTreeRoot().


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