quadtree.h
Go to the documentation of this file.
1 // LIC// ====================================================================
2 // LIC// This file forms part of oomph-lib, the object-oriented,
3 // LIC// multi-physics finite-element library, available
4 // LIC// at http://www.oomph-lib.org.
5 // LIC//
6 // LIC// Copyright (C) 2006-2024 Matthias Heil and Andrew Hazel
7 // LIC//
8 // LIC// This library is free software; you can redistribute it and/or
9 // LIC// modify it under the terms of the GNU Lesser General Public
10 // LIC// License as published by the Free Software Foundation; either
11 // LIC// version 2.1 of the License, or (at your option) any later version.
12 // LIC//
13 // LIC// This library is distributed in the hope that it will be useful,
14 // LIC// but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // LIC// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // LIC// Lesser General Public License for more details.
17 // LIC//
18 // LIC// You should have received a copy of the GNU Lesser General Public
19 // LIC// License along with this library; if not, write to the Free Software
20 // LIC// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21 // LIC// 02110-1301 USA.
22 // LIC//
23 // LIC// The authors may be contacted at oomph-lib@maths.man.ac.uk.
24 // LIC//
25 // LIC//====================================================================
26 // Header file for quadtree and quadtree forest classes
27 #ifndef OOMPH_QUADTREE_HEADER
28 #define OOMPH_QUADTREE_HEADER
29 
30 
31 // Config header generated by autoconfig
32 #ifdef HAVE_CONFIG_H
33 #include <oomph-lib-config.h>
34 #endif
35 
36 #ifdef OOMPH_HAS_MPI
37 #include "mpi.h"
38 #endif
39 
40 // OOMPH-LIB headers
41 #include "tree.h"
42 #include "matrices.h"
43 
44 
45 namespace oomph
46 {
47  //====================================================================
48  /// Namespace for QuadTree directions
49  //====================================================================
50  namespace QuadTreeNames
51  {
52  /// Directions. OMEGA is used if a direction is undefined
53  /// in a certain context
54  enum
55  {
56  SW,
57  SE,
58  NW,
59  NE,
60  N,
61  E,
62  S,
63  W,
64  OMEGA = 26
65  };
66  }; // namespace QuadTreeNames
67 
68  // Forward class definition for class representing the root of a QuadTree
69  class QuadTreeRoot;
70 
71  //================================================================
72  /// QuadTree class: Recursively defined, generalised quadtree.
73  ///
74  /// A QuadTree has:
75  /// - a pointer to the object (of type RefineableQElement<2>) that it
76  /// represents in a mesh refinement context.
77  /// - Vector of pointers to its four (SW/SE/NW/NE) sons (which are
78  /// themselves quadtrees).
79  /// If the Vector of pointers to the sons has zero length,
80  /// the QuadTree is a "leaf node" in the overall quadtree.
81  /// - a pointer to its father. If this pointer is NULL, the QuadTree is the
82  /// the root node of the overall quadtree.
83  /// This data is stored in the Tree base class.
84  ///
85  /// The tree can also be part of a forest. If that is the case, the root
86  /// will have pointers to the roots of neighbouring quadtrees.
87  ///
88  /// The objects contained in the quadtree are assumed to be
89  /// (topologically) rectangular elements whose geometry is
90  /// parametrised by local coordinates \f$ {\bf s} \in [-1,1]^2 \f$.
91  ///
92  /// The tree can be traversed and actions performed
93  /// at all its "nodes" or only at the leaf "nodes" ("nodes" without sons).
94  ///
95  /// Finally, the leaf "nodes" can be split depending on
96  /// a criteria defined by the object.
97  ///
98  /// Note that QuadTrees are only generated by splitting existing
99  /// QuadTrees. Therefore, the constructors are protected. The
100  /// only QuadTree that "Joe User" can create is
101  /// the (derived) class QuadTreeRoot.
102  //=================================================================
103  class QuadTree : public virtual Tree
104  {
105  public:
106  /// Destructor. Note: Deleting a quadtree also deletes the
107  /// objects associated with all non-leaf nodes!
108  virtual ~QuadTree() {}
109 
110  /// Broken copy constructor
111  QuadTree(const QuadTree& dummy) = delete;
112 
113  /// Broken assignment operator
114  void operator=(const QuadTree&) = delete;
115 
116  /// Overload the function construct_son to ensure that the son
117  /// is a specific QuadTree and not a general Tree.
119  Tree* const& father_pt,
120  const int& son_type)
121  {
122  QuadTree* temp_quad_pt = new QuadTree(object_pt, father_pt, son_type);
123  return temp_quad_pt;
124  }
125 
126  /// Return pointer to greater or equal-sized edge neighbour
127  /// in specified \c direction; also provide info regarding the relative
128  /// size and orientation of neighbour:
129  /// - The vector translate_s turns the index of the local coordinate
130  /// in the present quadtree into that of the neighbour. If there are no
131  /// rotations then translate_s[i] = i, but if, for example, the
132  /// neighbour's eastern face is adjacent to our northern face
133  /// translate_s[0] = 1 and translate_s[1] = 0. Of course, this could be
134  /// deduced after the fact, but it's easier to do it here.
135  /// - In the present quadtree, the lower left (south west) vertex is
136  /// located at local coordinates (-1,-1). This point is located
137  /// at the local coordinates (\c s_lo[0], \c s_lo[1]) in the neighbouring
138  /// quadtree.
139  /// - ditto with s_hi: In the present quadtree, the upper right (north east)
140  /// vertex is located at local coordinates (1,1). This point is located
141  /// at the local coordinates (\c s_hi[0], \c s_hi[1]) in the neighbouring
142  /// quadtree.
143  /// - We're looking for a neighbour in the specified \c direction. When
144  /// viewed from the neighbouring quadtree, the edge that separates
145  /// the present quadtree from its neighbour is the neighbour's \c edge
146  /// edge. If there's no rotation between the two quadtrees, this is a
147  /// simple reflection: For instance, if we're looking
148  /// for a neighhbour in the \c N [orthern] \c direction, \c edge will
149  /// be \c S [outh]
150  /// - \c diff_level <= 0 indicates the difference in refinement levels
151  /// between
152  /// the two neighbours. If \c diff_level==0, the neighbour has the
153  /// same size as the current quadtree.
154  /// - \c in_neighbouring_tree indicates whether the neighbour is actually
155  /// in another tree in the forest. The introduction of this flag
156  /// was necessitated by periodic problems where a TreeRoot can be its
157  /// own neighbour.
158  QuadTree* gteq_edge_neighbour(const int& direction,
159  Vector<unsigned>& translate_s,
160  Vector<double>& s_lo,
161  Vector<double>& s_hi,
162  int& edge,
163  int& diff_level,
164  bool& in_neighbouring_tree) const;
165 
166  /// Traverse Tree: Preorder traverse and stick pointers to
167  /// neighbouring leaf nodes (only) into Vector
169  Vector<const QuadTree*>& tree_neighbouring_nodes,
170  Vector<Vector<double>>& tree_neighbouring_s_lo,
171  Vector<Vector<double>>& tree_neighbouring_s_hi,
172  Vector<int>& tree_neighbouring_diff_level,
173  const QuadTree* my_neigh_pt,
174  const int& direction) const;
175 
176  /// Self-test: Check all neighbours. Return success (0)
177  /// if the max. distance between corresponding points in the
178  /// neighbours is less than the tolerance specified in the
179  /// static value QuadTree::Max_neighbour_finding_tolerance.
180  unsigned self_test();
181 
182  /// Setup the static data, rotation and reflection schemes, etc
183  static void setup_static_data();
184 
185  /// Doc/check all neighbours of quadtree (nodes) contained in the
186  /// Vector forest_node_pt. Output into neighbours_file which can
187  /// be viewed from tecplot with QuadTreeNeighbours.mcr
188  /// Neighbour info and errors are displayed on
189  /// neighbours_txt_file. Finally, compute the max. error between
190  /// vertices when viewed from neighhbouring element.
191  /// If the two filestreams are closed, output is suppressed.
192  static void doc_neighbours(Vector<Tree*> forest_nodes_pt,
193  std::ofstream& neighbours_file,
194  std::ofstream& neighbours_txt_file,
195  double& max_error);
196 
197 
198  /// Translate (enumerated) directions into strings
200 
201  protected:
202  /// Default constructor (empty and broken)
204  {
205  throw OomphLibError(
206  "Don't call an empty constructor for a QuadTree object",
207  OOMPH_CURRENT_FUNCTION,
208  OOMPH_EXCEPTION_LOCATION);
209  }
210 
211  /// Default constructor for empty (root) tree:
212  /// no father, no sons; just pass a pointer to its object
213  /// Protected because QuadTrees can only be created internally,
214  /// during the split operation. Only QuadTreeRoots can be
215  /// created externally.
217 
218  /// Constructor for tree that has a father: Pass it the pointer
219  /// to its object, the pointer to its father and tell it what type
220  /// of son (SE/SW/NE/NW) it is.
221  /// Protected because QuadTrees can only be created internally,
222  /// during the split operation. Only QuadTreeRoots can be
223  /// created externally.
225  Tree* const& father_pt,
226  const int& son_type)
228  {
229  }
230 
231  /// Bool indicating that static member data has been setup
233 
234 
235  private:
236  /// Find greater or equal-sized edge neighbour in direction.
237  /// Auxiliary internal routine which passes additional information around.
238  QuadTree* gteq_edge_neighbour(const int& direction,
239  double& s_diff,
240  int& diff_level,
241  bool& in_neighbouring_tree,
242  int max_level,
243  QuadTreeRoot* const& orig_root_pt) const;
244 
245  /// Colours for neighbours in various directions
247 
248  /// S_base(i,direction): Initial value for coordinate s[i] on
249  /// the edge indicated by direction (S/E/N/W)
251 
252  /// S_step(i,direction) Increments for coordinate s[i] when
253  /// progressing along the edge indicated by direction (S/E/N/W);
254  /// Left/lower vertex: S_base; Right/upper vertex: S_base + S_step
256 
257  /// Get opposite edge, e.g. Reflect_edge[N]=S
259 
260  /// Array of direction/quadrant adjacency scheme:
261  /// Is_adjacent(i_vertex_or_edge,j_quadrant): Is edge/vertex
262  /// adjacent to quadrant?
264 
265  /// Reflection scheme: Reflect(direction,quadrant): Get mirror
266  /// of quadrant in specified direction. E.g. Reflect(S,NE)=SE
268 
269  /// Rotate coordinates: If North becomes NorthIs then direction
270  /// becomes Rotate(NorthIs,direction). E.g. Rotate(E,NW)=NE;
272 
273  /// Angle betwen rotated coordinates: If old_direction becomes
274  /// new_direction then the angle between the axes (in anti-clockwise
275  /// direction is Rotate_angle(old_direction,new_direction); E.g.
276  /// Rotate_angle(E,N)=90;
278 
279  /// S_direct(direction,son_quadrant): The lower left corner
280  /// of son_quadrant has an offset of h/2 S_direct(direction,son_quadrant)
281  /// in the specified direction. E.g. S_direct(S,NE)=1 and S_direct(S,NW)=0
283  };
284 
285 
286  //===================================================================
287  /// QuadTreeRoot is a QuadTree that forms the root of a (recursive)
288  /// quadtree. The "root node" is special as it holds additional
289  /// information about its neighbours and their relative
290  /// rotation (inside a QuadTreeForest).
291  //==================================================================
292  class QuadTreeRoot : public virtual QuadTree, public virtual TreeRoot
293  {
294  private:
295  /// Vector giving the north equivalent of the neighbours:
296  /// When viewed from the current quadtree's \c neighbour neighbour,
297  /// our northern direction is the neighbour's North_equivalent[neighbour]
298  /// direction. If there's no rotation, this map contains the identify
299  /// so that, e.g. \c North_equivalent[W]=N (read as: "in my Western
300  /// neighbour, my North is its North"). If the western neighbour is rotated
301  /// by 180 degrees relative to the current quadtree, say, we have
302  /// \c North_equivalent[W]=S (read as: "in my Western
303  /// neighbour, my North is its South"); etc.
305 
306  public:
307  /// Constructor for the (empty) root quadtree: Pass pointer to
308  /// associated object, a RefineableQElement<2>.
311  {
312 #ifdef PARANOID
313  // Check that static member data has been setup
315  {
316  std::string error_message =
317  "Static member data hasn't been setup yet.\n";
318  error_message += "Call QuadTree::setup_static_data() before creating\n";
319  error_message += "any QuadTreeRoots\n";
320 
321  throw OomphLibError(
322  error_message, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
323  }
324 #endif
325 
326  using namespace QuadTreeNames;
327 
328  // Initialise the North equivalents of the neighbouring QuadTreeRoots
329  North_equivalent.resize(27);
330 
331  North_equivalent[N] = N;
332  North_equivalent[E] = N;
333  North_equivalent[W] = N;
334  North_equivalent[S] = N;
335  }
336 
337 
338  /// Broken copy constructor
339  QuadTreeRoot(const QuadTreeRoot& dummy) = delete;
340 
341  /// Broken assignment operator
342  void operator=(const QuadTreeRoot&) = delete;
343 
344 
345  /// Return north equivalent of the neighbours in specified
346  /// direction: When viewed from the current quadtree's \c neighbour
347  /// neighbour, our northern direction is the neighbour's
348  /// north_equivalent(neighbour) direction. If there's no rotation, this map
349  /// contains the identify so that, e.g. \c north_equivalent(W)=N (read as:
350  /// "in my Western neighbour, my North is its North"). If the western
351  /// neighbour is rotated by 180 degrees relative to the current quadtree,
352  /// say, we have \c north_equivalent(W)=S (read as: "in my Western
353  /// neighbour, my North is its South"); etc.
354  int& north_equivalent(const int& neighbour)
355  {
356 #ifdef PARANOID
357  using namespace QuadTreeNames;
358  // Neighbour can only be located in N/S/E/W direction
359  if ((neighbour != S) && (neighbour != N) && (neighbour != W) &&
360  (neighbour != E))
361  {
362  std::ostringstream error_message;
363  error_message << "The neighbour can only be N,S,E,W, not"
364  << Direct_string[neighbour] << std::endl;
365 
366  throw OomphLibError(error_message.str(),
367  OOMPH_CURRENT_FUNCTION,
368  OOMPH_EXCEPTION_LOCATION);
369  }
370 #endif
371  return North_equivalent[neighbour];
372  }
373 
374 
375  /// If quadtree_root_pt is a neighbour, return the direction
376  /// [N/S/E/W] in which it is found, otherwise return OMEGA
377  int direction_of_neighbour(QuadTreeRoot* quadtree_root_pt)
378  {
379  using namespace QuadTreeNames;
380  if (Neighbour_pt[N] == quadtree_root_pt)
381  {
382  return N;
383  }
384  if (Neighbour_pt[E] == quadtree_root_pt)
385  {
386  return E;
387  }
388  if (Neighbour_pt[S] == quadtree_root_pt)
389  {
390  return S;
391  }
392  if (Neighbour_pt[W] == quadtree_root_pt)
393  {
394  return W;
395  }
396  // If we get here, it's not a neighbour
397  return OMEGA;
398  }
399  };
400 
401 
402  //================================================================
403  /// A QuadTreeForest consists of a collection of QuadTreeRoots.
404  /// Each member tree can have neighbours to its S/W/N/E
405  /// and the orientation of their compasses can differ, allowing
406  /// for complex, unstructured meshes.
407  //=================================================================
408  class QuadTreeForest : public TreeForest
409  {
410  public:
411  /// Default constructor (empty and broken)
413  {
414  // Throw an error
415  throw OomphLibError(
416  "Don't call an empty constructor for a QuadTreeForest object",
417  OOMPH_CURRENT_FUNCTION,
418  OOMPH_EXCEPTION_LOCATION);
419  }
420 
421  /// Constructor: Pass vector of pointers to the roots of the
422  /// constituent QuadTrees
424 
425  /// Broken copy constructor
426  QuadTreeForest(const QuadTreeForest& dummy) = delete;
427 
428  /// Broken assignment operator
429  void operator=(const QuadTreeForest&) = delete;
430 
431  /// Destructor: Delete the constituent quadtrees (and thus
432  /// the objects associated with its non-leaf nodes!)
433  virtual ~QuadTreeForest() {}
434 
435  /// Document and check all the neighbours of all the nodes
436  /// in the forest. DocInfo object specifies the output directory
437  /// and file numbers for the various files. If \c doc_info.disable_doc()
438  /// has been called no output is created.
439  void check_all_neighbours(DocInfo& doc_info);
440 
441  /// Open output files that will store any hanging nodes in
442  /// the forest and return a vector of the streams.
443  void open_hanging_node_files(DocInfo& doc_info,
444  Vector<std::ofstream*>& output_stream);
445 
446  /// Self-test: Check all neighbours. Return success (0)
447  /// if the max. distance between corresponding points in the
448  /// neighbours is less than the tolerance specified in the
449  /// static value QuadTree::Max_neighbour_finding_tolerance.
450  unsigned self_test();
451 
452  private:
453  /// Construct the rotation schemes
454  void construct_north_equivalents();
455 
456  /// Construct the neighbour lookup scheme
457  void find_neighbours();
458 
459  /// Return pointer to i-th root quadtree in this forest.
460  /// (Performs a dynamic cast from the TreeRoot to a
461  /// QuadTreeRoot).
462  QuadTreeRoot* quadtree_pt(const unsigned& i)
463  {
464  return dynamic_cast<QuadTreeRoot*>(Trees_pt[i]);
465  }
466 
467  /// Given the number i of the root quadtree in this forest, return
468  /// pointer to its neighbour in the specified direction. NULL
469  /// if neighbour doesn't exist. (This does the dynamic cast
470  /// from a TreeRoot to a QuadTreeRoot internally).
471  QuadTreeRoot* quad_neigh_pt(const unsigned& i, const int& direction)
472  {
473  return dynamic_cast<QuadTreeRoot*>(Trees_pt[i]->neighbour_pt(direction));
474  }
475  };
476 
477 } // namespace oomph
478 
479 #endif
cstr elem_len * i
Definition: cfortran.h:603
Information for documentation of results: Directory and file number to enable output in the form RESL...
An OomphLibError object which should be thrown when an run-time error is encountered....
A QuadTreeForest consists of a collection of QuadTreeRoots. Each member tree can have neighbours to i...
Definition: quadtree.h:409
QuadTreeForest(const QuadTreeForest &dummy)=delete
Broken copy constructor.
void operator=(const QuadTreeForest &)=delete
Broken assignment operator.
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 ...
Definition: quadtree.h:462
QuadTreeForest()
Default constructor (empty and broken)
Definition: quadtree.h:412
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...
Definition: quadtree.h:471
virtual ~QuadTreeForest()
Destructor: Delete the constituent quadtrees (and thus the objects associated with its non-leaf nodes...
Definition: quadtree.h:433
QuadTreeRoot is a QuadTree that forms the root of a (recursive) quadtree. The "root node" is special ...
Definition: quadtree.h:293
void operator=(const QuadTreeRoot &)=delete
Broken assignment operator.
Vector< int > North_equivalent
Vector giving the north equivalent of the neighbours: When viewed from the current quadtree's neighbo...
Definition: quadtree.h:304
QuadTreeRoot(RefineableElement *const &object_pt)
Constructor for the (empty) root quadtree: Pass pointer to associated object, a RefineableQElement<2>...
Definition: quadtree.h:309
QuadTreeRoot(const QuadTreeRoot &dummy)=delete
Broken copy constructor.
int & north_equivalent(const int &neighbour)
Return north equivalent of the neighbours in specified direction: When viewed from the current quadtr...
Definition: quadtree.h:354
int direction_of_neighbour(QuadTreeRoot *quadtree_root_pt)
If quadtree_root_pt is a neighbour, return the direction [N/S/E/W] in which it is found,...
Definition: quadtree.h:377
QuadTree class: Recursively defined, generalised quadtree.
Definition: quadtree.h:104
void operator=(const QuadTree &)=delete
Broken assignment operator.
static Vector< std::string > Direct_string
Translate (enumerated) directions into strings.
Definition: quadtree.h:199
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....
Definition: quadtree.cc:1402
static DenseMatrix< double > S_step
S_step(i,direction) Increments for coordinate s[i] when progressing along the edge indicated by direc...
Definition: quadtree.h:255
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.
Definition: quadtree.cc:751
static Vector< int > Reflect_edge
Get opposite edge, e.g. Reflect_edge[N]=S.
Definition: quadtree.h:258
QuadTree(RefineableElement *const &object_pt)
Default constructor for empty (root) tree: no father, no sons; just pass a pointer to its object Prot...
Definition: quadtree.h:216
static DenseMatrix< int > Reflect
Reflection scheme: Reflect(direction,quadrant): Get mirror of quadrant in specified direction....
Definition: quadtree.h:267
static DenseMatrix< int > Rotate
Rotate coordinates: If North becomes NorthIs then direction becomes Rotate(NorthIs,...
Definition: quadtree.h:271
static void setup_static_data()
Setup the static data, rotation and reflection schemes, etc.
Definition: quadtree.cc:120
QuadTree(const QuadTree &dummy)=delete
Broken copy constructor.
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)
Definition: quadtree.h:250
Tree * construct_son(RefineableElement *const &object_pt, Tree *const &father_pt, const int &son_type)
Overload the function construct_son to ensure that the son is a specific QuadTree and not a general T...
Definition: quadtree.h:118
QuadTree()
Default constructor (empty and broken)
Definition: quadtree.h:203
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...
Definition: quadtree.h:282
unsigned self_test()
Self-test: Check all neighbours. Return success (0) if the max. distance between corresponding points...
Definition: quadtree.cc:814
virtual ~QuadTree()
Destructor. Note: Deleting a quadtree also deletes the objects associated with all non-leaf nodes!
Definition: quadtree.h:108
static Vector< std::string > Colour
Colours for neighbours in various directions.
Definition: quadtree.h:246
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...
Definition: quadtree.cc:413
static DenseMatrix< bool > Is_adjacent
Array of direction/quadrant adjacency scheme: Is_adjacent(i_vertex_or_edge,j_quadrant): Is edge/verte...
Definition: quadtree.h:263
QuadTree(RefineableElement *const &object_pt, Tree *const &father_pt, const int &son_type)
Constructor for tree that has a father: Pass it the pointer to its object, the pointer to its father ...
Definition: quadtree.h:224
static bool Static_data_has_been_setup
Bool indicating that static member data has been setup.
Definition: quadtree.h:232
static DenseMatrix< int > Rotate_angle
Angle betwen rotated coordinates: If old_direction becomes new_direction then the angle between the a...
Definition: quadtree.h:277
RefineableElements are FiniteElements that may be subdivided into children to provide a better local ...
A TreeForest consists of a collection of TreeRoots. Each member tree can have neighbours in various e...
Definition: tree.h:409
TreeRoot is a Tree that forms the root of a (recursive) tree. The "root node" is special as it holds ...
Definition: tree.h:324
std::map< int, TreeRoot * > Neighbour_pt
Map of pointers to the neighbouring TreeRoots: Neighbour_pt[direction] returns the pointer to the Tre...
Definition: tree.h:330
A generalised tree base class that abstracts the common functionality between the quad- and octrees u...
Definition: tree.h:74
RefineableElement * object_pt() const
Return the pointer to the object (RefineableElement) represented by the tree.
Definition: tree.h:88
Tree * father_pt() const
Return pointer to father: NULL if it's a root node.
Definition: tree.h:235
int son_type() const
Return son type.
Definition: tree.h:214
static const int OMEGA
Default value for an unassigned neighbour.
Definition: tree.h:262
std::string string(const unsigned &i)
Return the i-th string or "" if the relevant string hasn't been defined.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...