![]() |
|
#include <octree.h>
Public Member Functions | |
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... | |
Static Public Member Functions | |
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 Public Attributes | |
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... | |
Protected Member Functions | |
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) | |
Static Protected Attributes | |
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 |
Private Member Functions | |
OcTree * | gteq_face_neighbour (const int &direction, double &s_difflo, double &s_diffhi, int &diff_level, bool &in_neighbouring_tree, int max_level, OcTreeRoot *orig_root_pt) const |
OcTree * | gteq_edge_neighbour (const int &direction, const unsigned &i_root_edge_neighbour, unsigned &nroot_edge_neighbour, double &s_diff, int &diff_level, int max_level, OcTreeRoot *orig_root_pt) const |
bool | edge_neighbour_is_face_neighbour (const int &edge, OcTree *edge_neighb_pt) const |
Static Private Member Functions | |
static void | construct_rotation_matrix (int &axis, int &angle, DenseMatrix< int > &mat) |
static void | mult_mat_vect (const DenseMatrix< int > &mat, const Vector< int > &vect1, Vector< int > &vect2) |
Helper function: Performs the operation : vect2 = mat*vect1. More... | |
static void | mult_mat_mat (const DenseMatrix< int > &mat1, const DenseMatrix< int > &mat2, DenseMatrix< int > &mat3) |
Helper function: Performs the operation : mat3=mat1*mat2. More... | |
static Vector< int > | vertex_node_to_vector (const unsigned &n, const unsigned &nnode1d) |
Static Private Attributes | |
static Vector< int > | Cosi |
Entry in rotation matrix: cos(i*90) More... | |
static Vector< int > | Sini |
Entry in rotation matrix sin(i*90) More... | |
static DenseMatrix< bool > | Is_adjacent |
static DenseMatrix< int > | Reflect |
static DenseMatrix< int > | Common_face |
static Vector< std::string > | Colour |
Colours for neighbours in various directions. More... | |
static DenseMatrix< double > | S_base |
static DenseMatrix< double > | S_steplo |
static DenseMatrix< double > | S_stephi |
static DenseMatrix< double > | S_directlo |
static DenseMatrix< double > | S_directhi |
static DenseMatrix< double > | S_base_edge |
static DenseMatrix< double > | S_step_edge |
static DenseMatrix< double > | S_direct_edge |
Additional Inherited Members | |
![]() | |
typedef void(Tree::* | VoidMemberFctPt) () |
Function pointer to argument-free void Tree member function. More... | |
typedef void(Tree::* | VoidMeshPtArgumentMemberFctPt) (Mesh *&mesh_pt) |
![]() | |
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... | |
OcTree class: Recursively defined, generalised octree.
An OcTree has:
The tree can also be part of a forest. If that is the case, the root will have pointers to the roots of neighbouring octrees.
The objects contained in the octree are assumed to be (topologically) cubic elements whose geometry is parametrised by local coordinates \( {\bf s} \in [-1,1]^3 \).
The tree can be traversed while actions are being performed at all of its "nodes" or only at the leaf "nodes".
Finally, the leaf "nodes" can be split depending on criteria defined by the object.
Note that OcTrees are only generated by splitting existing OcTrees. Therefore, the constructors are protected. The only OcTree that "Joe User" can create is the (derived) class OcTreeRoot.
|
inlinevirtual |
|
delete |
Broken copy constructor.
|
inlineprotected |
Default constructor (empty and broken)
References OOMPH_CURRENT_FUNCTION, and OOMPH_EXCEPTION_LOCATION.
Referenced by construct_son().
|
inlineprotected |
Constructor for empty (root) tree: no father, no sons; just pass a pointer to its object (a RefineableQElement<3>). This is protected because OcTrees can only be created internally, during the split operation. Only OcTreeRoots can be created externally.
|
inlineprotected |
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 (LDB,RDB,...) it is. Protected because OcTrees can only be created internally, during the split operation. Only OcTreeRoots can be created externally.
|
staticprivate |
This constructs the rotation matrix of the rotation around the axis axis
with an angle of angle*90
Build the rotation matrix for a rotation around the axis axis
of an angle angle*90
References a, Jeffery_Solution::angle(), b, calibrate::c, Cosi, oomph::OcTreeNames::F, i, j, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, R, oomph::OcTreeNames::R, Sini, RachelsAdvectionDiffusion::U, and oomph::OcTreeNames::U.
Referenced by rotate().
|
inlinevirtual |
Overload the function construct_son to ensure that the son is a specific OcTree and not a general Tree.
Implements oomph::Tree.
References oomph::Tree::father_pt(), oomph::Tree::object_pt(), OcTree(), and oomph::Tree::son_type().
|
static |
Doc/check all face neighbours of octree (nodes) contained in the Vector forest_node_pt. Output into neighbours_file which can be viewed from tecplot with OcTreeNeighbours.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.
Doc/check all face neighbours of octree (nodes) contained in the Vector forest_node_pt. Output into neighbours_file which can be viewed from tecplot with OcTreeNeighbours.mcr Neighbour info and errors are displayed on neighbours_txt_file. Finally, compute the max. error between vertices when viewed from neighbouring element. If the two filestreams are closed, output is suppressed. (Static function.)
References Colour, Direct_string, calibrate::error, oomph::OcTreeNames::F, boost::multiprecision::fabs(), oomph::FiniteElement::get_x(), gteq_face_neighbour(), i, oomph::TreeRoot::is_neighbour_periodic(), L, MeshRefinement::max_error, oomph::Tree::Max_neighbour_finding_tolerance, oomph::RefineableElement::nodes_built(), oomph::RefineableElement::number(), oomph::Tree::object_pt(), oomph::Tree::OMEGA, oomph::pause(), Eigen::bfloat16_impl::pow(), oomph::Tree::root_pt(), s, S_base, S_stephi, S_steplo, sqrt(), and plotDoE::x.
Referenced by oomph::OcTreeForest::check_all_neighbours(), self_test(), and oomph::OcTreeForest::self_test().
|
static |
Doc/check all true edge neighbours of octree (nodes) contained in the Vector forest_node_pt. Output into neighbours_file which can be viewed from tecplot with OcTreeNeighbours.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.
/////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////// Doc/check all true edge neighbours of octree (nodes) contained in the Vector forest_node_pt. Output into neighbours_file which can be viewed from tecplot with OcTreeNeighbours.mcr Neighbour info and errors are displayed on neighbours_txt_file. Finally, compute the max. error between vertices when viewed from neighbouring element. If the two filestreams are closed, output is suppressed. (Static function).
References Colour, Direct_string, calibrate::error, boost::multiprecision::fabs(), faces_of_common_edge(), oomph::FiniteElement::get_x(), gteq_true_edge_neighbour(), i, oomph::Tree::is_leaf(), oomph::TreeRoot::is_neighbour_periodic(), oomph::OcTreeNames::LB, MeshRefinement::max_error, oomph::Tree::Max_neighbour_finding_tolerance, oomph::RefineableElement::nodes_built(), oomph::RefineableElement::number(), oomph::Tree::object_pt(), oomph::Tree::OMEGA, oomph::pause(), Eigen::bfloat16_impl::pow(), oomph::Tree::root_pt(), s, S_base_edge, S_step_edge, sqrt(), oomph::OcTreeNames::UF, and plotDoE::x.
Referenced by oomph::OcTreeForest::check_all_neighbours(), self_test(), and oomph::OcTreeForest::self_test().
|
private |
Is the edge neighbour (for edge "edge") specified via the pointer also a face neighbour for one of the two adjacent faces?
References D, oomph::OcTreeNames::DB, oomph::OcTreeNames::DF, Direct_string, oomph::OcTreeNames::F, gteq_face_neighbour(), L, oomph::OcTreeNames::LB, oomph::OcTreeNames::LD, oomph::OcTreeNames::LF, oomph::OcTreeNames::LU, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, R, oomph::OcTreeNames::RB, oomph::OcTreeNames::RD, oomph::OcTreeNames::RF, oomph::OcTreeNames::RU, RachelsAdvectionDiffusion::U, oomph::OcTreeNames::UB, and oomph::OcTreeNames::UF.
Referenced by gteq_true_edge_neighbour().
Function that, given an edge, returns the two faces on which it.
Given an edge, this function returns the faces on which it lies.
References D, oomph::OcTreeNames::DB, oomph::OcTreeNames::DF, Direct_string, oomph::OcTreeNames::F, L, oomph::OcTreeNames::LB, oomph::OcTreeNames::LD, oomph::OcTreeNames::LF, oomph::OcTreeNames::LU, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, R, oomph::OcTreeNames::RB, oomph::OcTreeNames::RD, oomph::OcTreeNames::RF, oomph::OcTreeNames::RU, RachelsAdvectionDiffusion::U, oomph::OcTreeNames::UB, and oomph::OcTreeNames::UF.
Referenced by doc_true_edge_neighbours(), oomph::PRefineableQElement< 3, INITIAL_NNODE_1D >::node_created_by_neighbour(), oomph::RefineableQElement< 3 >::node_created_by_neighbour(), and oomph::PRefineableQElement< 3, INITIAL_NNODE_1D >::node_created_by_son_of_neighbour().
|
static |
If an edge is bordered by the nodes whose local numbers are n1 and n2 in an element with nnode1d nodes along each coordinate direction, then this edge is shared by two faces. This function takes one of these faces as the argument face
and returns the other one. (face
is a direction in the set U,D,F,B,L,R).
This function takes as argument two node numbers of two nodes delimiting an edge, and one face of this edge and returns the other face that is sharing this edge. The node numbers given to this function MUST be vertices nodes to work. it also need the value of nnode1d to work. (face
is a direction in the set U,D,F,B,L,R).
References Direction_to_vector, i, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, Vector_to_direction, and vertex_node_to_vector().
Referenced by oomph::OcTreeForest::construct_up_right_equivalents().
|
private |
Find ‘greater-or-equal-sized edge neighbour’ in given direction (LB,RB,DB,UB [the back edges], LD,RD,LU,RU [the side edges], LF,RF,DF,UF [the front edges]).
This is an auxiliary routine which allows neighbour finding in adjacent octrees. Needs to keep track of the maximum level to which search is performed because in the presence of OcTree forests, the search isn't purely recursive.
Parameters:
i_root_edge_neighbour
specifies which of these is used. Use this as "reverse communication": First call with i_root_edge_neighbour=0
and n_root_edge_neighour
initialised to anything you want (zero, ideally). On return from the fct, n_root_edge_neighour
contains the total number of true edge neighbours, so additional calls to the fct with i_root_edge_neighbour>0
can be made until they've all been visited.Note: some of the auxiliary information may be incorrect if the neighbour is not a true edge neighbour. We don't care because we're not dealing with those!
Find ‘greater-or-equal-sized edge neighbour’ in given direction (LB,RB,DB,UB [the back edges], LD,RD,LU,RU [the side edges], LF,RF,DF,UF [the front edges]).
This is an auxiliary routine which allows neighbour finding in adjacent octrees. Needs to keep track of previous son types and the maximum level to which search is performed.
Parameters:
i_root_edge_neighbour
specifies which of these is used. Use this as "reverse communication": First call with i_root_edge_neighbour=0
and n_root_edge_neighour
initialised to anything you want (zero, ideally). On return from the fct, n_root_edge_neighour
contains the total number of true edge neighbours, so additional calls to the fct with i_root_edge_neighbour>0
can be made until they've all been visited.References Common_face, oomph::OcTreeNames::DB, oomph::OcTreeNames::DF, Direct_string, oomph::Tree::Father_pt, gteq_face_neighbour(), Is_adjacent, oomph::OcTreeNames::LB, oomph::OcTreeNames::LD, oomph::Tree::Level, oomph::OcTreeNames::LF, oomph::OcTreeNames::LU, oomph::Tree::OMEGA, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, Eigen::bfloat16_impl::pow(), oomph::OcTreeNames::RB, oomph::OcTreeNames::RD, Reflect, oomph::OcTreeNames::RF, oomph::Tree::Root_pt, rotate(), oomph::OcTreeNames::RU, S_direct_edge, oomph::Tree::Son_pt, oomph::Tree::Son_type, oomph::OcTreeNames::UB, and oomph::OcTreeNames::UF.
Referenced by gteq_true_edge_neighbour().
|
private |
Find ‘greater-or-equal-sized face neighbour’ in given direction (L/R/U/D/B/F).
This is an auxiliary routine which allows neighbour finding in adjacent octrees. Needs to keep track of the maximum level to which search is performed because in the presence of OcTree forests, the search isn't purely recursive.
Parameters:
Find ‘greater-or-equal-sized face neighbour’ in given direction (L/R/U/D/B/F).
This is an auxiliary routine which allows neighbour finding in adjacent octrees. Needs to keep track of previous son types and the maximum level to which search is performed.
Parameters:
References D, Direct_string, oomph::OcTreeNames::F, oomph::Tree::Father_pt, gteq_face_neighbour(), Is_adjacent, L, oomph::Tree::Level, oomph::TreeRoot::neighbour_pt(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, Eigen::bfloat16_impl::pow(), R, Reflect, oomph::Tree::Root_pt, rotate(), S_directhi, S_directlo, oomph::Tree::Son_pt, oomph::Tree::Son_type, and RachelsAdvectionDiffusion::U.
OcTree * oomph::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 |
Find (pointer to) ‘greater-or-equal-sized face neighbour’ in given direction (L/R/U/D/F/B). Another way of interpreting this is that we're looking for the neighbour across the present element's face 'direction'. The various arguments return additional information about the size and relative orientation of the neighbouring octree. To interpret these we use the following General convention:
With this convention, the interpretation of the arguments is as follows:
translate_s
turns the index of the local coordinate in the present octree into that of the neighbour. If there are no rotations then translate_s
[i] = i.s_sw
[0], s_sw
[1], s_sw
[2]) in the neighbouring octree.s_ne
[0], s_ne
[1], s_ne
[2]) in the neighbouring octree.direction
. When viewed from the neighbouring octree, the face that separates the present octree from its neighbour is the neighbour's face face
. If there's no rotation between the two octrees, this is a simple reflection: For instance, if we're looking for a neighhbour in the R
[ight] direction
, face
will be L
[eft]diff_level
<= 0 indicates the difference in refinement levels between the two neighbours. If diff_level==0
, the neighbour has the same size as the current octree. References abs(), D, Direct_string, Direction_to_vector, oomph::OcTreeNames::F, i, k, L, oomph::Tree::Level, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, Eigen::bfloat16_impl::pow(), R, Reflect_face, oomph::OcTreeRoot::right_equivalent(), oomph::Tree::Root_pt, rotate(), S_base, S_stephi, S_steplo, RachelsAdvectionDiffusion::U, and oomph::OcTreeRoot::up_equivalent().
Referenced by oomph::RefineableQElement< 3 >::check_integrity(), doc_face_neighbours(), edge_neighbour_is_face_neighbour(), gteq_edge_neighbour(), gteq_face_neighbour(), oomph::PRefineableQElement< 3, INITIAL_NNODE_1D >::node_created_by_neighbour(), oomph::RefineableQElement< 3 >::node_created_by_neighbour(), oomph::PRefineableQElement< 3, INITIAL_NNODE_1D >::node_created_by_son_of_neighbour(), oomph::RefineableQElement< 3 >::oc_hang_helper(), and oomph::PRefineableQElement< 3, INITIAL_NNODE_1D >::oc_hang_helper().
OcTree * oomph::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 |
Find (pointer to) ‘greater-or-equal-sized true edge neighbour’ in the given direction (LB,RB,DB,UB [the back edges], LD,RD,LU,RU [the side edges], LF,RF,DF,UF [the front edges]).
Another way of interpreting this is that we're looking for the neighbour across the present element's edge 'direction'. The various arguments return additional information about the size and relative orientation of the neighbouring octree. Each edge of the element that is represented by the octree is parametrised by one (of the three) local coordinates that parametrise the entire 3D element. E.g. the L[eft]B[ack] edge is parametrised by s[1]; the "low" vertex of this edge (located at the low value of this coordinate, i.e. at s[1]=-1) is L[eft]D[own]B[ack]. The "high" vertex of this edge (located at the high value of this coordinate, i.e. at s[1]=1) is L[eft]U[p]B[ack]; etc
The interpretation of the arguments is as follows:
i_root_edge_neighbour
specifies which of these is used. Use this as "reverse communication": First call with i_root_edge_neighbour=0
and n_root_edge_neighour
initialised to anything you want (zero, ideally). On return from the fct, n_root_edge_neighour
contains the total number of true edge neighbours, so additional calls to the fct with i_root_edge_neighbour>0
can be made until they've all been visited.translate_s
turns the index of the local coordinate in the present octree into that of the neighbour. If there are no rotations then translate_s
[i] = i.s_lo
[0], s_lo
[1], s_lo
[2])s_hi
[0], s_hi
[1], s_hi
[2])direction
. When viewed from the neighbouring octree, the edge that separates the present octree from its neighbour is the neighbour's edge edge
. If there's no rotation between the two octrees, this is a simple reflection: For instance, if we're looking for a neighhbour in the DB
direction
, edge
will be UF
.diff_level
<= 0 indicates the difference in refinement levels between the two neighbours. If diff_level==0
, the neighbour has the same size as the current octree.Important: We're only looking for true edge neighbours i.e. edge neigbours that are not also face neighbours. This is an important difference to Samet's terminology. If the neighbour in a certain direction is not a true edge neighbour, or if there is no neighbour, then this function returns NULL.
References abs(), oomph::OcTreeNames::DB, oomph::OcTreeNames::DF, Direct_string, Direction_to_vector, edge_neighbour_is_face_neighbour(), oomph::OcTreeNames::F, gteq_edge_neighbour(), i, k, oomph::OcTreeNames::LB, oomph::OcTreeNames::LD, oomph::Tree::Level, oomph::OcTreeNames::LF, oomph::OcTreeNames::LU, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, Eigen::bfloat16_impl::pow(), R, oomph::OcTreeNames::RB, oomph::OcTreeNames::RD, Reflect_edge, oomph::OcTreeNames::RF, oomph::OcTreeRoot::right_equivalent(), oomph::Tree::Root_pt, rotate(), oomph::OcTreeNames::RU, S_base_edge, S_step_edge, RachelsAdvectionDiffusion::U, oomph::OcTreeNames::UB, oomph::OcTreeNames::UF, and oomph::OcTreeRoot::up_equivalent().
Referenced by doc_true_edge_neighbours(), oomph::PRefineableQElement< 3, INITIAL_NNODE_1D >::node_created_by_neighbour(), oomph::RefineableQElement< 3 >::node_created_by_neighbour(), oomph::PRefineableQElement< 3, INITIAL_NNODE_1D >::node_created_by_son_of_neighbour(), and oomph::PRefineableQElement< 3, INITIAL_NNODE_1D >::oc_hang_helper().
|
staticprivate |
|
staticprivate |
Helper function: Performs the operation : vect2 = mat*vect1.
Helper: Performs the operation Vect2=Mat*Vect1.
Referenced by rotate().
Return the vertex [LDB,RDB,...] of local (vertex) node n in an element with nnode1d nodes in each coordinate direction.
Return the vertex of local (vertex) node n in an element with nnode1d nodes in each coordinate direction.
References oomph::OcTreeNames::LDB, oomph::OcTreeNames::LDF, oomph::OcTreeNames::LUB, oomph::OcTreeNames::LUF, n, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, oomph::OcTreeNames::RDB, oomph::OcTreeNames::RDF, oomph::OcTreeNames::RUB, and oomph::OcTreeNames::RUF.
Referenced by oomph::OcTreeForest::construct_up_right_equivalents().
|
delete |
Broken assignment operator.
If U[p] becomes new_up and R[ight] becomes new_right then the direction dir
becomes rotate(new_up, new_right, dir)
A rotation is defined by the newUp and newRight directions; so if Up becomes newUp and Right becomes newRight then dir becomes rotate(newUp,newRight,dir);
References D, Direct_string, Direction_to_vector, oomph::OcTreeNames::F, L, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, R, rotate(), RachelsAdvectionDiffusion::U, and Vector_to_direction.
|
static |
If U[p] becomes new_up and R[ight] becomes new_right then the direction vector dir
becomes rotate(new_up, new_right, dir)
This function rotates a vector according to a rotation of the axes that changes up to new_up and right to new_right.
References construct_rotation_matrix(), D, Direct_string, oomph::OcTreeNames::F, i, j, L, mat1(), mult_mat_mat(), mult_mat_vect(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, R, and RachelsAdvectionDiffusion::U.
Referenced by gteq_edge_neighbour(), gteq_face_neighbour(), gteq_true_edge_neighbour(), rotate(), and setup_static_data().
unsigned oomph::OcTree::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 Tree::Max_neighbour_finding_tolerance.
Self-test: Check neighbour finding routine. For each element in the tree and for each vertex, determine the distance between the vertex and its position in the neigbour. . If the difference is less than Tree::Max_neighbour_finding_tolerance. return success (0), otherwise failure (1)
References doc_face_neighbours(), doc_true_edge_neighbours(), i, MeshRefinement::max_error, oomph::Tree::Max_neighbour_finding_tolerance, oomph::oomph_info, and oomph::Tree::stick_all_tree_nodes_into_vector().
|
static |
Setup the static data, rotation and reflection schemes, etc.
Setup static data for OcTree.
References Colour, Common_face, Cosi, D, oomph::OcTreeNames::DB, oomph::OcTreeNames::DF, Direct_string, Direction_to_vector, oomph::OcTreeNames::F, i, Is_adjacent, j, k, L, oomph::OcTreeNames::LB, oomph::OcTreeNames::LD, oomph::OcTreeNames::LDB, oomph::OcTreeNames::LDF, oomph::OcTreeNames::LF, oomph::OcTreeNames::LU, oomph::OcTreeNames::LUB, oomph::OcTreeNames::LUF, num_elem(), oomph::Tree::OMEGA, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, oomph::oomph_info, R, oomph::OcTreeNames::RB, oomph::OcTreeNames::RD, oomph::OcTreeNames::RDB, oomph::OcTreeNames::RDF, Reflect, Reflect_edge, Reflect_face, Reflect_vertex, oomph::DenseMatrix< T >::resize(), oomph::OcTreeNames::RF, rotate(), oomph::OcTreeNames::RU, oomph::OcTreeNames::RUB, oomph::OcTreeNames::RUF, S_base, S_base_edge, S_direct_edge, S_directhi, S_directlo, S_step_edge, S_stephi, S_steplo, set(), Sini, Static_data_has_been_setup, RachelsAdvectionDiffusion::U, oomph::OcTreeNames::UB, oomph::OcTreeNames::UF, Up_and_right_equivalent_for_pairs_of_vertices, Vector_to_direction, and Vertex_at_end_of_edge.
Referenced by oomph::RefineableBrickMesh< ELEMENT >::RefineableBrickMesh(), and oomph::RefineableEighthSphereMesh< ELEMENT >::RefineableEighthSphereMesh().
|
staticprivate |
Returns the vector of the coordinate directions of vertex node number n in an element with nnode1d element per dimension.
This function is used to translate the position of a vertex node (given by his local number n into a vector giving the position of this node in the local coordinates system. It also needs the value of nnode1d to work.
References a, b, calibrate::c, n, OOMPH_CURRENT_FUNCTION, and OOMPH_EXCEPTION_LOCATION.
Referenced by get_the_other_face().
|
static |
Return the local node number of given vertex [LDB,RDB,...] in an element with nnode1d nodes in each coordinate direction
Return the local node number of given vertex in an element with nnode1d nodes in each coordinate direction.
References Direct_string, oomph::OcTreeNames::LDB, oomph::OcTreeNames::LDF, oomph::OcTreeNames::LUB, oomph::OcTreeNames::LUF, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, oomph::OcTreeNames::RDB, oomph::OcTreeNames::RDF, oomph::OcTreeNames::RUB, and oomph::OcTreeNames::RUF.
Referenced by oomph::OcTreeForest::construct_up_right_equivalents(), and oomph::HelmholtzMGPreconditioner< DIM >::maximum_edge_width().
|
staticprivate |
Colours for neighbours in various directions.
Referenced by doc_face_neighbours(), doc_true_edge_neighbours(), and setup_static_data().
|
staticprivate |
Determine common face of edges or octants. Slightly bizarre lookup scheme from Samet's book.
Referenced by gteq_edge_neighbour(), and setup_static_data().
Entry in rotation matrix: cos(i*90)
Referenced by construct_rotation_matrix(), and setup_static_data().
|
static |
Translate (enumerated) directions into strings.
Referenced by oomph::OcTreeRoot::add_edge_neighbour_pt(), doc_face_neighbours(), doc_true_edge_neighbours(), edge_neighbour_is_face_neighbour(), oomph::OcTreeRoot::edge_neighbour_pt(), faces_of_common_edge(), gteq_edge_neighbour(), gteq_face_neighbour(), gteq_true_edge_neighbour(), oomph::RefineableQElement< 3 >::interpolated_zeta_on_face(), oomph::EighthSphereDomain::macro_element_boundary(), oomph::ExtrudedDomain::macro_element_boundary(), oomph::OcTreeRoot::nedge_neighbour(), oomph::OcTreeForest::oc_face_neigh_pt(), rotate(), setup_static_data(), and vertex_to_node_number().
For each direction, i.e. a son_type (vertex), a face or an edge, this defines a vector that indicates this direction. E.g : Direction_to_vector[RDB]=(1,-1,-1), Direction_to_vector[U]=(0,1,0)
Vector storing the information to translate a direction into a vector of directions (in the three coordinate directions)
Referenced by oomph::PRefineableGeneralisedNewtonianQCrouzeixRaviartElement< DIM >::further_build(), oomph::RefineableGeneralisedNewtonianQCrouzeixRaviartElement< DIM >::further_build(), oomph::PRefineableQCrouzeixRaviartElement< DIM >::further_build(), oomph::RefineableQPVDElementWithPressure< DIM >::further_build(), oomph::RefineableQElement< 3 >::get_bcs(), oomph::RefineableQElement< 3 >::get_boundaries(), oomph::RefineableSolidQElement< 3 >::get_solid_bcs(), get_the_other_face(), gteq_face_neighbour(), gteq_true_edge_neighbour(), rotate(), oomph::RefineableQElement< 3 >::setup_father_bounds(), and setup_static_data().
|
staticprivate |
Array of direction/octant adjacency scheme: Is_adjacent(direction,octant): Is face/edge direction
adjacent to octant octant
? (Table in Samet's book)
Array of direction/octant adjacency scheme: Is_adjacent(direction,octant): Is face/edge direction
adjacent to octant octant
? Table in Samet's book.
Referenced by gteq_edge_neighbour(), gteq_face_neighbour(), and setup_static_data().
|
staticprivate |
Reflection scheme: Reflect(direction,octant): Get mirror of octant/edge in specified direction. E.g. Reflect(LDF,L)=RDF
Referenced by gteq_edge_neighbour(), gteq_face_neighbour(), and setup_static_data().
Get opposite edge, e.g. Reflect_edge[DB]=UF.
Referenced by gteq_true_edge_neighbour(), and setup_static_data().
Get opposite face, e.g. Reflect_face[L]=R.
Referenced by oomph::OcTreeForest::construct_up_right_equivalents(), gteq_face_neighbour(), and setup_static_data().
Get opposite vertex, e.g. Reflect_vertex[LDB]=RUF.
Referenced by setup_static_data().
|
staticprivate |
s_base(i,direction): Initial value for coordinate s[i] on the face indicated by direction (L/R/U/D/F/B)
Referenced by doc_face_neighbours(), gteq_face_neighbour(), and setup_static_data().
|
staticprivate |
S_base_edge(i,edge): Initial value for coordinate s[i] on the specified edge (LF/RF/...).
Referenced by doc_true_edge_neighbours(), gteq_true_edge_neighbour(), and setup_static_data().
|
staticprivate |
Relative to the left/down/back vertex in any (father) octree, the corresponding vertex in the son specified by son_octant
has an offset. If we project the son_octant's left/down/back vertex onto the father's edge edge
, it is located at the in-face coordinate s_lo
= h/2 S_direct_edge(edge,son_octant)
.
Referenced by gteq_edge_neighbour(), and setup_static_data().
|
staticprivate |
Relative to the left/down/back vertex in any (father) octree, the corresponding vertex in the son specified by son_octant
has an offset. If we project the son_octant's left/down/back vertex onto the father's face face
, it is located at the in-face coordinate s_hi
= h/2 S_directlhi(face,son_octant)
. [See discussion of s_steplo
for an explanation of the subscripts _hi
and _lo
.]
Relative to the left/down/back vertex in any (father) octree, the corresponding vertex in the son specified by son_octant
has an offset. If we project the son_octant's left/down/back vertex onto the father's face face
, it is located at the in-face coordinate s_hi
= h/2 S_directlhi(face,son_octant)
. [See discussion of S_steplo
for an explanation of the subscripts _hi
and _lo
.]
Referenced by gteq_face_neighbour(), and setup_static_data().
|
staticprivate |
Relative to the left/down/back vertex in any (father) octree, the corresponding vertex in the son specified by son_octant
has an offset. If we project the son_octant's left/down/back vertex onto the father's face face
, it is located at the in-face coordinate s_lo
= h/2 S_directlo(face,son_octant)
. [See discussion of s_steplo
for an explanation of the subscripts _hi
and _lo
.]
Relative to the left/down/back vertex in any (father) octree, the corresponding vertex in the son specified by son_octant
has an offset. If we project the son_octant's left/down/back vertex onto the father's face face
, it is located at the in-face coordinate s_lo
= h/2 S_directlo(face,son_octant)
. [See discussion of S_steplo
for an explanation of the subscripts _hi
and _lo
.]
Referenced by gteq_face_neighbour(), and setup_static_data().
|
staticprivate |
Each edge of the RefineableQElement<3> that is represented by the octree is parametrised by one (of the three) local coordinates that parametrise the entire 3D element. If we're located on edge edge
[DB,UB,...], then an increase in s from -1 to +1 corresponds to a change of s_step_edge(i,edge)
in the 3D coordinates s
[i].
Referenced by doc_true_edge_neighbours(), gteq_true_edge_neighbour(), and setup_static_data().
|
staticprivate |
If we're located on face face
[L/R/F/B/U/D], then an increase in s_hi from -1 to +1 corresponds to a change of s_stephi(i,face)
in the 3D coordinate \ s[i]. [Read the discussion of s_steplo
for an explanation of the subscripts _hi
and _lo
.]
If we're located on face face
[L/R/F/B/U/D], then an increase in s_hi from -1 to +1 corresponds to a change of S_stephi(i,face)
in the 3D coordinate \ s[i]. [Read the discussion of S_steplo
for an explanation of the subscripts _hi
and _lo
.]
Referenced by doc_face_neighbours(), gteq_face_neighbour(), and setup_static_data().
|
staticprivate |
Each face of the RefineableQElement<3> that is represented by the octree is parametrised by two (of the three) local coordinates that parametrise the entire 3D element. E.g. the B[ack] face is parametrised by (s[0], s[1]); the D[own] face is parametrised by (s[0],s[2]); etc. We always identify the in-face coordinate with the lower (3D) index with the subscript _lo
and the one with the larger (3D) index with the subscript _hi
. Here we set up the translation scheme between the 2D in-face coordinates (s_lo,s_hi) and the corresponding 3D coordinates: If we're located on face face
[L/R/F/B/U/D], then an increase in s_lo from -1 to +1 corresponds to a change of s_steplo(i,face)
in the 3D coordinate s
[i].
Each face of the RefineableQElement<3> that is represented by the octree is parametrised by two (of the three) local coordinates that parametrise the entire 3D element. E.g. the B[ack] face is parametrised by (s[0], s[1]); the D[own] face is parametrised by (s[0],s[2]); etc. We always identify the in-face coordinate with the lower (3D) index with the subscript _lo
and the one with the larger (3D) index with the subscript _hi
. Here we set up the translation scheme between the 2D in-face coordinates (s_lo,s_hi) and the corresponding 3D coordinates: If we're located on face face
[L/R/F/B/U/D], then an increase in s_lo from -1 to +1 corresponds to a change of S_steplo(i,face)
in the 3D coordinate s
[i]. S_steplo(i,direction)
Referenced by doc_face_neighbours(), gteq_face_neighbour(), and setup_static_data().
Entry in rotation matrix sin(i*90)
Entry in rotation matrix: sin(i*90)
Referenced by construct_rotation_matrix(), and setup_static_data().
|
staticprotected |
Bool indicating that static member data has been setup.
Referenced by oomph::OcTreeRoot::OcTreeRoot(), and setup_static_data().
|
static |
Storage for the up/right-equivalents corresponding to two pairs of vertices along an element edge:
These two pairs completely define the relative rotation between the reference element and its edge neighbour. The map returns a pair which contains the up_equivalent and the right_equivalent of the edge neighbour, i.e. it tells us which direction in the edge neighbour coincides with the up (or right) direction in the reference element.
Referenced by oomph::OcTreeForest::construct_up_right_equivalents(), and setup_static_data().
Each vector representing a direction can be translated into a direction, either a son type (vertex), a face or an edge. E.g. : Vector_to_direction[(1,-1,1)]=RDF, Vector_to_direction[(0,1,0)]=U
Map storing the information to translate a vector of directions (in the three coordinate directions) into a direction
Referenced by oomph::RefineableQElement< 3 >::get_bcs(), oomph::RefineableSolidQElement< 3 >::get_solid_bcs(), get_the_other_face(), rotate(), oomph::RefineableQElement< 3 >::setup_father_bounds(), and setup_static_data().
Map of vectors containing the two vertices for each edge.
Vector
of vectors containing the two vertices for each edge, e.g. Vertex_at_end_of_edge
[LU][0]=LUB and Vertex_at_end_of_edge
[LU][1]=LUF.
Referenced by oomph::OcTreeForest::construct_up_right_equivalents(), and setup_static_data().