67 to_be_refined.clear();
125 if (level == refinement_level)
189 ->select_for_refinement();
236 <<
"What follows are the numbers of the elements. " << std::endl;
241 outfile << to_be_refined[
l][
i] << std::endl;
331 error_stream <<
"Refinement tolerance <= Unrefinement tolerance"
333 <<
"doesn't make sense and will almost certainly crash"
335 <<
"this beautiful code!" << std::endl;
356 unsigned long Nelement = this->
nelement();
357 for (
unsigned long e = 0;
e < Nelement;
e++)
371 if ((
el_pt->refinement_is_enabled()) &&
374 el_pt->select_for_refinement();
388 (
el_pt->tree_pt()->father_pt() != 0))
392 unsigned n_sons =
el_pt->tree_pt()->father_pt()->nsons();
399 if (!(
el_pt->tree_pt()->father_pt()->son_pt(
ison)->is_leaf()))
426 oomph_info <<
" \n Number of elements whose refinement was overruled: "
434 for (
unsigned long e = 0;
e < Nelement;
e++)
451 unsigned n_sons =
el_pt->tree_pt()->father_pt()->nsons();
455 el_pt->tree_pt()->father_pt()->son_pt(
ison)->object_pt())]))
468 ->select_sons_for_unrefinement();
477 ->deselect_sons_for_unrefinement();
573 for (
int d = 0; d <
n_proc; d++)
586 for (
unsigned e = 0;
e <
nhalo;
e++)
589 ->sons_to_be_unrefined())
645 ->sons_to_be_unrefined())) ||
648 ->sons_to_be_unrefined())))
650 std::ostringstream error_message;
652 <<
"Error in unrefinement: \n"
653 <<
"Haloed element: " <<
e <<
" on proc " <<
my_rank
655 <<
"wants to be unrefined whereas its halo counterpart "
657 <<
"proc " <<
dd <<
" doesn't (or vice versa)...\n"
658 <<
"This is most likely because the error estimator\n"
659 <<
"has not assigned the same errors to halo and haloed\n"
660 <<
"elements -- it ought to!\n";
676 for (
int d = 0; d <
n_proc; d++)
689 for (
unsigned e = 0;
e <
nhalo;
e++)
748 ->to_be_refined())) ||
753 std::ostringstream error_message;
755 <<
"Error in refinement: \n"
756 <<
"Haloed element: " <<
e <<
" on proc " <<
my_rank
758 <<
"wants to be refined whereas its halo counterpart on\n"
759 <<
"proc " <<
dd <<
" doesn't (or vice versa)...\n"
760 <<
"This is most likely because the error estimator\n"
761 <<
"has not assigned the same errors to halo and haloed\n"
762 <<
"elements -- it ought to!\n";
819 oomph_info <<
" Not enough benefit in adapting mesh." << std::endl
831 unsigned& min_refinement_level,
unsigned& max_refinement_level)
850 ->refinement_level();
940 Mesh* mesh_pt =
this;
1048 for (
unsigned long n = 0;
n <
n_node;
n++)
1057 bool is_hanging =
nod_pt->is_hanging();
1061 is_hanging |=
nod_pt->is_hanging(
n);
1078 for (
unsigned t = 0;
t <
nt;
t++)
1086 for (
unsigned i = 0;
i <
n_dim;
i++)
1120 if (
nod_pt->is_on_boundary())
1142 nod_pt->set_nonhanging();
1149 oomph_info <<
"Time for sorting out initial hanging status: "
1246 oomph_info <<
"Time for setup_hanging_nodes() and "
1247 "further_setup_hanging_nodes() for "
1255 unsigned ncont_interpolated_values =
1317 error_stream <<
"Mesh refined: Max. error in integrity check: "
1320 <<
"i.e. bigger than RefineableElement::max_integrity_tolerance()="
1326 for (
unsigned long n = 0;
n <
n_node;
n++)
1333 for (
unsigned i = 0;
i <
n_dim;
i++)
1341 error_stream <<
"Doced problem mesh in ProblemMesh.dat" << std::endl;
1348 oomph_info <<
"Mesh refined: Max. error in integrity check: "
1351 <<
"i.e. less than RefineableElement::max_integrity_tolerance()="
1360 oomph_info <<
"Time for (paranoid only) checking of integrity: "
1384 oomph_info <<
"Time for deactivating objects and pruning nodes: "
1413 for (
unsigned j = 0;
j <
n_del;
j++)
1420 for (std::set<Node*>::iterator
it =
1424 if ((*it)->is_hanging())
1472 if (
nod_pt->is_on_boundary(b))
1475 std::set<Node*>::iterator
it =
1490 const unsigned ntstorage =
nod_pt->ntstorage();
1511 for (
unsigned i = 0;
i < 3;
i++)
1520 for (
unsigned t = 0;
t < ntstorage;
t++)
1527 for (
unsigned i = 0;
i < 3;
i++)
1589 for (
unsigned n = 0;
n <
n_nod;
n++)
1596 for (
unsigned i = 0;
i <
n_dim;
i++)
1633 for (
unsigned long n = 0;
n <
n_node;
n++)
1637 for (
unsigned i = 0;
i <
n_dim;
i++)
1654 for (
unsigned long n = 0;
n <
n_node;
n++)
1658 if (
nod_pt->is_hanging())
1661 for (
unsigned i = 0;
i <
n_dim;
i++)
1667 if (this->
node_pt(
n)->nvalue() > 0)
1682 for (
unsigned long n = 0;
n <
n_node;
n++)
1685 if (
nod_pt->is_hanging())
1688 unsigned nmaster =
nod_pt->hanging_pt()->nmaster();
1689 some_file <<
"ZONE I=" << nmaster + 1 << std::endl;
1690 for (
unsigned i = 0;
i <
n_dim;
i++)
1701 for (
unsigned i = 0;
i <
n_dim;
i++)
1713 for (
unsigned i = 0;
i < ncont_interpolated_values;
i++)
1717 <<
"/nonstandard_hangnodes_withmasters" <<
i <<
"_"
1721 for (
unsigned long n = 0;
n <
n_nod;
n++)
1728 unsigned nmaster =
nod_pt->hanging_pt(
i)->nmaster();
1729 some_file <<
"ZONE I=" << nmaster + 1 << std::endl;
1731 for (
unsigned j = 0;
j <
n_dim;
j++)
1741 for (
unsigned j = 0;
j <
n_dim;
j++)
1775 unsigned long Nelement = this->
nelement();
1776 for (
unsigned long e = 0;
e < Nelement;
e++)
1779 ->select_for_refinement();
1793 unsigned long Nelement = this->
nelement();
1794 for (
unsigned long e = 0;
e < Nelement;
e++)
1803 el_pt->select_for_p_refinement();
1823 warn_stream <<
"You are attempting to refine selected elements of a "
1825 <<
"distributed mesh. This may have undesired effects."
1829 "TreeBasedRefineableMeshBase::refine_selected_elements()",
1836 for (
unsigned long e = 0;
e <
nref;
e++)
1840 ->select_for_refinement();
1859 warn_stream <<
"You are attempting to refine selected elements of a "
1861 <<
"distributed mesh. This may have undesired effects."
1865 "TreeBasedRefineableMeshBase::refine_selected_elements()",
1872 for (
unsigned long e = 0;
e <
nref;
e++)
1892 ref_mesh_pt->get_refinement_pattern(to_be_refined);
1914 ref_mesh_pt->get_refinement_pattern(to_be_refined);
1950 oomph_info <<
"WARNING : This has not been checked comprehensively yet"
1952 <<
"Check it and remove this break " << std::endl;
1953 pause(
"Yes really pause");
1968 <<
"Meshes definitely don't differ by one refinement level \n"
1969 <<
"max. refinement levels: " <<
ref_max <<
" " <<
my_max << std::endl;
1991 for (
unsigned e = 0;
e <
nelem;
e++)
2044 oomph_info <<
"Number of elements in uniformly unrefined reference mesh: "
2045 << nel_coarse << std::endl;
2075 oomph_info <<
"Documented original ('this')mesh in orig_mesh.dat"
2089 double tol = 1.0e-5;
2090 for (
unsigned e = 0;
e <
nelem;
e++)
2098 for (
unsigned j = 0;
j <
nnod;
j++)
2107 for (
unsigned i = 0;
i < ndim;
i++)
2116 <<
" [tol=" <<
tol <<
"]" << std::endl;
2136 "Bailing out. Doced refined_mesh.dat finer_mesh.dat\n",
2161 unsigned long Nelement = this->
nelement();
2176 for (
unsigned long e = 0;
e < Nelement;
e++)
2225 unsigned nmaster =
hang_pt->nmaster();
2227 for (
unsigned m = 0;
m < nmaster;
m++)
2272 const int& ncont_interpolated_values)
2279 for (
unsigned long n = 0;
n <
n_node;
n++)
2286 for (
int i = -1;
i < ncont_interpolated_values;
i++)
2293 if ((
i == -1) || (
nod_pt->hanging_pt(
i) !=
nod_pt->hanging_pt()))
2317 typedef std::map<Node*, double>::iterator
IT;
2337 for (
int i = -1;
i < ncont_interpolated_values;
i++)
2340 for (
unsigned long n = 0;
n <
n_node;
n++)
2348 unsigned nmaster =
nod_pt->hanging_pt(
i)->nmaster();
2354 if (std::fabs(
sum - 1.0) > 1.0e-7)
2356 oomph_info <<
"WARNING: Sum of master node weights fabs(sum-1.0) "
2357 << std::fabs(
sum - 1.0) <<
" for node number " <<
n
2358 <<
" at value " <<
i << std::endl;
2376 const unsigned& ncont_interpolated_values)
2403 for (
int d = 0; d <
n_proc; d++)
2411 for (
unsigned j = 0;
j <
nh;
j++)
2421 if (
nod_pt->is_hanging(icont))
2444 <<
", does not match number of haloed data, "
2479 for (
unsigned j = 0;
j <
nh;
j++)
2489 if (
nod_pt->is_hanging(icont))
2528 oomph_info <<
"Time for first all-to-all in synchronise_hanging_nodes(): "
2547 for (
int d = 0; d <
n_proc; d++)
2550 for (
unsigned jj = 0;
jj <
n;
jj++)
2560 for (
int d = 0; d <
n_proc; d++)
2587 for (
unsigned j = 0;
j <
nh;
j++)
2668 std::map<Node*, unsigned>::iterator
it =
2714 std::map<Node*, unsigned>::iterator
it =
3017 <<
"haloed_hanging[d][count]="
3019 <<
"; halo_hanging[d][count]="
3124 for (
unsigned j = 0;
j <
nh;
j++)
3185 tmp.Sending_processor =
dd;
3186 tmp.Shared_node_id_on_sending_processor =
3191 tmp.Master_node_index =
m;
3206 nod_pt->set_hanging_pt(0, icont);
3221 oomph_info <<
"Time for second all-to-all in synchronise_hanging_nodes() "
3238 <<
"No need for reconciliation of wrongly synchronised hang nodes\n";
3243 oomph_info <<
"Need to reconcile of wrongly syncronised hang nodes\n";
3282 for (
unsigned i = 0;
i <
n;
i++)
3285 if (
tmp.Shared_node_proc ==
unsigned(
rank))
3293 send_data.push_back(
tmp.Shared_node_id_on_sending_processor);
3368 for (
unsigned i = 0;
i <
n_rec / 2;
i++)
3388 std::map<Node*, unsigned>::iterator
it =
3435 <<
"Time for third all-to-all in synchronise_hanging_nodes() "
3467 for (
unsigned j = 0;
j <
n;
j++)
3539 for (
unsigned i = 0;
i <
n_rec;
i++)
3559 tmp.Hang_pt->set_master_node_pt(
3593 <<
"Time for fourth all-to-all in synchronise_hanging_nodes() "
3620 oomph_info <<
"Need to do additional synchronisation of hanging nodes"
3631 <<
"Time for RefineableMesh::additional_synchronise_hanging_nodes() "
3632 <<
"in TreeBasedRefineableMeshBase::synchronise_hanging_nodes(): "
3639 oomph_info <<
"No need to do additional synchronisation of hanging nodes"
3672 for (
int d = 0; d <
n_proc; d++)
3778 error_stream <<
"recv_unsigneds_count != recv_unsigneds_index ( "
3780 <<
")" << std::endl;
3783 "TreeBasedRefineableMeshBase::synchronise_nonhanging_nodes()",
3809 for (
unsigned e = 0;
e <
nh;
e++)
3829 if (!
nod_pt->is_hanging())
3836 for (
unsigned t = 0;
t <
nt;
t++)
3930 oomph_info <<
"Time for synchronise_nonhanging_nodes(): "
3976 error_stream <<
"Refinement tolerance <= Unrefinement tolerance"
3978 <<
"doesn't make sense and will almost certainly crash"
3980 <<
"this beautiful code!" << std::endl;
3996 unsigned long Nelement = this->
nelement();
3997 for (
unsigned long e = 0;
e < Nelement;
e++)
4007 el_pt->deselect_for_p_refinement();
4008 el_pt->deselect_for_p_unrefinement();
4015 if ((
el_pt->p_refinement_is_enabled()) &&
4033 if ((
el_pt->p_refinement_is_enabled()) &&
4034 (
el_pt->p_order() >
this->min_p_refinement_level()) &&
4035 (
el_pt->p_order() >
el_pt->initial_p_order()))
4037 el_pt->select_for_p_unrefinement();
4050 oomph_info <<
"p-refinement is not possible for these elements"
4059 oomph_info <<
" \n Number of elements whose refinement was overruled: "
4146 for (
int d = 0; d <
n_proc; d++)
4161 for (
unsigned e = 0;
e <
nhalo;
e++)
4164 ->to_be_p_unrefined())
4210 ->to_be_p_unrefined())) ||
4213 ->to_be_p_unrefined())))
4215 std::ostringstream error_message;
4217 <<
"Error in refinement: \n"
4218 <<
"Haloed element: " <<
e <<
" on proc " <<
my_rank
4220 <<
"wants to be unrefined whereas its halo counterpart on\n"
4221 <<
"proc " << d <<
" doesn't (or vice versa)...\n"
4222 <<
"This is most likely because the error estimator\n"
4223 <<
"has not assigned the same errors to halo and haloed\n"
4224 <<
"elements -- it ought to!\n";
4236 for (
int d = 0; d <
n_proc; d++)
4251 for (
unsigned e = 0;
e <
nhalo;
e++)
4254 ->to_be_p_refined())
4297 ->to_be_p_refined())) ||
4300 ->to_be_p_refined())))
4302 std::ostringstream error_message;
4304 <<
"Error in refinement: \n"
4305 <<
"Haloed element: " <<
e <<
" on proc " <<
my_rank
4307 <<
"wants to be refined whereas its halo counterpart on\n"
4308 <<
"proc " << d <<
" doesn't (or vice versa)...\n"
4309 <<
"This is most likely because the error estimator\n"
4310 <<
"has not assigned the same errors to halo and haloed\n"
4311 <<
"elements -- it ought to!\n";
4366 oomph_info <<
"\n Not enough benefit in adapting mesh. " << std::endl
4490 for (
unsigned long n = 0;
n <
n_node;
n++)
4499 bool is_hanging =
nod_pt->is_hanging();
4503 is_hanging |=
nod_pt->is_hanging(
n);
4520 for (
unsigned t = 0;
t <
nt;
t++)
4528 for (
unsigned i = 0;
i <
n_dim;
i++)
4562 if (
nod_pt->is_on_boundary())
4584 nod_pt->set_nonhanging();
4592 oomph_info <<
"Time for sorting out initial hanging status: "
4658 oomph_info <<
"Time for setup_hanging_nodes() and "
4659 "further_setup_hanging_nodes() for "
4667 unsigned ncont_interpolated_values =
4707 if (first_macro_el_pt != 0)
4716 if (macro_el_pt != 0)
4723 macro_el_pt->set_node_update_info(geom_object_pt);
4758 error_stream <<
"Mesh refined: Max. error in integrity check: "
4760 <<
"\ni.e. bigger than RefineableElement::"
4761 <<
"max_integrity_tolerance()="
4767 for (
unsigned long n = 0;
n <
n_node;
n++)
4774 for (
unsigned i = 0;
i <
n_dim;
i++)
4782 error_stream <<
"Documented problem mesh in ProblemMesh.dat"
4790 oomph_info <<
"Mesh refined: Max. error in integrity check: "
4793 <<
"i.e. less than RefineableElement::max_integrity_tolerance()="
4802 oomph_info <<
"Time for (paranoid only) checking of integrity: "
4827 oomph_info <<
"Time for deactivating objects and pruning nodes: "
4856 for (
unsigned j = 0;
j <
n_del;
j++)
4863 for (std::set<Node*>::iterator
it =
4867 if ((*it)->is_hanging())
4915 if (
nod_pt->is_on_boundary(b))
4918 std::set<Node*>::iterator
it =
4930 const unsigned ntstorage =
nod_pt->ntstorage();
4951 for (
unsigned i = 0;
i < 3;
i++)
4960 for (
unsigned t = 0;
t < ntstorage;
t++)
4967 for (
unsigned i = 0;
i < 3;
i++)
5028 for (
unsigned n = 0;
n <
n_nod;
n++)
5035 for (
unsigned i = 0;
i <
n_dim;
i++)
5072 for (
unsigned long n = 0;
n <
n_node;
n++)
5076 for (
unsigned i = 0;
i <
n_dim;
i++)
5093 for (
unsigned long n = 0;
n <
n_node;
n++)
5097 if (
nod_pt->is_hanging())
5100 for (
unsigned i = 0;
i <
n_dim;
i++)
5106 if (this->
node_pt(
n)->nvalue() > 0)
5121 for (
unsigned long n = 0;
n <
n_node;
n++)
5124 if (
nod_pt->is_hanging())
5127 unsigned nmaster =
nod_pt->hanging_pt()->nmaster();
5128 some_file <<
"ZONE I=" << nmaster + 1 << std::endl;
5129 for (
unsigned i = 0;
i <
n_dim;
i++)
5140 for (
unsigned i = 0;
i <
n_dim;
i++)
5152 for (
unsigned i = 0;
i < ncont_interpolated_values;
i++)
5156 <<
"/nonstandard_hangnodes_withmasters" <<
i <<
"_"
5160 for (
unsigned long n = 0;
n <
n_nod;
n++)
5167 unsigned nmaster =
nod_pt->hanging_pt(
i)->nmaster();
5168 some_file <<
"ZONE I=" << nmaster + 1 << std::endl;
5170 for (
unsigned j = 0;
j <
n_dim;
j++)
5180 for (
unsigned j = 0;
j <
n_dim;
j++)
5243 unsigned long Nelement = this->
nelement();
5244 for (
unsigned long e = 0;
e < Nelement;
e++)
5253 el_pt->select_for_p_unrefinement();
5271 warn_stream <<
"You are attempting to refine selected elements of a "
5273 <<
"distributed mesh. This may have undesired effects."
5277 "TreeBasedRefineableMeshBase::refine_selected_elements()",
5284 for (
unsigned long e = 0;
e <
nref;
e++)
5293 el_pt->select_for_p_refinement();
5311 warn_stream <<
"You are attempting to refine selected elements of a "
5313 <<
"distributed mesh. This may have undesired effects."
5317 "TreeBasedRefineableMeshBase::refine_selected_elements()",
5324 for (
unsigned long e = 0;
e <
nref;
e++)
////////////////////////////////////////////////////////////////////
unsigned nvalue() const
Return number of values stored in data object (incl pinned ones).
Information for documentation of results: Directory and file number to enable output in the form RESL...
bool is_doc_enabled() const
Are we documenting?
void disable_doc()
Disable documentation.
std::string directory() const
Output directory.
unsigned & number()
Number used (e.g.) for labeling output files.
A general Finite Element class.
void position(const Vector< double > &zeta, Vector< double > &r) const
Return the parametrised position of the FiniteElement in its incarnation as a GeomObject,...
virtual void local_coordinate_of_node(const unsigned &j, Vector< double > &s) const
Get local coordinates of node j in the element; vector sets its own size (broken virtual)
double size() const
Calculate the size of the element (length, area, volume,...) in Eulerian computational coordinates....
unsigned dim() const
Return the spatial dimension of the element, i.e. the number of local coordinates required to paramet...
unsigned nnode() const
Return the number of nodes.
void get_x(const Vector< double > &s, Vector< double > &x) const
Global coordinates as function of local coordinates. Either via FE representation or via macro-elemen...
MacroElement * macro_elem_pt()
Access function to pointer to macro element.
Node ** Node_pt
Storage for pointers to the nodes in the element.
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
virtual void node_update()
Update the positions of all nodes in the element using each node update function. The default impleme...
int non_halo_proc_ID()
ID of processor ID that holds non-halo counterpart of halo element; negative if not a halo.
unsigned ndim() const
Access function to # of Eulerian coordinates.
unsigned nlagrangian() const
Access function to # of Lagrangian coordinates.
Class that contains data for hanging nodes.
////////////////////////////////////////////////////////////////////
std::map< unsigned, Vector< Node * > > Shared_node_pt
Map of vectors holding the pointers to the shared nodes. These are all the nodes that are on two "nei...
bool is_mesh_distributed() const
Boolean to indicate if Mesh has been distributed.
bool Lookup_for_elements_next_boundary_is_setup
Flag to indicate that the lookup schemes for elements that are adjacent to the boundaries has been se...
FiniteElement * finite_element_pt(const unsigned &e) const
Upcast (downcast?) to FiniteElement (needed to access FiniteElement member functions).
unsigned nboundary_element(const unsigned &b) const
Return number of finite elements that are adjacent to boundary b.
Node *& node_pt(const unsigned long &n)
Return pointer to global node n.
virtual void setup_boundary_element_info()
Interface for function that is used to setup the boundary information (Empty virtual function – imple...
FiniteElement * boundary_element_pt(const unsigned &b, const unsigned &e) const
Return pointer to e-th finite element on boundary b.
OomphCommunicator * Comm_pt
Pointer to communicator – set to NULL if mesh is not distributed.
virtual void reorder_nodes(const bool &use_old_ordering=true)
Re-order nodes in the order in which they appear in elements – can be overloaded for more efficient r...
unsigned nboundary() const
Return number of boundaries.
Vector< GeneralisedElement * > halo_element_pt(const unsigned &p)
Return vector of halo elements in this Mesh whose non-halo counterpart is held on processor p.
unsigned long nnode() const
Return number of nodes in the mesh.
void delete_all_external_storage()
Wipe the storage for all externally-based elements.
unsigned nhalo_node()
Total number of halo nodes in this Mesh.
const Vector< GeneralisedElement * > & element_pt() const
Return reference to the Vector of elements.
void output(std::ostream &outfile)
Output for all elements.
Node * haloed_node_pt(const unsigned &p, const unsigned &j)
Access fct to the j-th haloed node in this Mesh whose halo counterpart is held on processor p.
Vector< Node * > prune_dead_nodes()
Prune nodes. Nodes that have been marked as obsolete are removed from the mesh (and its boundary-node...
Vector< GeneralisedElement * > Element_pt
Vector of pointers to generalised elements.
unsigned nhaloed_node()
Total number of haloed nodes in this Mesh.
Node * halo_node_pt(const unsigned &p, const unsigned &j)
Access fct to the j-th halo node in this Mesh whose non-halo counterpart is held on processor p.
Vector< GeneralisedElement * > haloed_element_pt(const unsigned &p)
Return vector of haloed elements in this Mesh whose haloing counterpart is held on processor p.
Node * shared_node_pt(const unsigned &p, const unsigned &j)
Access fct to the j-th shared node in this Mesh who has a counterpart on processor p.
unsigned long nelement() const
Return number of elements in the mesh.
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
void set_non_obsolete()
Mark node as non-obsolete.
unsigned ndim() const
Return (Eulerian) spatial dimension of the node.
void set_hanging_pt(HangInfo *const &hang_pt, const int &i)
Set the hanging data for the i-th value. (hang_pt=0 to make non-hanging)
double & x(const unsigned &i)
Return the i-th nodal coordinate.
An OomphLibError object which should be thrown when an run-time error is encountered....
An OomphLibWarning object which should be created as a temporary object to issue a warning....
/////////////////////////////////////////////////////////////////// /////////////////////////////////...
void select_for_p_refinement()
Select the element for p-refinement.
void deselect_for_p_refinement()
Deselect the element for p-refinement.
RefineableElements are FiniteElements that may be subdivided into children to provide a better local ...
Tree * tree_pt()
Access function: Pointer to quadtree representation of this element.
static double & max_integrity_tolerance()
Max. allowed discrepancy in element integrity check.
void deselect_for_refinement()
Deselect the element for refinement.
unsigned & max_keep_unrefined()
Max. number of elements that we allow to remain unrefined if no other mesh adaptation is required (to...
unsigned Nrefined
Stats: Number of elements that were refined.
double & min_permitted_error()
Access fct for min. error (i.e. (try to) merge elements if their error is smaller)
DocInfo *& doc_info_pt()
Access fct for pointer to DocInfo.
DocInfo doc_info()
Access fct for DocInfo.
unsigned & nrefinement_overruled()
Number of elements that would have liked to be refined further but can't because they've reached the ...
unsigned Nunrefined
Stats: Number of elements that were unrefined.
double & max_error()
Access fct for max. actual error in present solution (i.e. before re-solve on adapted mesh)
double & max_permitted_error()
Access fct for max. error (i.e. split elements if their error is larger)
////////////////////////////////////////////////////////////////////// //////////////////////////////...
A Class for nodes that deform elastically (i.e. position is an unknown in the problem)....
//////////////////////////////////////////////////////////////////////
void output(std::ostream &outfile)
Output function: x,y,u or x,y,z,u.
///////////////////////////////////////////////////////////////// ///////////////////////////////////...
TreeForest * forest_pt()
Return pointer to the Forest represenation of the mesh.
void synchronise_hanging_nodes(const unsigned &ncont_interpolated_values)
Synchronise the hanging nodes if the mesh is distributed.
virtual void read_refinement(std::ifstream &restart_file, Vector< Vector< unsigned > > &to_be_refined)
Read refinement pattern to allow for rebuild.
virtual void get_elements_at_refinement_level(unsigned &refinement_level, Vector< RefineableElement * > &level_elements)
Extract the elements at a particular refinement level in the refinement pattern - used in Mesh::redis...
virtual void refine_selected_elements(const Vector< unsigned > &elements_to_be_refined)
Refine mesh by splitting the elements identified by their numbers.
unsigned & max_p_refinement_level()
Access fct for max. permissible p-refinement level (relative to base mesh)
virtual void dump_refinement(std::ostream &outfile)
Dump refinement pattern to allow for rebuild.
unsigned unrefine_uniformly()
Unrefine mesh uniformly: Return 0 for success, 1 for failure (if unrefinement has reached the coarses...
virtual void refine(std::ifstream &restart_file)
Refine mesh according to refinement pattern in restart file.
virtual void additional_synchronise_hanging_nodes(const unsigned &ncont_interpolated_values)=0
Additional synchronisation of hanging nodes Required for reconcilliation of hanging nodes on the oute...
unsigned & min_refinement_level()
Access fct for min. permissible refinement level (relative to base mesh)
virtual void adapt_mesh()
Perform the actual tree-based mesh adaptation. A simple wrapper to call the function without document...
virtual void refine_base_mesh_as_in_reference_mesh(TreeBasedRefineableMeshBase *const &ref_mesh_pt)
Refine base mesh to same degree as reference mesh (relative to original unrefined mesh).
virtual void get_refinement_pattern(Vector< Vector< unsigned > > &to_be_refined)
Extract refinement pattern: Consider the hypothetical mesh obtained by truncating the refinement of t...
void complete_hanging_nodes_recursively(Node *&nod_pt, Vector< Node * > &master_nodes, Vector< double > &hang_weights, const int &ival)
Auxiliary routine for recursive hanging node completion.
unsigned & max_refinement_level()
Access fct for max. permissible refinement level (relative to base mesh)
virtual void refine_as_in_reference_mesh(TreeBasedRefineableMeshBase *const &ref_mesh_pt)
Refine mesh once so that its topology etc becomes that of the (finer!) reference mesh – if possible!...
void refine_base_mesh(Vector< Vector< unsigned > > &to_be_refined)
Refine base mesh according to specified refinement pattern.
void p_refine_selected_elements(const Vector< unsigned > &elements_to_be_refined)
p-refine mesh by refining the elements identified by their numbers.
virtual void split_elements_if_required()=0
Split all the elements in the mesh if required. This template free interface will be overloaded in Re...
void refine_uniformly()
Refine mesh uniformly.
void p_unrefine_uniformly(DocInfo &doc_info)
p-unrefine mesh uniformly
virtual void get_refinement_levels(unsigned &min_refinement_level, unsigned &max_refinement_level)
Get max/min refinement levels in mesh.
virtual void p_refine_elements_if_required()=0
p-refine all the elements in the mesh if required. This template free interface will be overloaded in...
void complete_hanging_nodes(const int &ncont_interpolated_values)
Complete the hanging node scheme recursively.
TreeForest * Forest_pt
Forest representation of the mesh.
void synchronise_nonhanging_nodes()
Synchronise the positions of non-hanging nodes that depend on non-existent neighbours (e....
void adapt(const Vector< double > &elemental_error)
Adapt mesh: Refine elements whose error is lager than err_max and (try to) unrefine those whose error...
void p_adapt(const Vector< double > &elemental_error)
p-adapt mesh: Refine elements whose error is lager than err_max and (try to) unrefine those whose err...
void p_adapt_mesh()
Perform the actual tree-based mesh p-adaptation. A simple wrapper to call the function without docume...
virtual bool refine_base_mesh_as_in_reference_mesh_minus_one(TreeBasedRefineableMeshBase *const &ref_mesh_pt)
Refine base mesh to same degree as reference mesh minus one level of refinement (relative to original...
void p_refine_uniformly()
p-refine mesh uniformly
void classify_halo_and_haloed_nodes(DocInfo &doc_info, const bool &report_stats)
Classify all halo and haloed information in the mesh (overloaded version from Mesh base class....
virtual void check_all_neighbours(DocInfo &doc_info)=0
Document/check the neighbours of all the nodes in the forest. This must be overloaded for different t...
void stick_all_tree_nodes_into_vector(Vector< Tree * > &all_forest_nodes)
Traverse forest and stick pointers to all "nodes" into Vector.
virtual void open_hanging_node_files(DocInfo &doc_info, Vector< std::ofstream * > &output_stream)=0
Open output files that will store any hanging nodes in the forest. Return a vector of the output stre...
unsigned ntree()
Number of trees in forest.
void stick_leaves_into_vector(Vector< Tree * > &forest_nodes)
Traverse forst and stick pointers to leaf "nodes" into Vector.
TreeRoot * tree_pt(const unsigned &i) const
Return pointer to i-th tree in forest.
void close_hanging_node_files(DocInfo &doc_info, Vector< std::ofstream * > &output_stream)
Close output files that will store any hanging nodes in the forest and delete any associated storage....
A generalised tree base class that abstracts the common functionality between the quad- and octrees u...
unsigned nsons() const
Return number of sons (zero if it's a leaf node)
void traverse_all(Tree::VoidMemberFctPt member_function)
Traverse the tree and execute void Tree member function member_function() at all its "nodes".
bool is_leaf()
Return true if the tree is a leaf node.
int son_type() const
Return son type.
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 deactivate_object()
Call the RefineableElement's deactivate_element() function.
void traverse_all_but_leaves(Tree::VoidMemberFctPt member_function)
Traverse the tree and execute void Tree member function member_function() at all its "nodes" aparat f...
void merge_sons_if_required(Mesh *&mesh_pt)
If required, merge the four sons for unrefinement – criterion: bool object_pt()-> sons_to_be_unrefine...
A slight extension to the standard template vector class so that we can include "graceful" array rang...
bool Doc_comprehensive_timings
Global boolean to switch on comprehensive timing – can probably be declared const false when developm...
double timer()
returns the time in seconds after some point in past
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
void pause(std::string message)
Pause and display message.
OomphInfo oomph_info
Single (global) instantiation of the OomphInfo object – this is used throughout the library as a "rep...
Helper struct to collate data required during TreeBasedRefineableMeshBase::synchronise_hanging_nodes.