65 to_be_refined.clear();
123 if (level == refinement_level)
187 ->select_for_refinement();
234 <<
"What follows are the numbers of the elements. " << std::endl;
239 outfile << to_be_refined[
l][
i] << std::endl;
329 error_stream <<
"Refinement tolerance <= Unrefinement tolerance"
331 <<
"doesn't make sense and will almost certainly crash"
333 <<
"this beautiful code!" << std::endl;
354 unsigned long Nelement = this->
nelement();
355 for (
unsigned long e = 0;
e < Nelement;
e++)
369 if ((
el_pt->refinement_is_enabled()) &&
372 el_pt->select_for_refinement();
386 (
el_pt->tree_pt()->father_pt() != 0))
390 unsigned n_sons =
el_pt->tree_pt()->father_pt()->nsons();
397 if (!(
el_pt->tree_pt()->father_pt()->son_pt(
ison)->is_leaf()))
424 oomph_info <<
" \n Number of elements whose refinement was overruled: "
432 for (
unsigned long e = 0;
e < Nelement;
e++)
449 unsigned n_sons =
el_pt->tree_pt()->father_pt()->nsons();
453 el_pt->tree_pt()->father_pt()->son_pt(
ison)->object_pt())]))
466 ->select_sons_for_unrefinement();
475 ->deselect_sons_for_unrefinement();
571 for (
int d = 0; d <
n_proc; d++)
584 for (
unsigned e = 0;
e <
nhalo;
e++)
587 ->sons_to_be_unrefined())
643 ->sons_to_be_unrefined())) ||
646 ->sons_to_be_unrefined())))
648 std::ostringstream error_message;
650 <<
"Error in unrefinement: \n"
651 <<
"Haloed element: " <<
e <<
" on proc " <<
my_rank
653 <<
"wants to be unrefined whereas its halo counterpart "
655 <<
"proc " <<
dd <<
" doesn't (or vice versa)...\n"
656 <<
"This is most likely because the error estimator\n"
657 <<
"has not assigned the same errors to halo and haloed\n"
658 <<
"elements -- it ought to!\n";
674 for (
int d = 0; d <
n_proc; d++)
687 for (
unsigned e = 0;
e <
nhalo;
e++)
746 ->to_be_refined())) ||
751 std::ostringstream error_message;
753 <<
"Error in refinement: \n"
754 <<
"Haloed element: " <<
e <<
" on proc " <<
my_rank
756 <<
"wants to be refined whereas its halo counterpart on\n"
757 <<
"proc " <<
dd <<
" doesn't (or vice versa)...\n"
758 <<
"This is most likely because the error estimator\n"
759 <<
"has not assigned the same errors to halo and haloed\n"
760 <<
"elements -- it ought to!\n";
817 oomph_info <<
" Not enough benefit in adapting mesh." << std::endl
829 unsigned& min_refinement_level,
unsigned& max_refinement_level)
848 ->refinement_level();
938 Mesh* mesh_pt =
this;
1046 for (
unsigned long n = 0;
n <
n_node;
n++)
1055 bool is_hanging =
nod_pt->is_hanging();
1059 is_hanging |=
nod_pt->is_hanging(
n);
1076 for (
unsigned t = 0;
t <
nt;
t++)
1084 for (
unsigned i = 0;
i <
n_dim;
i++)
1118 if (
nod_pt->is_on_boundary())
1140 nod_pt->set_nonhanging();
1147 oomph_info <<
"Time for sorting out initial hanging status: "
1244 oomph_info <<
"Time for setup_hanging_nodes() and "
1245 "further_setup_hanging_nodes() for "
1253 unsigned ncont_interpolated_values =
1315 error_stream <<
"Mesh refined: Max. error in integrity check: "
1318 <<
"i.e. bigger than RefineableElement::max_integrity_tolerance()="
1324 for (
unsigned long n = 0;
n <
n_node;
n++)
1331 for (
unsigned i = 0;
i <
n_dim;
i++)
1339 error_stream <<
"Doced problem mesh in ProblemMesh.dat" << std::endl;
1346 oomph_info <<
"Mesh refined: Max. error in integrity check: "
1349 <<
"i.e. less than RefineableElement::max_integrity_tolerance()="
1358 oomph_info <<
"Time for (paranoid only) checking of integrity: "
1382 oomph_info <<
"Time for deactivating objects and pruning nodes: "
1411 for (
unsigned j = 0;
j <
n_del;
j++)
1418 for (std::set<Node*>::iterator
it =
1422 if ((*it)->is_hanging())
1470 if (
nod_pt->is_on_boundary(b))
1473 std::set<Node*>::iterator
it =
1488 const unsigned ntstorage =
nod_pt->ntstorage();
1509 for (
unsigned i = 0;
i < 3;
i++)
1518 for (
unsigned t = 0;
t < ntstorage;
t++)
1525 for (
unsigned i = 0;
i < 3;
i++)
1587 for (
unsigned n = 0;
n <
n_nod;
n++)
1594 for (
unsigned i = 0;
i <
n_dim;
i++)
1631 for (
unsigned long n = 0;
n <
n_node;
n++)
1635 for (
unsigned i = 0;
i <
n_dim;
i++)
1652 for (
unsigned long n = 0;
n <
n_node;
n++)
1656 if (
nod_pt->is_hanging())
1659 for (
unsigned i = 0;
i <
n_dim;
i++)
1665 if (this->
node_pt(
n)->nvalue() > 0)
1680 for (
unsigned long n = 0;
n <
n_node;
n++)
1683 if (
nod_pt->is_hanging())
1686 unsigned nmaster =
nod_pt->hanging_pt()->nmaster();
1687 some_file <<
"ZONE I=" << nmaster + 1 << std::endl;
1688 for (
unsigned i = 0;
i <
n_dim;
i++)
1699 for (
unsigned i = 0;
i <
n_dim;
i++)
1711 for (
unsigned i = 0;
i < ncont_interpolated_values;
i++)
1715 <<
"/nonstandard_hangnodes_withmasters" <<
i <<
"_"
1719 for (
unsigned long n = 0;
n <
n_nod;
n++)
1726 unsigned nmaster =
nod_pt->hanging_pt(
i)->nmaster();
1727 some_file <<
"ZONE I=" << nmaster + 1 << std::endl;
1729 for (
unsigned j = 0;
j <
n_dim;
j++)
1739 for (
unsigned j = 0;
j <
n_dim;
j++)
1773 unsigned long Nelement = this->
nelement();
1774 for (
unsigned long e = 0;
e < Nelement;
e++)
1777 ->select_for_refinement();
1791 unsigned long Nelement = this->
nelement();
1792 for (
unsigned long e = 0;
e < Nelement;
e++)
1801 el_pt->select_for_p_refinement();
1821 warn_stream <<
"You are attempting to refine selected elements of a "
1823 <<
"distributed mesh. This may have undesired effects."
1827 "TreeBasedRefineableMeshBase::refine_selected_elements()",
1834 for (
unsigned long e = 0;
e <
nref;
e++)
1838 ->select_for_refinement();
1857 warn_stream <<
"You are attempting to refine selected elements of a "
1859 <<
"distributed mesh. This may have undesired effects."
1863 "TreeBasedRefineableMeshBase::refine_selected_elements()",
1870 for (
unsigned long e = 0;
e <
nref;
e++)
1890 ref_mesh_pt->get_refinement_pattern(to_be_refined);
1912 ref_mesh_pt->get_refinement_pattern(to_be_refined);
1948 oomph_info <<
"WARNING : This has not been checked comprehensively yet"
1950 <<
"Check it and remove this break " << std::endl;
1951 pause(
"Yes really pause");
1966 <<
"Meshes definitely don't differ by one refinement level \n"
1967 <<
"max. refinement levels: " <<
ref_max <<
" " <<
my_max << std::endl;
1989 for (
unsigned e = 0;
e <
nelem;
e++)
2042 oomph_info <<
"Number of elements in uniformly unrefined reference mesh: "
2043 << nel_coarse << std::endl;
2073 oomph_info <<
"Documented original ('this')mesh in orig_mesh.dat"
2087 double tol = 1.0e-5;
2088 for (
unsigned e = 0;
e <
nelem;
e++)
2096 for (
unsigned j = 0;
j <
nnod;
j++)
2105 for (
unsigned i = 0;
i < ndim;
i++)
2114 <<
" [tol=" <<
tol <<
"]" << std::endl;
2134 "Bailing out. Doced refined_mesh.dat finer_mesh.dat\n",
2159 unsigned long Nelement = this->
nelement();
2174 for (
unsigned long e = 0;
e < Nelement;
e++)
2223 unsigned nmaster =
hang_pt->nmaster();
2225 for (
unsigned m = 0;
m < nmaster;
m++)
2270 const int& ncont_interpolated_values)
2277 for (
unsigned long n = 0;
n <
n_node;
n++)
2284 for (
int i = -1;
i < ncont_interpolated_values;
i++)
2291 if ((
i == -1) || (
nod_pt->hanging_pt(
i) !=
nod_pt->hanging_pt()))
2315 typedef std::map<Node*, double>::iterator
IT;
2335 for (
int i = -1;
i < ncont_interpolated_values;
i++)
2338 for (
unsigned long n = 0;
n <
n_node;
n++)
2346 unsigned nmaster =
nod_pt->hanging_pt(
i)->nmaster();
2352 if (std::fabs(
sum - 1.0) > 1.0e-7)
2354 oomph_info <<
"WARNING: Sum of master node weights fabs(sum-1.0) "
2355 << std::fabs(
sum - 1.0) <<
" for node number " <<
n
2356 <<
" at value " <<
i << std::endl;
2374 const unsigned& ncont_interpolated_values)
2401 for (
int d = 0; d <
n_proc; d++)
2409 for (
unsigned j = 0;
j <
nh;
j++)
2419 if (
nod_pt->is_hanging(icont))
2442 <<
", does not match number of haloed data, "
2477 for (
unsigned j = 0;
j <
nh;
j++)
2487 if (
nod_pt->is_hanging(icont))
2526 oomph_info <<
"Time for first all-to-all in synchronise_hanging_nodes(): "
2545 for (
int d = 0; d <
n_proc; d++)
2548 for (
unsigned jj = 0;
jj <
n;
jj++)
2558 for (
int d = 0; d <
n_proc; d++)
2585 for (
unsigned j = 0;
j <
nh;
j++)
2666 std::map<Node*, unsigned>::iterator
it =
2712 std::map<Node*, unsigned>::iterator
it =
3015 <<
"haloed_hanging[d][count]="
3017 <<
"; halo_hanging[d][count]="
3122 for (
unsigned j = 0;
j <
nh;
j++)
3183 tmp.Sending_processor =
dd;
3184 tmp.Shared_node_id_on_sending_processor =
3189 tmp.Master_node_index =
m;
3204 nod_pt->set_hanging_pt(0, icont);
3219 oomph_info <<
"Time for second all-to-all in synchronise_hanging_nodes() "
3236 <<
"No need for reconciliation of wrongly synchronised hang nodes\n";
3241 oomph_info <<
"Need to reconcile of wrongly syncronised hang nodes\n";
3280 for (
unsigned i = 0;
i <
n;
i++)
3283 if (
tmp.Shared_node_proc ==
unsigned(
rank))
3291 send_data.push_back(
tmp.Shared_node_id_on_sending_processor);
3366 for (
unsigned i = 0;
i <
n_rec / 2;
i++)
3386 std::map<Node*, unsigned>::iterator
it =
3433 <<
"Time for third all-to-all in synchronise_hanging_nodes() "
3465 for (
unsigned j = 0;
j <
n;
j++)
3537 for (
unsigned i = 0;
i <
n_rec;
i++)
3557 tmp.Hang_pt->set_master_node_pt(
3591 <<
"Time for fourth all-to-all in synchronise_hanging_nodes() "
3618 oomph_info <<
"Need to do additional synchronisation of hanging nodes"
3629 <<
"Time for RefineableMesh::additional_synchronise_hanging_nodes() "
3630 <<
"in TreeBasedRefineableMeshBase::synchronise_hanging_nodes(): "
3637 oomph_info <<
"No need to do additional synchronisation of hanging nodes"
3670 for (
int d = 0; d <
n_proc; d++)
3776 error_stream <<
"recv_unsigneds_count != recv_unsigneds_index ( "
3778 <<
")" << std::endl;
3781 "TreeBasedRefineableMeshBase::synchronise_nonhanging_nodes()",
3807 for (
unsigned e = 0;
e <
nh;
e++)
3827 if (!
nod_pt->is_hanging())
3834 for (
unsigned t = 0;
t <
nt;
t++)
3928 oomph_info <<
"Time for synchronise_nonhanging_nodes(): "
3974 error_stream <<
"Refinement tolerance <= Unrefinement tolerance"
3976 <<
"doesn't make sense and will almost certainly crash"
3978 <<
"this beautiful code!" << std::endl;
3994 unsigned long Nelement = this->
nelement();
3995 for (
unsigned long e = 0;
e < Nelement;
e++)
4005 el_pt->deselect_for_p_refinement();
4006 el_pt->deselect_for_p_unrefinement();
4013 if ((
el_pt->p_refinement_is_enabled()) &&
4031 if ((
el_pt->p_refinement_is_enabled()) &&
4032 (
el_pt->p_order() >
this->min_p_refinement_level()) &&
4033 (
el_pt->p_order() >
el_pt->initial_p_order()))
4035 el_pt->select_for_p_unrefinement();
4048 oomph_info <<
"p-refinement is not possible for these elements"
4057 oomph_info <<
" \n Number of elements whose refinement was overruled: "
4148 for (
int d = 0; d <
n_proc; d++)
4163 for (
unsigned e = 0;
e <
nhalo;
e++)
4166 ->to_be_p_unrefined())
4212 ->to_be_p_unrefined())) ||
4215 ->to_be_p_unrefined())))
4217 std::ostringstream error_message;
4219 <<
"Error in refinement: \n"
4220 <<
"Haloed element: " <<
e <<
" on proc " <<
my_rank
4222 <<
"wants to be unrefined whereas its halo counterpart on\n"
4223 <<
"proc " << d <<
" doesn't (or vice versa)...\n"
4224 <<
"This is most likely because the error estimator\n"
4225 <<
"has not assigned the same errors to halo and haloed\n"
4226 <<
"elements -- it ought to!\n";
4238 for (
int d = 0; d <
n_proc; d++)
4253 for (
unsigned e = 0;
e <
nhalo;
e++)
4256 ->to_be_p_refined())
4299 ->to_be_p_refined())) ||
4302 ->to_be_p_refined())))
4304 std::ostringstream error_message;
4306 <<
"Error in refinement: \n"
4307 <<
"Haloed element: " <<
e <<
" on proc " <<
my_rank
4309 <<
"wants to be refined whereas its halo counterpart on\n"
4310 <<
"proc " << d <<
" doesn't (or vice versa)...\n"
4311 <<
"This is most likely because the error estimator\n"
4312 <<
"has not assigned the same errors to halo and haloed\n"
4313 <<
"elements -- it ought to!\n";
4368 oomph_info <<
"\n Not enough benefit in adapting mesh. " << std::endl
4492 for (
unsigned long n = 0;
n <
n_node;
n++)
4501 bool is_hanging =
nod_pt->is_hanging();
4505 is_hanging |=
nod_pt->is_hanging(
n);
4522 for (
unsigned t = 0;
t <
nt;
t++)
4530 for (
unsigned i = 0;
i <
n_dim;
i++)
4564 if (
nod_pt->is_on_boundary())
4586 nod_pt->set_nonhanging();
4594 oomph_info <<
"Time for sorting out initial hanging status: "
4660 oomph_info <<
"Time for setup_hanging_nodes() and "
4661 "further_setup_hanging_nodes() for "
4669 unsigned ncont_interpolated_values =
4709 if (first_macro_el_pt != 0)
4718 if (macro_el_pt != 0)
4725 macro_el_pt->set_node_update_info(geom_object_pt);
4760 error_stream <<
"Mesh refined: Max. error in integrity check: "
4762 <<
"\ni.e. bigger than RefineableElement::"
4763 <<
"max_integrity_tolerance()="
4769 for (
unsigned long n = 0;
n <
n_node;
n++)
4776 for (
unsigned i = 0;
i <
n_dim;
i++)
4784 error_stream <<
"Documented problem mesh in ProblemMesh.dat"
4792 oomph_info <<
"Mesh refined: Max. error in integrity check: "
4795 <<
"i.e. less than RefineableElement::max_integrity_tolerance()="
4804 oomph_info <<
"Time for (paranoid only) checking of integrity: "
4829 oomph_info <<
"Time for deactivating objects and pruning nodes: "
4858 for (
unsigned j = 0;
j <
n_del;
j++)
4865 for (std::set<Node*>::iterator
it =
4869 if ((*it)->is_hanging())
4917 if (
nod_pt->is_on_boundary(b))
4920 std::set<Node*>::iterator
it =
4932 const unsigned ntstorage =
nod_pt->ntstorage();
4953 for (
unsigned i = 0;
i < 3;
i++)
4962 for (
unsigned t = 0;
t < ntstorage;
t++)
4969 for (
unsigned i = 0;
i < 3;
i++)
5030 for (
unsigned n = 0;
n <
n_nod;
n++)
5037 for (
unsigned i = 0;
i <
n_dim;
i++)
5074 for (
unsigned long n = 0;
n <
n_node;
n++)
5078 for (
unsigned i = 0;
i <
n_dim;
i++)
5095 for (
unsigned long n = 0;
n <
n_node;
n++)
5099 if (
nod_pt->is_hanging())
5102 for (
unsigned i = 0;
i <
n_dim;
i++)
5108 if (this->
node_pt(
n)->nvalue() > 0)
5123 for (
unsigned long n = 0;
n <
n_node;
n++)
5126 if (
nod_pt->is_hanging())
5129 unsigned nmaster =
nod_pt->hanging_pt()->nmaster();
5130 some_file <<
"ZONE I=" << nmaster + 1 << std::endl;
5131 for (
unsigned i = 0;
i <
n_dim;
i++)
5142 for (
unsigned i = 0;
i <
n_dim;
i++)
5154 for (
unsigned i = 0;
i < ncont_interpolated_values;
i++)
5158 <<
"/nonstandard_hangnodes_withmasters" <<
i <<
"_"
5162 for (
unsigned long n = 0;
n <
n_nod;
n++)
5169 unsigned nmaster =
nod_pt->hanging_pt(
i)->nmaster();
5170 some_file <<
"ZONE I=" << nmaster + 1 << std::endl;
5172 for (
unsigned j = 0;
j <
n_dim;
j++)
5182 for (
unsigned j = 0;
j <
n_dim;
j++)
5245 unsigned long Nelement = this->
nelement();
5246 for (
unsigned long e = 0;
e < Nelement;
e++)
5255 el_pt->select_for_p_unrefinement();
5273 warn_stream <<
"You are attempting to refine selected elements of a "
5275 <<
"distributed mesh. This may have undesired effects."
5279 "TreeBasedRefineableMeshBase::refine_selected_elements()",
5286 for (
unsigned long e = 0;
e <
nref;
e++)
5295 el_pt->select_for_p_refinement();
5313 warn_stream <<
"You are attempting to refine selected elements of a "
5315 <<
"distributed mesh. This may have undesired effects."
5319 "TreeBasedRefineableMeshBase::refine_selected_elements()",
5326 for (
unsigned long e = 0;
e <
nref;
e++)
Algebraic nodes are nodes with an algebraic positional update function.
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.
Base class for elements that allow MacroElement-based node update.
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....
p-refineable version of RefineableElement
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)
SolidFiniteElement class.
A Class for nodes that deform elastically (i.e. position is an unknown in the problem)....
TAdvectionDiffusionReactionElement<NREAGENT,DIM,NNODE_1D> elements are isoparametric triangular DIM-d...
void output(std::ostream &outfile)
Output function: x,y,u or x,y,z,u.
Base class for tree-based refineable meshes.
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
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).
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.