26#ifndef OOMPH_TREE_TEMPLATE_HEADER
27#define OOMPH_TREE_TEMPLATE_HEADER
31#include <oomph-lib-config.h>
59 template<
class ELEMENT>
65 std::string error_message =
66 "Can't split non-leaf elements (or at least I can't see\n";
68 "why you would want me to... If you're sure, then hack me... \n";
76 std::stringstream error_message;
78 <<
"No object defined in split_if_required. Father nodes:\n";
82 for (
unsigned j = 0;
j <
nnod;
j++)
86 for (
unsigned i = 0;
i <
n;
i++)
88 error_message <<
nod_pt->x(
i) <<
" ";
90 error_message <<
"\n";
147 template<
class ELEMENT>
153 std::string error_message =
154 "Can't p-refine non-leaf elements (or at least I can't see\n";
156 "why you would want me to... If you're sure, then hack me... \n";
164 std::stringstream error_message;
166 <<
"No object defined in p_refine_if_required. Father nodes:\n";
170 for (
unsigned j = 0;
j <
nnod;
j++)
174 for (
unsigned i = 0;
i <
n;
i++)
176 error_message <<
nod_pt->x(
i) <<
" ";
178 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....
p-refineable version of RefineableElement
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?
TAdvectionDiffusionReactionElement<NREAGENT,DIM,NNODE_1D> elements are isoparametric triangular DIM-d...
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...
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).