100 std::map<std::pair<std::pair<int, int>, std::pair<int, int>>,
245 <<
" is not a vertex node in a brick element with "
246 <<
nnode1d <<
" nodes along each edge!";
270 using namespace OcTreeNames;
417 using namespace OcTreeNames;
493 using namespace OcTreeNames;
505 <<
" is not a vertex node in a brick element with "
506 <<
nnode1d <<
" nodes along each edge!";
549 <<
" is not a vertex node in a brick element with "
550 <<
nnode1d <<
" nodes along each edge!" << std::endl;
584 for (
unsigned i = 0;
i < 3;
i++)
613 using namespace OcTreeNames;
614 int a = 0, b = 0, c = 0,
i,
j;
647 for (
i = 0;
i < 3;
i++)
649 for (
j = 0;
j < 3;
j++)
669 for (
i = 0;
i < 3;
i++)
671 for (
j = 0;
j < 3;
j++)
674 for (
k = 0;
k < 3;
k++)
692 for (
i = 0;
i < 3;
i++)
695 for (
k = 0;
k < 3;
k++)
711 using namespace OcTreeNames;
754 using namespace OcTreeNames;
806 <<
"It should be R, B, L, or F" << std::endl;
843 <<
"It should be R, B, L, or F" << std::endl;
881 <<
"It should be D, B, U, or F" << std::endl;
919 <<
"It should be D, B, U, or F" << std::endl;
957 <<
"It should be R, L, U, or D" << std::endl;
994 <<
"It should be R, L, U, or D" << std::endl;
1020 for (
int i = 0;
i < 3;
i++)
1022 for (
int j = 0;
j < 3;
j++)
1042 using namespace OcTreeNames;
1049 error_stream <<
"Inconsistent enumeration! \n Tree::OMEGA="
2192 for (
int i = -1;
i < 2;
i++)
2194 for (
int j = -1;
j < 2;
j++)
2196 for (
int k = -1;
k < 2;
k++)
2294 oomph_info <<
"there might be a problem with Vector_to_direction"
2308 for (
int i = LDB;
i <= F;
i++)
2312 for (
int j = 0;
j < 3;
j++)
2319 for (
unsigned j = 0;
j < 3;
j++)
2344 oomph_info <<
"Direction Error !!" << std::endl;
2364 std::map<std::pair<int, int>, std::set<std::pair<int, int>>>
2686 for (
unsigned i = 0;
i < 3;
i++)
2726 std::set_intersection(
2736 for (std::set<std::pair<int, int>>::iterator
it =
2755 .second =
it->second;
2784 using namespace OcTreeNames;
3318 <<
edge << std::endl;
3381 using namespace OcTreeNames;
3425 for (
unsigned i = 0;
i < 3;
i++)
3523 for (
int i = 0;
i < 3;
i++)
3534 for (
unsigned i = 0;
i < 3;
i++)
3539 for (
unsigned k = 0;
k < 3;
k++)
3551 for (
unsigned i = 0;
i < 3;
i++)
3628 using namespace OcTreeNames;
3676 for (
unsigned i = 0;
i < 3;
i++)
3770 for (
int i = 0;
i < 3;
i++)
3781 for (
unsigned i = 0;
i < 3;
i++)
3786 for (
unsigned k = 0;
k < 3;
k++)
3798 for (
unsigned i = 0;
i < 3;
i++)
3847 using namespace OcTreeNames;
3855 <<
" is not L, R, B, F, D or U." << std::endl;
4023 using namespace OcTreeNames;
4234 <<
"\n \n Failed self_test() for OcTree because of faces: Max. error "
4243 <<
"\n \n Failed self_test() for OcTree because of edges: Max. error "
4258 oomph_info <<
"Passed self_test() for OcTree: Max. error " << max_error
4280 using namespace OcTreeNames;
4310 if (
el_pt->object_pt()->nodes_built())
4346 <<
el_pt->object_pt()->number() <<
" is "
4347 <<
neighb_pt->object_pt()->number() <<
" diff_level "
4348 <<
diff_level <<
". Inside the neighbour the face is "
4359 <<
"\n#---------------------------------" << std::endl;
4413 if (std::fabs(
error) > max_error)
4415 max_error = std::fabs(
error);
4480 if (std::fabs(
error) > max_error)
4482 max_error = std::fabs(
error);
4515 <<
"#---------------------------------\n"
4518 <<
"#---------------------------------" << std::endl;
4558 using namespace OcTreeNames;
4587 if (
el_pt->object_pt()->nodes_built())
4629 <<
el_pt->object_pt()->number() <<
" is "
4630 <<
neighb_pt->object_pt()->number() <<
" diff_level "
4631 <<
diff_level <<
". Inside the neighbour the edge is "
4639 <<
"#---------------------------------"
4641 <<
"\n#---------------------------------" << std::endl;
4708 if (std::fabs(
error) > max_error)
4710 max_error = std::fabs(
error);
4778 if (std::fabs(
error) > max_error)
4780 max_error = std::fabs(
error);
4827 if (
el_pt->is_leaf())
4845 <<
x_start[2] <<
" " << std::endl;
4847 <<
x_end[2] <<
" " << std::endl;
4887 using namespace OcTreeNames;
4915 using namespace OcTreeNames;
4925 "Trying to setup the neighbour scheme for an empty forest",
4945 ->vertex_node_pt(
j);
4956 for (std::map<
Node*, std::set<unsigned>>::iterator
it =
4962 for (std::set<unsigned>::iterator
it_el1 =
it->second.begin();
4966 unsigned i = (*it_el1);
4967 for (std::set<unsigned>::iterator
it_el2 =
it->second.begin();
4971 unsigned j = (*it_el2);
5257 using namespace OcTreeNames;
5318 <<
"'s Up neighbour has no neighbour pointer to Tree "
5370 <<
"'s Right neighbour has no neighbour pointer to Tree "
5421 <<
"'s Down neighbour has no neighbour pointer to Tree "
5472 <<
"'s Left neighbour has no neighbour pointer to Tree "
5536 <<
"'s Front neighbour has no neighbour pointer to Tree "
5596 <<
"'s Back neighbour has no neighbour pointer to Tree "
5710 oomph_info <<
"\n\n Failed self_test() for OcTreeForest because of "
5711 "faces: Max. error "
5719 oomph_info <<
"\n\n Failed self_test() for OcTreeForest because of "
5720 "edges: Max. error "
5735 oomph_info <<
"\nPassed self_test() for OcTreeForest: Max. error "
5736 << max_error << std::endl;
5779 double max_error = 0.0;
5785 error_stream <<
"\nMax. error in octree neighbour finding: "
5786 << max_error <<
" is too big" << std::endl;
5788 <<
"i.e. bigger than Tree::max_neighbour_finding_tolerance()="
5803 oomph_info <<
"\nMax. error in octree neighbour finding: " << max_error
5804 <<
" is OK" << std::endl;
5806 <<
"i.e. less than OcTree::max_neighbour_finding_tolerance()="
5830 << doc_info.
number() <<
".dat";
5838 << doc_info.
number() <<
".txt";
5843 double max_error = 0.0;
5853 error_stream <<
"Max. error in octree edge neighbour finding: "
5854 << max_error <<
" is too big" << std::endl;
5856 <<
"i.e. bigger than Tree::max_neighbour_finding_tolerance()="
5872 oomph_info <<
"Max. error in octree edge neighbour finding: "
5873 << max_error <<
" is OK" << std::endl;
5875 <<
"i.e. less than OcTree::max_neighbour_finding_tolerance()="
5898 for (
unsigned i = 0;
i < 6;
i++)
static int num_elem(char *strv, unsigned elem_len, int term_char, int num_term) static int num_elem(strv
Base class for all brick elements.
Information for documentation of results: Directory and file number to enable output in the form RESL...
bool is_doc_enabled() const
Are we documenting?
std::string directory() const
Output directory.
unsigned & number()
Number used (e.g.) for labeling output files.
double size() const
Calculate the size of the element (length, area, volume,...) in Eulerian computational coordinates....
void get_x(const Vector< double > &s, Vector< double > &x) const
Global coordinates as function of local coordinates. Either via FE representation or via macro-elemen...
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
virtual unsigned nnode_1d() const
Return the number of nodes along one edge of the element Default is to return zero — must be overload...
int get_node_number(Node *const &node_pt) const
Return the number of the node *node_pt if this node is in the element, else return -1;.
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
OcTreeForest()
Default constructor (empty and broken)
OcTreeRoot * octree_pt(const unsigned &i) const
Return pointer to i-th OcTree in forest (Performs a dynamic cast from the TreeRoot to a OcTreeRoot).
OcTreeRoot * oc_face_neigh_pt(const unsigned &i, const int &direction)
Given the number i of the root octree in this forest, return pointer to its face neighbour in the spe...
Vector< TreeRoot * > oc_edge_neigh_pt(const unsigned &i, const int &direction)
Given the number i of the root octree in this forest, return the vector of pointers to the true edge ...
void find_neighbours()
Construct the neighbour scheme.
void open_hanging_node_files(DocInfo &doc_info, Vector< std::ofstream * > &output_stream)
Open output files that will store any hanging nodes in the forest and return a vector of the streams.
void construct_up_right_equivalents()
Construct the rotation schemes.
void check_all_neighbours(DocInfo &doc_info)
Document and check all the neighbours of all the nodes in the forest. DocInfo object specifies the ou...
unsigned self_test()
Self-test: Check all neighbours. Return success (0) if the max. distance between corresponding points...
OcTreeRoot is a OcTree that forms the root of a (recursive) octree. The "root node" is special as it ...
void set_up_equivalent(TreeRoot *tree_root_pt, const int &dir)
Set up equivalent of the neighbours specified by pointer: When viewed from the current octree's neigh...
void set_right_equivalent(TreeRoot *tree_root_pt, const int &dir)
The same thing as up_equivalent, but for the right direction: When viewed from the current octree nei...
OcTree class: Recursively defined, generalised octree.
static DenseMatrix< double > S_step_edge
Each edge of the RefineableQElement<3> that is represented by the octree is parametrised by one (of t...
static Vector< std::string > Colour
Colours for neighbours in various directions.
static DenseMatrix< double > S_base
s_base(i,direction): Initial value for coordinate s[i] on the face indicated by direction (L/R/U/D/F/...
static DenseMatrix< double > S_directhi
Relative to the left/down/back vertex in any (father) octree, the corresponding vertex in the son spe...
static DenseMatrix< bool > Is_adjacent
Array of direction/octant adjacency scheme: Is_adjacent(direction,octant): Is face/edge direction adj...
static Vector< int > rotate(const int &new_up, const int &new_right, const Vector< int > &dir)
If U[p] becomes new_up and R[ight] becomes new_right then the direction vector dir becomes rotate(new...
static Vector< int > faces_of_common_edge(const int &edge)
Function that, given an edge, returns the two faces on which it.
static Vector< std::string > Direct_string
Translate (enumerated) directions into strings.
static DenseMatrix< double > S_directlo
Relative to the left/down/back vertex in any (father) octree, the corresponding vertex in the son spe...
static int node_number_to_vertex(const unsigned &n, const unsigned &nnode1d)
Return the vertex [LDB,RDB,...] of local (vertex) node n in an element with nnode1d nodes in each coo...
static void mult_mat_vect(const DenseMatrix< int > &mat, const Vector< int > &vect1, Vector< int > &vect2)
Helper function: Performs the operation : vect2 = mat*vect1.
static DenseMatrix< int > Common_face
Determine common face of edges or octants. Slightly bizarre lookup scheme from Samet's book.
static Vector< int > Reflect_face
Get opposite face, e.g. Reflect_face[L]=R.
static Vector< int > Sini
Entry in rotation matrix sin(i*90)
static void setup_static_data()
Setup the static data, rotation and reflection schemes, etc.
unsigned self_test()
Self-test: Check all neighbours. Return success (0) if the max. distance between corresponding points...
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)....
static Vector< int > vertex_node_to_vector(const unsigned &n, const unsigned &nnode1d)
Returns the vector of the coordinate directions of vertex node number n in an element with nnode1d el...
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)
Doc/check all true edge neighbours of octree (nodes) contained in the Vector forest_node_pt....
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
Storage for the up/right-equivalents corresponding to two pairs of vertices along an element edge:
static DenseMatrix< double > S_base_edge
S_base_edge(i,edge): Initial value for coordinate s[i] on the specified edge (LF/RF/....
static Vector< int > Cosi
Entry in rotation matrix: cos(i*90)
static DenseMatrix< int > Reflect
Reflection scheme: Reflect(direction,octant): Get mirror of octant/edge in specified direction....
static int get_the_other_face(const unsigned &n1, const unsigned &n2, const unsigned &nnode1d, const int &face)
If an edge is bordered by the nodes whose local numbers are n1 and n2 in an element with nnode1d node...
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,...
bool edge_neighbour_is_face_neighbour(const int &edge, OcTree *edge_neighb_pt) const
Is the edge neighbour (for edge "edge") specified via the pointer also a face neighbour for one of th...
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
Find ‘greater-or-equal-sized edge neighbour’ in given direction (LB,RB,DB,UB [the back edges],...
static DenseMatrix< double > S_direct_edge
Relative to the left/down/back vertex in any (father) octree, the corresponding vertex in the son spe...
static Vector< int > Reflect_vertex
Get opposite vertex, e.g. Reflect_vertex[LDB]=RUF.
static Vector< Vector< int > > Vertex_at_end_of_edge
Vector of vectors containing the two vertices for each edge, e.g. Vertex_at_end_of_edge[LU][0]=LUB an...
static void construct_rotation_matrix(int &axis, int &angle, DenseMatrix< int > &mat)
This constructs the rotation matrix of the rotation around the axis axis with an angle of angle*90.
static void mult_mat_mat(const DenseMatrix< int > &mat1, const DenseMatrix< int > &mat2, DenseMatrix< int > &mat3)
Helper function: Performs the operation : mat3=mat1*mat2.
static bool Static_data_has_been_setup
Bool indicating that static member data has been setup.
static DenseMatrix< double > S_stephi
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 ...
static Vector< Vector< int > > Direction_to_vector
For each direction, i.e. a son_type (vertex), a face or an edge, this defines a vector that indicates...
static Vector< int > Reflect_edge
Get opposite edge, e.g. Reflect_edge[DB]=UF.
static std::map< Vector< int >, int > Vector_to_direction
Each vector representing a direction can be translated into a direction, either a son type (vertex),...
static DenseMatrix< double > S_steplo
Each face of the RefineableQElement<3> that is represented by the octree is parametrised by two (of t...
static unsigned vertex_to_node_number(const int &vertex, const unsigned &nnode1d)
Return the local node number of given vertex [LDB,RDB,...] in an element with nnode1d nodes in each c...
static void doc_face_neighbours(Vector< Tree * > forest_nodes_pt, std::ofstream &neighbours_file, std::ofstream &neighbours_txt_file, double &max_error)
Doc/check all face neighbours of octree (nodes) contained in the Vector forest_node_pt....
An OomphLibError object which should be thrown when an run-time error is encountered....
TAdvectionDiffusionReactionElement<NREAGENT,DIM,NNODE_1D> elements are isoparametric triangular DIM-d...
A TreeForest consists of a collection of TreeRoots. Each member tree can have neighbours in various e...
void stick_all_tree_nodes_into_vector(Vector< Tree * > &all_forest_nodes)
Traverse forest and stick pointers to all "nodes" into Vector.
unsigned ntree()
Number of trees in forest.
Vector< TreeRoot * > Trees_pt
Vector containing the pointers to the trees.
TreeRoot *& neighbour_pt(const int &direction)
Return the pointer to the neighbouring TreeRoots in specified direction. Returns NULL if there's no n...
Tree * Father_pt
Pointer to the Father of the Tree.
void stick_all_tree_nodes_into_vector(Vector< Tree * > &)
Traverse and stick pointers to all "nodes" into Vector.
TreeRoot * Root_pt
Pointer to the root of the tree.
int Son_type
Son type (e.g. SW/SE/NW/NE in a quadtree)
static double & max_neighbour_finding_tolerance()
Max. allowed discrepancy in neighbour finding routine (distance between points when identified from t...
int Level
Level of the Tree (level 0 = root)
static const int OMEGA
Default value for an unassigned neighbour.
static double Max_neighbour_finding_tolerance
Max. allowed discrepancy in neighbour finding routine (distance between points when identified from t...
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).
void pause(std::string message)
Pause and display message.
OomphInfo oomph_info
Single (global) instantiation of the OomphInfo object – this is used throughout the library as a "rep...