28#include <oomph-lib-config.h>
37#ifndef OOMPH_TREE_TEMPLATE_CC
38#define OOMPH_TREE_TEMPLATE_CC
60 template<
class ELEMENT>
66 std::string error_message =
67 "Can't split non-leaf elements (or at least I can't see\n";
69 "why you would want me to... If you're sure, then hack me... \n";
77 std::stringstream error_message;
79 <<
"No object defined in split_if_required. Father nodes:\n";
83 for (
unsigned j = 0;
j <
nnod;
j++)
87 for (
unsigned i = 0;
i <
n;
i++)
89 error_message <<
nod_pt->x(
i) <<
" ";
91 error_message <<
"\n";
148 template<
class ELEMENT>
154 std::string error_message =
155 "Can't p-refine non-leaf elements (or at least I can't see\n";
157 "why you would want me to... If you're sure, then hack me... \n";
165 std::stringstream error_message;
167 <<
"No object defined in p_refine_if_required. Father nodes:\n";
171 for (
unsigned j = 0;
j <
nnod;
j++)
175 for (
unsigned i = 0;
i <
n;
i++)
177 error_message <<
nod_pt->x(
i) <<
" ";
179 error_message <<
"\n";
double size() const
Calculate the size of the element (length, area, volume,...) in Eulerian computational coordinates....
unsigned nnode() const
Return the number of nodes.
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
unsigned ndim() const
Access function to # of Eulerian coordinates.
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....
/////////////////////////////////////////////////////////////////// /////////////////////////////////...
RefineableElements are FiniteElements that may be subdivided into children to provide a better local ...
void split(Vector< ELEMENT * > &son_pt) const
Split the element into the number of sons to be constructed and return a vector of pointers to the so...
bool to_be_refined()
Has the element been selected for refinement?
//////////////////////////////////////////////////////////////////////
A generalised tree base class that abstracts the common functionality between the quad- and octrees u...
Tree * Father_pt
Pointer to the Father of the Tree.
RefineableElement * Object_pt
Pointer to the object represented by the tree.
void p_refine_if_required(Mesh *&mesh_pt)
If required, p-refine the leaf – criterion: bool object_pt()-> to_be_p_refined() = true or bool objec...
RefineableElement * object_pt() const
Return the pointer to the object (RefineableElement) represented by the tree.
void split_if_required()
If required, split the leaf and create its sons – criterion: bool object_pt()-> to_be_refined() = tru...
Tree * father_pt() const
Return pointer to father: NULL if it's a root node.
Vector< Tree * > Son_pt
Vector of pointers to the sons of the Tree.
virtual Tree * construct_son(RefineableElement *const &object_pt, Tree *const &father_pt, const int &son_type)=0
A function that constructs a specific type of tree. This MUST be overloaded for each specific tree ty...
//////////////////////////////////////////////////////////////////// ////////////////////////////////...