![]() |
|
#include <octree.h>
Public Member Functions | |
OcTreeRoot (RefineableElement *const &object_pt) | |
OcTreeRoot (const OcTreeRoot &dummy)=delete | |
Broken copy constructor. More... | |
void | operator= (const OcTreeRoot &)=delete |
Broken assignment operator. More... | |
Vector< TreeRoot * > | edge_neighbour_pt (const unsigned &edge_direction) |
unsigned | nedge_neighbour (const unsigned &edge_direction) |
void | add_edge_neighbour_pt (TreeRoot *oc_tree_root_pt, const unsigned &edge_direction) |
int | up_equivalent (TreeRoot *tree_root_pt) |
void | set_up_equivalent (TreeRoot *tree_root_pt, const int &dir) |
int | right_equivalent (TreeRoot *tree_root_pt) |
void | set_right_equivalent (TreeRoot *tree_root_pt, const int &dir) |
int | direction_of_neighbour (TreeRoot *octree_root_pt) |
![]() | |
virtual | ~OcTree () |
OcTree (const OcTree &dummy)=delete | |
Broken copy constructor. More... | |
void | operator= (const OcTree &)=delete |
Broken assignment operator. More... | |
Tree * | construct_son (RefineableElement *const &object_pt, Tree *const &father_pt, const int &son_type) |
OcTree * | gteq_face_neighbour (const int &direction, Vector< unsigned > &translate_s, Vector< double > &s_sw, Vector< double > &s_ne, int &face, int &diff_level, bool &in_neighbouring_tree) const |
OcTree * | gteq_true_edge_neighbour (const int &direction, const unsigned &i_root_edge_neighbour, unsigned &nroot_edge_neighbour, Vector< unsigned > &translate_s, Vector< double > &s_lo, Vector< double > &s_hi, int &edge, int &diff_level) const |
unsigned | self_test () |
![]() | |
virtual | ~Tree () |
Tree (const Tree &dummy)=delete | |
Broken copy constructor. More... | |
void | operator= (const Tree &)=delete |
Broken assignment operator. More... | |
RefineableElement * | object_pt () const |
void | flush_object () |
Flush the object represented by the tree. More... | |
Tree * | son_pt (const int &son_index) const |
void | set_son_pt (const Vector< Tree * > &son_pt) |
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... | |
TreeRoot * | root_pt () const |
Return pointer to root of the tree (const version) More... | |
template<class ELEMENT > | |
void | split_if_required () |
template<class ELEMENT > | |
void | p_refine_if_required (Mesh *&mesh_pt) |
void | merge_sons_if_required (Mesh *&mesh_pt) |
void | deactivate_object () |
Call the RefineableElement's deactivate_element() function. More... | |
void | traverse_all (Tree::VoidMemberFctPt member_function) |
void | traverse_all (Tree::VoidMeshPtArgumentMemberFctPt member_function, Mesh *&mesh_pt) |
void | traverse_all_but_leaves (Tree::VoidMemberFctPt member_function) |
void | traverse_leaves (Tree::VoidMemberFctPt member_function) |
void | traverse_leaves (Tree::VoidMeshPtArgumentMemberFctPt member_function, Mesh *&mesh_pt) |
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... | |
Tree * | father_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... | |
![]() | |
TreeRoot (RefineableElement *const &object_pt) | |
Constructor for the (empty) root tree. More... | |
TreeRoot (const TreeRoot &dummy)=delete | |
Broken copy constructor. More... | |
void | operator= (const TreeRoot &)=delete |
Broken assignment operator. More... | |
TreeRoot *& | neighbour_pt (const int &direction) |
bool | is_neighbour_periodic (const int &direction) |
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 | |
std::map< int, Vector< TreeRoot * > > | Edge_neighbour_pt |
std::map< TreeRoot *, int > | Up_equivalent |
std::map< TreeRoot *, int > | Right_equivalent |
Additional Inherited Members | |
![]() | |
typedef void(Tree::* | VoidMemberFctPt) () |
Function pointer to argument-free void Tree member function. More... | |
typedef void(Tree::* | VoidMeshPtArgumentMemberFctPt) (Mesh *&mesh_pt) |
![]() | |
static Vector< int > | faces_of_common_edge (const int &edge) |
Function that, given an edge, returns the two faces on which it. More... | |
static void | setup_static_data () |
Setup the static data, rotation and reflection schemes, etc. More... | |
static void | doc_face_neighbours (Vector< Tree * > forest_nodes_pt, std::ofstream &neighbours_file, std::ofstream &neighbours_txt_file, double &max_error) |
static void | doc_true_edge_neighbours (Vector< Tree * > forest_nodes_pt, std::ofstream &neighbours_file, std::ofstream &no_true_edge_file, std::ofstream &neighbours_txt_file, double &max_error) |
static int | get_the_other_face (const unsigned &n1, const unsigned &n2, const unsigned &nnode1d, const int &face) |
static unsigned | vertex_to_node_number (const int &vertex, const unsigned &nnode1d) |
static int | node_number_to_vertex (const unsigned &n, const unsigned &nnode1d) |
static Vector< int > | rotate (const int &new_up, const int &new_right, const Vector< int > &dir) |
static int | rotate (const int &new_up, const int &new_right, const int &dir) |
![]() | |
static double & | max_neighbour_finding_tolerance () |
![]() | |
static Vector< std::string > | Direct_string |
Translate (enumerated) directions into strings. More... | |
static Vector< int > | Reflect_face |
Get opposite face, e.g. Reflect_face[L]=R. More... | |
static Vector< int > | Reflect_edge |
Get opposite edge, e.g. Reflect_edge[DB]=UF. More... | |
static Vector< int > | Reflect_vertex |
Get opposite vertex, e.g. Reflect_vertex[LDB]=RUF. More... | |
static Vector< Vector< int > > | Vertex_at_end_of_edge |
Map of vectors containing the two vertices for each edge. More... | |
static std::map< Vector< int >, int > | Vector_to_direction |
static Vector< Vector< int > > | Direction_to_vector |
static std::map< std::pair< std::pair< int, int >, std::pair< int, int > >, std::pair< int, int > > | Up_and_right_equivalent_for_pairs_of_vertices |
![]() | |
static const int | OMEGA = 26 |
Default value for an unassigned neighbour. More... | |
![]() | |
OcTree () | |
Default constructor (empty and broken) More... | |
OcTree (RefineableElement *const &object_pt) | |
OcTree (RefineableElement *const &object_pt, Tree *const &father_pt, const int &son_type) | |
![]() | |
Tree () | |
Default constructor (empty and broken) More... | |
Tree (RefineableElement *const &object_pt) | |
Tree (RefineableElement *const &object_pt, Tree *const &father_pt, const int &son_type) | |
![]() | |
TreeRoot * | Root_pt |
Pointer to the root of the tree. More... | |
Tree * | Father_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... | |
RefineableElement * | Object_pt |
Pointer to the object represented by the tree. More... | |
![]() | |
std::map< int, TreeRoot * > | Neighbour_pt |
std::map< int, bool > | Neighbour_periodic |
![]() | |
static bool | Static_data_has_been_setup = false |
Bool indicating that static member data has been setup. More... | |
![]() | |
static double | Max_neighbour_finding_tolerance = 1.0e-14 |
OcTreeRoot is a OcTree that forms the root of a (recursive) octree. The "root node" is special as it holds additional information about its neighbours and their relative rotation (inside a OcTreeForest).
|
inline |
Constructor for the root octree: Pass pointer to the RefineableQElement<3> that is represented by the OcTree.
References OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, oomph::OcTree::Static_data_has_been_setup, and oomph::Global_string_for_annotation::string().
|
delete |
Broken copy constructor.
|
inline |
Add pointer to the edge-neighbouring [Oc]TreeRoot in the (enumerated) (edge) direction – maintains uniqueness
References oomph::OcTreeNames::DB, oomph::OcTreeNames::DF, oomph::OcTree::Direct_string, Edge_neighbour_pt, Eigen::placeholders::end, oomph::OcTreeNames::LB, oomph::OcTreeNames::LD, oomph::OcTreeNames::LF, oomph::OcTreeNames::LU, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, oomph::OcTreeNames::RB, oomph::OcTreeNames::RD, oomph::OcTreeNames::RF, oomph::OcTreeNames::RU, oomph::OcTreeNames::UB, and oomph::OcTreeNames::UF.
Referenced by oomph::OcTreeForest::find_neighbours(), and UnsteadyHeatProblem< ELEMENT >::set_neighbour_periodic_and_up_right_equivalents().
If octree_root_pt is a neighbour, return the direction [faces L/R/F/B/U/D or edges DB/UP/...] in which it is found, otherwise return OMEGA
References oomph::OcTreeNames::B, oomph::OcTreeNames::D, oomph::OcTreeNames::DB, oomph::OcTreeNames::DF, e(), edge_neighbour_pt(), oomph::OcTreeNames::F, L, oomph::OcTreeNames::LB, oomph::OcTreeNames::LD, oomph::OcTreeNames::LF, oomph::OcTreeNames::LU, oomph::TreeRoot::Neighbour_pt, oomph::Tree::OMEGA, R, oomph::OcTreeNames::RB, oomph::OcTreeNames::RD, oomph::OcTreeNames::RF, oomph::OcTreeNames::RU, oomph::OcTreeNames::U, oomph::OcTreeNames::UB, and oomph::OcTreeNames::UF.
Referenced by oomph::OcTreeForest::construct_up_right_equivalents(), right_equivalent(), and up_equivalent().
Return vector of pointers to the edge-neighbouring TreeRoots in the (enumerated) (edge) direction.
References oomph::OcTreeNames::DB, oomph::OcTreeNames::DF, oomph::OcTree::Direct_string, Edge_neighbour_pt, oomph::OcTreeNames::LB, oomph::OcTreeNames::LD, oomph::OcTreeNames::LF, oomph::OcTreeNames::LU, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, oomph::OcTreeNames::RB, oomph::OcTreeNames::RD, oomph::OcTreeNames::RF, oomph::OcTreeNames::RU, oomph::OcTreeNames::UB, and oomph::OcTreeNames::UF.
Referenced by direction_of_neighbour(), and oomph::OcTreeForest::oc_edge_neigh_pt().
Return number of edge-neighbouring OcTreeRoot in the (enumerated) (edge) direction.
References oomph::OcTreeNames::DB, oomph::OcTreeNames::DF, oomph::OcTree::Direct_string, Edge_neighbour_pt, oomph::OcTreeNames::LB, oomph::OcTreeNames::LD, oomph::OcTreeNames::LF, oomph::OcTreeNames::LU, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, oomph::OcTreeNames::RB, oomph::OcTreeNames::RD, oomph::OcTreeNames::RF, oomph::OcTreeNames::RU, oomph::OcTreeNames::UB, and oomph::OcTreeNames::UF.
|
delete |
Broken assignment operator.
The same thing as up_equivalent, but for the right direction: When viewed from the current octree neighbour, our right direction is the neighbour's Right_equivalent[neighbour_pt] direction. Returns OMEGA if the Octree specified by the pointer argument is not a neighbour.
References direction_of_neighbour(), oomph::Tree::OMEGA, and Right_equivalent.
Referenced by oomph::OcTree::gteq_face_neighbour(), and oomph::OcTree::gteq_true_edge_neighbour().
The same thing as up_equivalent, but for the right direction: When viewed from the current octree neighbour, our right direction is the neighbour's Right_equivalent[neighbour_pt] direction.
References Right_equivalent.
Referenced by oomph::OcTreeForest::construct_up_right_equivalents(), and UnsteadyHeatProblem< ELEMENT >::set_neighbour_periodic_and_up_right_equivalents().
Set up equivalent of the neighbours specified by pointer: When viewed from the current octree's neighbour, our up direction is the neighbour's Up_equivalent[neighbour_pt] direction. If there's no rotation, this map contains the identify so that, e.g. Up_equivalent
[neighbour_pt]=U (read as: "in my
neighbour, my Up is its Up"). If the neighbour is rotated by 180 degrees relative to the current octree (around the back-front axis) say, we have Up_equivalent
[neighbour_pt]=D (read as: "in my
neighbour, my Up is its Down"); etc.
References Up_equivalent.
Referenced by oomph::OcTreeForest::construct_up_right_equivalents(), and UnsteadyHeatProblem< ELEMENT >::set_neighbour_periodic_and_up_right_equivalents().
Return up equivalent of the neighbours specified by pointer: When viewed from the current octree's neighbour, our up direction is the neighbour's Up_equivalent[neighbour_pt] direction. If there's no rotation, this map contains the identify so that, e.g. Up_equivalent
[neighbour_pt]=U (read as: "in my
neighbour, my Up is its Up"). If the neighbour is rotated by 180 degrees relative to the current octree (around the back-front axis) say, we have Up_equivalent
[neighbour_pt]=D (read as: "in my
neighbour, my Up is its Down"); etc. Returns OMEGA if the Octree specified by the pointer argument is not a neighbour.
References direction_of_neighbour(), oomph::Tree::OMEGA, and Up_equivalent.
Referenced by oomph::OcTree::gteq_face_neighbour(), and oomph::OcTree::gteq_true_edge_neighbour().
Map of pointers to the edge-neighbouring [Oc]TreeRoots: Edge_neighbour_pt[direction] is Vector to the pointers to the [Oc]TreeRoot's edge neighbours in the (enumerated) (edge) direction.
Referenced by add_edge_neighbour_pt(), edge_neighbour_pt(), and nedge_neighbour().
Map giving the Right equivalent of the neighbour specified by pointer: When viewed from the current octree's neighbour, our right direction is the neighbour's right_equivalent[neighbour_pt] direction. If there's no rotation, this map contains the identify so that, e.g. Right_equivalent
[neighbour_pt]=R (read as: "in my
neighbour, my Right is its Right").
Referenced by right_equivalent(), and set_right_equivalent().
Map giving the Up equivalent of the neighbour specified by pointer: When viewed from the current octree's neighbour, our up direction is the neighbour's Up_equivalent[neighbour_pt] direction. If there's no rotation, this map contains the identify so that, e.g. Up_equivalent
[neighbour_pt]=U (read as: "in my
neighbour, my Up is its Up"). If the neighbour is rotated by 180 degrees relative to the current octree(around the back-front axis), say, we have Up_equivalent
[neighbour_pt]=D (read as: "in my
neighbour, my Up is its Down"); etc.
Referenced by set_up_equivalent(), and up_equivalent().