30 #ifndef QMESH2OOMPH_D_HEADER 31 #define QMESH2OOMPH_D_HEADER 55 template <
class ELEMENT>
111 unsigned local_min_ref=0;
112 unsigned local_max_ref=0;
120 int int_local_min_ref=local_min_ref;
124 int_local_min_ref=INT_MAX;
128 MPI_Allreduce(&int_local_min_ref,&int_min_ref,1,
132 unsigned min_ref=unsigned(int_min_ref);
136 unsigned min_ref=local_min_ref;
162 unsigned n_tree_nodes=all_tree_nodes_pt.size();
163 for (
unsigned e=0;
e<n_tree_nodes;
e++)
165 Tree* tree_pt=all_tree_nodes_pt[
e];
188 else if (level==min_ref)
191 unsigned n_sons=tree_pt->
nsons();
193 for (
unsigned i_son=0;i_son<n_sons;i_son++)
195 backed_up_sons[i_son]=tree_pt->
son_pt(i_son);
205 for (
unsigned i_son=0;i_son<n_sons;i_son++)
207 Tree* son_pt=backed_up_sons[i_son];
211 son_pt->
root_pt()=tree_root_pt;
216 unsigned n=all_sons_pt.size();
217 for (
unsigned i=0;
i<n;
i++)
219 all_sons_pt[
i]->root_pt()=tree_root_pt;
224 trees_pt.push_back(tree_root_pt);
262 unsigned n_element=this->
nelement();
263 for (
unsigned e=0;
e<n_element;
e++)
266 ELEMENT* el_pt=
dynamic_cast<ELEMENT*
>(this->
element_pt(
e));
unsigned nsons() const
Return number of sons (zero if it's a leaf node)
virtual ~RefineableQuadMesh()
Broken assignment operator.
void broken_copy(const std::string &class_name)
Issue error message and terminate execution.
void flush_sons()
Flush the sons.
void setup_quadtree_forest()
Set up QuadTreeForest. Wipes any existing tree structure below the minimum refinement level and regar...
virtual void get_refinement_levels(unsigned &min_refinement_level, unsigned &max_refinement_level)
Get max/min refinement levels in 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.
TreeForest * Forest_pt
Forest representation of the mesh.
unsigned long nelement() const
Return number of elements in the mesh.
RefineableQuadMesh()
Constructor: Setup static quadtree data.
static void setup_static_data()
Setup the static data, rotation and reflection schemes, etc.
void set_father_pt(Tree *const &father_pt)
Set the father.
unsigned refinement_level() const
Return the Refinement level.
RefineableQuadMesh(const RefineableQuadMesh &dummy)
Broken copy constructor.
Base class for quad meshes (meshes made of 2D quad elements).
void stick_all_tree_nodes_into_vector(Vector< Tree * > &)
Traverse and stick pointers to all "nodes" into Vector.
void set_son_pt(const Vector< Tree *> &son_pt)
Set vector of pointers to sons, indexed by the appropriate enum that identies son types...
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...
const Vector< GeneralisedElement * > & element_pt() const
Return reference to the Vector of elements.
RefineableElement * object_pt() const
Return the pointer to the object (RefineableElement) represented by the tree.
virtual void setup_tree_forest()
Set up the tree forest associated with the Mesh. Forwards call to setup_quadtree_forest() ...
OomphCommunicator * Comm_pt
Pointer to communicator – set to NULL if mesh is not distributed.
TreeRoot *& root_pt()
Return pointer to root of the tree.