31#include <oomph-lib-config.h>
122 using namespace QuadTreeNames;
129 error_stream <<
"Inconsistent enumeration! \n Tree::OMEGA="
421 using namespace QuadTreeNames;
609 using namespace QuadTreeNames;
829 double max_error = 0.0;
837 oomph_info <<
"\n \n Failed self_test() for QuadTree: Max. error "
838 << max_error << std::endl
844 oomph_info <<
"\n \n Passed self_test() for QuadTree: Max. error "
845 << max_error << std::endl
876 using namespace QuadTreeNames;
893 using namespace QuadTreeNames;
904 "Trying to setup the neighbour scheme for an empty forest\n",
934 for (std::map<
Node*, std::set<unsigned>>::iterator
it =
940 for (std::set<unsigned>::iterator
it_el1 =
it->second.begin();
944 unsigned i = (*it_el1);
945 for (std::set<unsigned>::iterator
it_el2 =
it->second.begin();
949 unsigned j = (*it_el2);
1069 using namespace QuadTreeNames;
1107 <<
"'s Northern neighbour has no neighbour pointer to Tree " <<
i
1148 <<
"'s Eastern neighbour has no neighbour pointer to Tree " <<
i
1189 <<
"'s Southern neighbour has no neighbour pointer to Tree " <<
i
1230 <<
"'s Western neighbour has no neighbour pointer to Tree " <<
i
1273 double max_error = 0.0;
1281 error_stream <<
"Max. error in quadtree neighbour finding: " << max_error
1282 <<
" is too big" << std::endl;
1284 <<
"i.e. bigger than Tree::max_neighbour_finding_tolerance()="
1299 oomph_info <<
"Max. error in quadtree neighbour finding: " << max_error
1300 <<
" is OK" << std::endl;
1302 <<
"i.e. less than QuadTree::max_neighbour_finding_tolerance()="
1322 for (
unsigned i = 0;
i < 4;
i++)
1372 double max_error = 0.0;
1379 oomph_info <<
"\n \n Failed self_test() for QuadTree: Max. error "
1380 << max_error << std::endl
1386 oomph_info <<
"\n \n Passed self_test() for QuadTree: Max. error "
1387 << max_error << std::endl
1407 using namespace QuadTreeNames;
1446 if (
el_pt->object_pt()->nodes_built())
1481 <<
el_pt->object_pt()->number() <<
" is "
1482 <<
neighb_pt->object_pt()->number() <<
" diff_level "
1536 for (
int i = 0;
i < 2;
i++)
1549 if (std::fabs(
error) > max_error)
1551 max_error = std::fabs(
error);
1576 for (
int i = 0;
i < 2;
i++)
1591 if (std::fabs(
error) > max_error)
1593 max_error = std::fabs(
error);
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...
An OomphLibError object which should be thrown when an run-time error is encountered....
Base class for all quad elements.
QuadTreeForest()
Default constructor (empty and broken)
QuadTreeRoot * quadtree_pt(const unsigned &i)
Return pointer to i-th root quadtree in this forest. (Performs a dynamic cast from the TreeRoot to a ...
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...
void find_neighbours()
Construct the neighbour lookup scheme.
unsigned self_test()
Self-test: Check all neighbours. Return success (0) if the max. distance between corresponding points...
void construct_north_equivalents()
Construct the rotation schemes.
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.
QuadTreeRoot * quad_neigh_pt(const unsigned &i, const int &direction)
Given the number i of the root quadtree in this forest, return pointer to its neighbour in the specif...
QuadTreeRoot is a QuadTree that forms the root of a (recursive) quadtree. The "root node" is special ...
int & north_equivalent(const int &neighbour)
Return north equivalent of the neighbours in specified direction: When viewed from the current quadtr...
QuadTree class: Recursively defined, generalised quadtree.
static Vector< std::string > Direct_string
Translate (enumerated) directions into strings.
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....
static DenseMatrix< double > S_step
S_step(i,direction) Increments for coordinate s[i] when progressing along the edge indicated by direc...
static Vector< int > Reflect_edge
Get opposite edge, e.g. Reflect_edge[N]=S.
static DenseMatrix< int > Reflect
Reflection scheme: Reflect(direction,quadrant): Get mirror of quadrant in specified direction....
static DenseMatrix< int > Rotate
Rotate coordinates: If North becomes NorthIs then direction becomes Rotate(NorthIs,...
static void setup_static_data()
Setup the static data, rotation and reflection schemes, etc.
static DenseMatrix< double > S_base
S_base(i,direction): Initial value for coordinate s[i] on the edge indicated by direction (S/E/N/W)
static DenseMatrix< int > S_direct
S_direct(direction,son_quadrant): The lower left corner of son_quadrant has an offset of h/2 S_direct...
unsigned self_test()
Self-test: Check all neighbours. Return success (0) if the max. distance between corresponding points...
static Vector< std::string > Colour
Colours for neighbours in various directions.
QuadTree * gteq_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 reg...
static DenseMatrix< bool > Is_adjacent
Array of direction/quadrant adjacency scheme: Is_adjacent(i_vertex_or_edge,j_quadrant): Is edge/verte...
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.
static bool Static_data_has_been_setup
Bool indicating that static member data has been setup.
static DenseMatrix< int > Rotate_angle
Angle betwen rotated coordinates: If old_direction becomes new_direction then the angle between the a...
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.
Vector< Tree * > Son_pt
Vector of pointers to the sons of the Tree.
static double Max_neighbour_finding_tolerance
Max. allowed discrepancy in neighbour finding routine (distance between points when identified from t...
A slight extension to the standard template vector class so that we can include "graceful" array rang...
long QuadTreeForest_build
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...