31#include <oomph-lib-config.h>
88 using namespace BinaryTreeNames;
94 error_stream <<
"Inconsistent enumeration! \n Tree::OMEGA="
178 using namespace BinaryTreeNames;
265 using namespace BinaryTreeNames;
408 double max_error = 0.0;
416 oomph_info <<
"\n \n Failed self_test() for BinaryTree: Max. error "
417 << max_error << std::endl
423 oomph_info <<
"\n \n Passed self_test() for BinaryTree: Max. error "
424 << max_error << std::endl
442 LeakCheckNames::BinaryTreeForest_build += 1;
445 using namespace BinaryTreeNames;
456 using namespace BinaryTreeNames;
467 "Trying to setup the neighbour scheme for an empty forest\n",
496 for (std::map<
Node*, std::set<unsigned>>::iterator
it =
502 for (std::set<unsigned>::iterator
it_el1 =
it->second.begin();
506 unsigned i = (*it_el1);
507 for (std::set<unsigned>::iterator
it_el2 =
it->second.begin();
511 unsigned j = (*it_el2);
576 double max_error = 0.0;
584 error_stream <<
"Max. error in binary tree neighbour finding: "
585 << max_error <<
" is too big" << std::endl;
587 <<
"i.e. bigger than Tree::max_neighbour_finding_tolerance()="
602 oomph_info <<
"Max. error in binary tree neighbour finding: " << max_error
603 <<
" is OK" << std::endl;
605 <<
"i.e. less than BinaryTree::max_neighbour_finding_tolerance()="
639 double max_error = 0.0;
646 oomph_info <<
"\n \n Failed self_test() for BinaryTree: Max. error "
647 << max_error << std::endl
653 oomph_info <<
"\n \n Passed self_test() for BinaryTree: Max. error "
654 << max_error << std::endl
673 using namespace BinaryTreeNames;
709 if (
el_pt->object_pt()->nodes_built())
738 <<
el_pt->object_pt()->number() <<
" is "
739 <<
neighb_pt->object_pt()->number() <<
" diff_level "
798 if (std::fabs(
error) > max_error)
800 max_error = std::fabs(
error);
835 if (std::fabs(
error) > max_error)
837 max_error = std::fabs(
error);
void find_neighbours()
Construct the neighbour lookup scheme.
BinaryTreeForest()
Default constructor (empty and broken)
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 maximum distance between corresponding poi...
BinaryTreeRoot is a BinaryTree that forms the root of a (recursive) binary tree. The "root node" is s...
BinaryTree class: Recursively defined, generalised binary tree.
static Vector< double > S_base
S_base(direction): Initial value for coordinate s on the edge indicated by direction (L/R)
static Vector< std::string > Colour
Colours for neighbours in various directions.
static Vector< std::string > Direct_string
Translate (enumerated) directions into strings.
static void setup_static_data()
Set up the static data, reflection schemes, etc.
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 binary tree (nodes) contained in the Vector forest_node_pt....
static bool Static_data_has_been_setup
Boolean indicating that static member data has been setup.
static DenseMatrix< int > Reflect
Reflection scheme: Reflect(direction,segment): Get mirror of segment in specified direction....
BinaryTree * gteq_edge_neighbour(const int &direction, Vector< double > &s_in_neighbour, 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 reg...
unsigned self_test()
Self-test: Check all neighbours. Return success (0) if the maximum distance between corresponding poi...
static DenseMatrix< bool > Is_adjacent
Array of direction/segment adjacency scheme: Is_adjacent(i_vertex,j_segment): Is vertex adjacent to s...
static Vector< int > Reflect_edge
Get opposite edge, e.g. Reflect_edge[L]=R.
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;.
Base class for all line elements.
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
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).
OomphInfo oomph_info
Single (global) instantiation of the OomphInfo object – this is used throughout the library as a "rep...