26 #ifndef OOMPH_GENERIC_REFINEABLE_QUAD_MESH_HEADER
27 #define OOMPH_GENERIC_REFINEABLE_QUAD_MESH_HEADER
50 template<
class ELEMENT>
99 unsigned local_min_ref = 0;
100 unsigned local_max_ref = 0;
108 int int_local_min_ref = local_min_ref;
112 int_local_min_ref = INT_MAX;
116 MPI_Allreduce(&int_local_min_ref,
123 unsigned min_ref = unsigned(int_min_ref);
127 unsigned min_ref = local_min_ref;
153 unsigned n_tree_nodes = all_tree_nodes_pt.size();
154 for (
unsigned e = 0;
e < n_tree_nodes;
e++)
156 Tree* tree_pt = all_tree_nodes_pt[
e];
179 else if (level == min_ref)
182 unsigned n_sons = tree_pt->
nsons();
184 for (
unsigned i_son = 0; i_son < n_sons; i_son++)
186 backed_up_sons[i_son] = tree_pt->
son_pt(i_son);
196 for (
unsigned i_son = 0; i_son < n_sons; i_son++)
198 Tree* son_pt = backed_up_sons[i_son];
202 son_pt->
root_pt() = tree_root_pt;
207 unsigned n = all_sons_pt.size();
208 for (
unsigned i = 0;
i < n;
i++)
210 all_sons_pt[
i]->root_pt() = tree_root_pt;
215 trees_pt.push_back(tree_root_pt);
252 unsigned n_element = this->
nelement();
253 for (
unsigned e = 0;
e < n_element;
e++)
256 ELEMENT* el_pt =
dynamic_cast<ELEMENT*
>(this->
element_pt(
e));
OomphCommunicator * Comm_pt
Pointer to communicator – set to NULL if mesh is not distributed.
const Vector< GeneralisedElement * > & element_pt() const
Return reference to the Vector of elements.
unsigned long nelement() const
Return number of elements in the mesh.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
A QuadTreeForest consists of a collection of QuadTreeRoots. Each member tree can have neighbours to i...
QuadTreeRoot is a QuadTree that forms the root of a (recursive) quadtree. The "root node" is special ...
static void setup_static_data()
Setup the static data, rotation and reflection schemes, etc.
RefineableElements are FiniteElements that may be subdivided into children to provide a better local ...
unsigned refinement_level() const
Return the Refinement level.
Intermediate mesh class that implements the mesh adaptation functions specified in the TreeBasedRefin...
virtual ~RefineableQuadMesh()
Broken assignment operator.
RefineableQuadMesh(const RefineableQuadMesh &dummy)=delete
Broken copy constructor.
RefineableQuadMesh()
Constructor: Setup static quadtree data.
void setup_quadtree_forest()
Set up QuadTreeForest. Wipes any existing tree structure below the minimum refinement level and regar...
virtual void setup_tree_forest()
Set up the tree forest associated with the Mesh. Forwards call to setup_quadtree_forest()
virtual void get_refinement_levels(unsigned &min_refinement_level, unsigned &max_refinement_level)
Get max/min refinement levels in mesh.
TreeForest * Forest_pt
Forest representation of the mesh.
///////////////////////////////////////////////////////////////// ///////////////////////////////////...
void flush_trees()
Flush trees from forest.
void stick_all_tree_nodes_into_vector(Vector< Tree * > &all_forest_nodes)
Traverse forest and stick pointers to all "nodes" into Vector.
A generalised tree base class that abstracts the common functionality between the quad- and octrees u...
void stick_all_tree_nodes_into_vector(Vector< Tree * > &)
Traverse and stick pointers to all "nodes" into Vector.
RefineableElement * object_pt() const
Return the pointer to the object (RefineableElement) represented by the tree.
unsigned nsons() const
Return number of sons (zero if it's a leaf node)
void flush_sons()
Flush the sons.
Tree * son_pt(const int &son_index) const
Return pointer to the son for a given index. Note that to aid code readability specific enums have be...
void set_son_pt(const Vector< Tree * > &son_pt)
Set vector of pointers to sons, indexed by the appropriate enum that identies son types....
void set_father_pt(Tree *const &father_pt)
Set the father.
TreeRoot *& root_pt()
Return pointer to root of the tree.
A slight extension to the standard template vector class so that we can include "graceful" array rang...
//////////////////////////////////////////////////////////////////// ////////////////////////////////...