26#ifndef OOMPH_TRIANGLE_MESH_TEMPLATE_HEADER
27#define OOMPH_TRIANGLE_MESH_TEMPLATE_HEADER
29#ifndef OOMPH_TRIANGLE_MESH_HEADER
30#error __FILE__ should only be included from triangle_mesh.h.
46 template<
class ELEMENT>
51 MeshChecker::assert_geometric_element<TElementGeometricBase, ELEMENT>(2);
54 unsigned nelem = Tmp_mesh_pt->nelement();
55 Element_pt.resize(
nelem);
78 unsigned nbound = Tmp_mesh_pt->nboundary();
82 Boundary_element_pt.resize(
nbound);
83 Face_index_at_boundary.resize(
nbound);
89 Boundary_region_element_pt.resize(
nbound);
90 Face_index_region_at_boundary.resize(
nbound);
96 Element_pt[
e] =
new ELEMENT;
100 unsigned nnod_el = Tmp_mesh_pt->finite_element_pt(0)->
nnode();
120 for (
unsigned e = 0;
e <
nelem;
e++)
183 for (
unsigned i = 0;
i < finite_element_pt(
e)->dim();
i++)
199 finite_element_pt(
e));
219 this->Region_attribute[
count] =
it->first;
220 Region_element_pt[
static_cast<unsigned>(Region_attribute[
count])] =
230 unsigned boundary_id = 0;
235 unsigned dim = finite_element_pt(0)->
dim();
248 for (
unsigned e = 0;
e <
nelem;
e++)
269 for (
unsigned i = 0;
i <
dim;
i++)
283 for (
unsigned j = 0;
j < 3;
j++)
286 boundary_id = Tmp_mesh_pt->edge_boundary(
e,
j);
289 unsigned edge_index = Tmp_mesh_pt->edge_index(
e,
j);
306 this->add_boundary_node(boundary_id - 1,
new_node_pt);
319 for (
unsigned i = 0;
i <
dim;
i++)
354 Boundary_element_pt[boundary_id - 1].push_back(
elem_pt);
357 Face_index_at_boundary[boundary_id - 1].push_back((
j + 2) % 3);
363 static_cast<unsigned>(Tmp_mesh_pt->element_attribute(
e));
365 Boundary_region_element_pt[boundary_id - 1][
tmp_region].push_back(
369 Face_index_region_at_boundary[boundary_id - 1][
tmp_region]
370 .push_back((
j + 2) % 3);
378 Lookup_for_elements_next_boundary_is_setup =
true;
388 template<
class ELEMENT>
407 const unsigned n_regions = this->nregion();
423 static_cast<unsigned>(this->Region_attribute[
rr]);
427 this->nboundary_element_in_region(b,
region_id);
444 this->boundary_element_in_region_pt(b,
region_id,
e);
459 this->face_index_at_boundary_in_region(b,
region_id,
e);
469 std::pair<Node*, Node*>
tmp_pair = std::make_pair(
521 nele = this->nboundary_element(b);
531 for (
unsigned e = 0;
e <
nele;
e++)
548 int face_index = this->face_index_at_boundary(b,
e);
558 std::pair<Node*, Node*>
tmp_pair = std::make_pair(
610 std::ostringstream error_message;
612 <<
"The independent counting of face elements (" <<
nele <<
") for "
613 <<
"boundary (" << b <<
") is different\n"
614 <<
"from the real number of face elements in the container ("
617 "TriangleMesh::identify_boundary_segments_and_assign_"
618 "initial_zeta_values()",
662 std::ostringstream error_message;
664 <<
"There should not be halo face elements since they were not "
665 <<
"considered when computing the face elements\n\n"
669 "TriangleMesh::identify_boundary_segments_and_assign_"
670 "initial_zeta_values()",
685 std::map<FiniteElement*, bool>
done_el;
731 std::ostringstream error_message;
733 <<
"Could not find an initial face element for the current segment\n";
735 "TriangleMesh::identify_boundary_segments_and_"
736 "assign_initial_zeta_values()",
859 std::ostringstream error_message;
861 <<
"The number of segments is zero, but the number of nonhalo\n"
864 "TriangleMesh::identify_boundary_segments_and_assign_"
865 "initial_zeta_values()",
872 for (
unsigned is = 0;
is < nsegments;
is++)
877 std::ostringstream error_message;
878 error_message <<
"The (" <<
is <<
")-th segment has no elements\n";
880 "TriangleMesh::identify_boundary_segments_and_"
881 "assign_initial_zeta_values()",
920 if (this->boundary_geom_object_pt(b) != 0)
933 for (std::list<FiniteElement*>::iterator
it =
951 for (
unsigned j = 1;
j <
nnod;
j++)
999 std::ostringstream error_message;
1000 error_message <<
"The number of segments (" << nsegments
1001 <<
") and the number of "
1003 <<
") representing\n"
1004 <<
"the\nsegments is different!!!\n\n";
1042 std::stringstream error_message;
1044 <<
"The number of segments that present initial coordinates "
1046 <<
"the\nnumber of segments that present final coordinates "
1057 std::stringstream error_message;
1058 error_message <<
"Working with boundary (" << b
1059 <<
").\n The number of initial and "
1061 <<
") is different from\n"
1062 <<
"the number of found segments (" << nsegments
1082 for (
unsigned is = 0;
is < nsegments;
is++)
1086 for (
unsigned k = 0;
k < 2;
k++)
1094 if (this->boundary_geom_object_pt(b) != 0)
1111 Boundary_segment_inverted[b].clear();
1112 Boundary_segment_initial_coordinate[b].clear();
1113 Boundary_segment_final_coordinate[b].clear();
1115 Boundary_segment_initial_zeta[b].clear();
1116 Boundary_segment_final_zeta[b].clear();
1118 Boundary_segment_initial_arclength[b].clear();
1119 Boundary_segment_final_arclength[b].clear();
1126 for (
unsigned is = 0;
is < nsegments;
is++)
1166 for (
unsigned i = 0;
i < 2;
i++)
1215 Boundary_segment_inverted[b].push_back(0);
1218 Boundary_segment_initial_coordinate[b].push_back(
1220 Boundary_segment_final_coordinate[b].push_back(
1224 if (this->boundary_geom_object_pt(b) != 0)
1227 Boundary_segment_initial_zeta[b].push_back(
1229 Boundary_segment_final_zeta[b].push_back(
1236 Boundary_segment_initial_arclength[b].push_back(
1238 Boundary_segment_final_arclength[b].push_back(
1286 Boundary_segment_inverted[b].push_back(1);
1289 Boundary_segment_initial_coordinate[b].push_back(
1291 Boundary_segment_final_coordinate[b].push_back(
1295 if (this->boundary_geom_object_pt(b) != 0)
1298 Boundary_segment_initial_zeta[b].push_back(
1300 Boundary_segment_final_zeta[b].push_back(
1306 Boundary_segment_initial_arclength[b].push_back(
1308 Boundary_segment_final_arclength[b].push_back(
1331 std::stringstream error_message;
1333 <<
"The (" <<
is <<
")-th segment on the current segment was not\n"
1334 <<
"found when trying to identify it with the original mesh's\n"
1335 <<
"segment coordinates\n";
1375 for (
unsigned is = 0;
is < nsegments;
is++)
1380 if (boundary_geom_object_pt(b) == 0)
1423 if (!Boundary_segment_inverted[b][
is])
1462 std::stringstream error_message;
1464 <<
"It was not possible to identify if the zeta values on "
1465 <<
"boundary (" << b <<
")\nand segment (" <<
is
1466 <<
") should go in "
1467 <<
"increasing or decreasing order.\n--- New mesh ---\n"
1468 <<
"Current segment initial arclength: ("
1470 <<
"First node coordinates: (" <<
first_node_pt->x(0) <<
", "
1472 <<
"Current segment final arclength: ("
1474 <<
"Last node coordinates: (" <<
last_node_pt->x(0) <<
", "
1519 std::stringstream error_message;
1521 <<
"It was not possible to identify if the zeta values on "
1522 <<
"boundary (" << b <<
")\nand segment (" <<
is
1523 <<
") should go in "
1524 <<
"increasing or decreasing order.\n--- Original mesh ---\n"
1525 <<
"Original segment initial arclength: ("
1527 <<
"Original segment final arclength: ("
1566 nod_pt->get_coordinates_on_boundary(b,
zeta);
1573 if (std::fabs(
zeta[0] - 1.0) < 1.0e-14)
1577 else if (std::fabs(
zeta[0]) < 1.0e-14)
1583 nod_pt->set_coordinates_on_boundary(b,
zeta);
1614 nod_pt->get_coordinates_on_boundary(b,
zeta);
1621 if (std::fabs(
zeta[0] - 1.0) < 1.0e-14)
1625 else if (std::fabs(
zeta[0]) < 1.0e-14)
1630 nod_pt->set_coordinates_on_boundary(b,
zeta);
1661 nod_pt->get_coordinates_on_boundary(b,
zeta);
1668 if (std::fabs(
zeta[0] - 1.0) < 1.0e-14)
1672 else if (std::fabs(
zeta[0]) < 1.0e-14)
1677 nod_pt->set_coordinates_on_boundary(b,
zeta);
1708 nod_pt->get_coordinates_on_boundary(b,
zeta);
1715 if (std::fabs(
zeta[0] - 1.0) < 1.0e-14)
1719 else if (std::fabs(
zeta[0]) < 1.0e-14)
1724 nod_pt->set_coordinates_on_boundary(b,
zeta);
1731 for (std::list<FiniteElement*>::iterator
it_list =
1737 const unsigned nnod = (*it_list)->
nnode();
1756 if (
zeta[0] < 0.0 ||
zeta[0] > 1.0)
1758 std::ostringstream error_message;
1760 <<
"The boundary coordinate of the first node on boundary ("
1761 << b <<
")\nand segment (" <<
is <<
") is out of the "
1762 <<
"allowed values [0,1]\n"
1763 <<
"The node boundary coordinate: (" <<
zeta[0] <<
")\n"
1773 if (
zeta[0] < 0.0 ||
zeta[0] > 1.0)
1775 std::ostringstream error_message;
1777 <<
"The boundary coordinate of the last node on boundary (" << b
1778 <<
")\nand segment (" <<
is <<
") is out of the "
1779 <<
"allowed values [0,1]\n"
1780 <<
"The node boundary coordinate: (" <<
zeta[0] <<
")\n"
1781 <<
"The vertex coordinates are: (" <<
last_node_pt->x(0) <<
", "
1804 Boundary_initial_coordinate[b] =
1807 Boundary_final_coordinate[b] =
1812 Boundary_initial_zeta_coordinate[b] =
1815 Boundary_final_zeta_coordinate[b] =
1822 Assigned_segments_initial_zeta_values[b] =
true;
1825 for (
unsigned i = 0;
i <
nele;
i++)
1838 template<
class ELEMENT>
1851 const unsigned nproc = comm_pt->nproc();
1853 const unsigned my_rank = comm_pt->my_rank();
1869 select_boundary_face_elements(
1923 std::map<FiniteElement*, bool>
done_el;
1970 std::ostringstream error_message;
1972 <<
"Could not find an initial face element for the current segment\n";
2084 std::ostringstream error_message;
2086 <<
"The number of segments is zero, but the number of nonhalo\n"
2108 for (
unsigned is = 0;
is < nsegments;
is++)
2113 std::ostringstream error_message;
2114 error_message <<
"The (" <<
is <<
")-th segment has no elements\n";
2145 if (this->boundary_geom_object_pt(b) != 0)
2175 for (std::list<FiniteElement*>::iterator
it =
2194 for (
unsigned j = 1;
j <
nnod;
j++)
2276 for (
unsigned is = 0;
is < nsegments;
is++)
2278 for (std::list<FiniteElement*>::iterator
it_seg =
2290 for (
unsigned is = 0;
is < nsegments;
is++)
2419 for (
unsigned is = 0;
is < nsegments;
is++)
2437 std::ostringstream error_message;
2439 <<
"The current bulk element (left) is marked as halo but "
2440 <<
"the processor holding\nthe non-halo counterpart is "
2479 std::ostringstream error_message;
2481 <<
"The current bulk element (left) marked as halo was "
2482 <<
"not found in the vector of halo\nelements associated "
2501 std::ostringstream error_message;
2503 <<
"The bulk element represetation of the left-most nonhalo face\n"
2504 <<
"element of the current segment (" <<
is
2505 <<
") is marked as halo,\n"
2506 <<
"but the face element created from it is nonhalo\n";
2543 std::ostringstream error_message;
2545 <<
"The current bulk element (left) marked as haloed was "
2546 <<
"not found in the vector of haloed\nelements associated "
2580 std::ostringstream error_message;
2582 <<
"The current bulk element (right) is marked as halo but "
2583 <<
"the processor holding\nthe non-halo counterpart is "
2586 "TriangleMesh::compute_boundary_segments_"
2587 "connectivity_and_initial_zeta_values()",
2622 std::ostringstream error_message;
2624 <<
"The current bulk element (right) marked as halo was not "
2625 <<
"found in the vector of halo\nelements associated with "
2628 "TriangleMesh::compute_boundary_segments_"
2629 "connectivity_and_initial_zeta_values()",
2644 std::ostringstream error_message;
2646 <<
"The bulk element represetation of the right-most nonhalo face\n"
2647 <<
"element of the current segment (" <<
is
2648 <<
") is marked as halo,\n"
2649 <<
"but the face element created from it is nonhalo\n";
2651 "TriangleMesh::compute_boundary_segments_"
2652 "connectivity_and_initial_zeta_values()",
2686 std::ostringstream error_message;
2688 <<
"The current bulk element (right) marked as haloed was not "
2689 <<
"found in the vector of haloed\nelements associated with "
2692 "TriangleMesh::compute_boundary_segments_"
2693 "connectivity_and_initial_zeta_values()",
2737 comm_pt->mpi_comm());
2745 const unsigned spu = 7;
2747 for (
unsigned is = 0;
is < nsegments;
is++)
2825 comm_pt->mpi_comm());
2835 const unsigned spd = 1;
2837 for (
unsigned is = 0;
is < nsegments;
is++)
2900 comm_pt->mpi_comm());
3045 std::map<std::pair<unsigned, unsigned>,
bool>
done_segment;
3204 std::ostringstream error_message;
3206 <<
"The corresponding processor and segment to the left of "
3207 <<
"the current left\nmost segment was not found\n";
3209 "TriangleMesh::compute_boundary_segments_"
3210 "connectivity_and_initial_zeta_values()",
3348 std::ostringstream error_message;
3350 <<
"The corresponding processor and segment to the right of "
3351 <<
"the current right\nmost segment was not found\n";
3353 "TriangleMesh::compute_boundary_segments_"
3354 "connectivity_and_initial_zeta_values()",
3385 std::ostringstream error_message;
3388 <<
"boundary (" << b
3389 <<
")\nis different from the total number of "
3391 <<
") in all\nprocessors.\n\n";
3419 const unsigned iproc =
static_cast<unsigned>((*it_list).first);
3420 const unsigned iseg =
static_cast<unsigned>((*it_list).second);
3470 const unsigned rspu = 2;
3534 comm_pt->mpi_comm());
3539 const unsigned rspd = 1;
3601 comm_pt->mpi_comm());
3610 for (
unsigned is = 0;
is < nsegments;
is++)
3640 comm_pt->mpi_comm());
3655 comm_pt->mpi_comm());
3664 Boundary_initial_coordinate[b].clear();
3665 Boundary_final_coordinate[b].clear();
3667 Boundary_initial_zeta_coordinate[b].clear();
3668 Boundary_final_zeta_coordinate[b].clear();
3671 Boundary_segment_inverted[b].clear();
3672 Boundary_segment_initial_coordinate[b].clear();
3673 Boundary_segment_final_coordinate[b].clear();
3675 Boundary_segment_initial_zeta[b].clear();
3676 Boundary_segment_final_zeta[b].clear();
3678 Boundary_segment_initial_arclength[b].clear();
3679 Boundary_segment_final_arclength[b].clear();
3683 for (
unsigned is = 0;
is < nsegments;
is++)
3703 std::ostringstream error_message;
3704 error_message <<
"The first face element in the (" <<
is
3705 <<
")-th segment is halo\n";
3707 "TriangleMesh::compute_boundary_segments_"
3708 "connectivity_and_initial_zeta_values()",
3731 std::ostringstream error_message;
3732 error_message <<
"The last face element in the (" <<
is
3733 <<
")-th segment is halo\n";
3735 "TriangleMesh::compute_boundary_segments_"
3736 "connectivity_and_initial_zeta_values()",
3749 for (
unsigned i = 0;
i < 2;
i++)
3773 Boundary_segment_initial_coordinate[b].push_back(
last_seg_coord);
3781 if (boundary_geom_object_pt(b) != 0)
3801 Boundary_segment_initial_arclength[b].push_back(
3804 Boundary_segment_final_arclength[b].push_back(
3815 std::ostringstream error_message;
3816 error_message <<
"The number of segments (" << nsegments
3817 <<
") and the number of "
3819 <<
") representing\n"
3820 <<
"the\nsegments is different!!!\n\n";
3822 "TriangleMesh::compute_boundary_segments_"
3823 "connectivity_and_initial_zeta_values()",
3894 for (
unsigned i = 0;
i < 2;
i++)
3905 if (this->boundary_geom_object_pt(b) != 0)
3930 comm_pt->mpi_comm());
3934 for (
unsigned i = 0;
i < 2;
i++)
3990 for (
unsigned i = 0;
i < 2;
i++)
4001 if (this->boundary_geom_object_pt(b) != 0)
4027 comm_pt->mpi_comm());
4031 for (
unsigned i = 0;
i < 2;
i++)
4058 re_assign_initial_zeta_values_for_internal_boundary(
4070 identify_boundary_segments_and_assign_initial_zeta_values(b,
this);
4089 template<
class ELEMENT>
4111 const unsigned n_regions = this->nregion();
4123 static_cast<unsigned>(this->Region_attribute[
rr]);
4127 this->nboundary_element_in_region(b,
region_id);
4143 this->boundary_element_in_region_pt(b,
region_id,
e);
4154 this->face_index_at_boundary_in_region(b,
region_id,
e);
4164 std::pair<Node*, Node*>
tmp_pair = std::make_pair(
4214 nele = this->nboundary_element(b);
4223 for (
unsigned e = 0;
e <
nele;
e++)
4237 int face_index = this->face_index_at_boundary(b,
e);
4247 std::pair<Node*, Node*>
tmp_pair = std::make_pair(
4297 std::ostringstream error_message;
4299 <<
"The independet counting of face elements (" <<
nele <<
") for "
4300 <<
"boundary (" << b <<
") is different\n"
4301 <<
"from the real number of face elements in the container ("
4324 std::map<FiniteElement*, bool>
done_el;
4370 std::ostringstream error_message;
4372 <<
"Could not find an initial face element for the current segment\n";
4374 error_message.str(),
4375 "TriangleMesh::re_assign_initial_zeta_values_for_internal_boundary()",
4479 std::ostringstream error_message;
4481 <<
"The number of segments is zero, but the number of nonhalo\n"
4516 for (
unsigned is = 0;
is < nsegments;
is++)
4521 std::ostringstream error_message;
4522 error_message <<
"The (" <<
is <<
")-th segment has no elements\n";
4524 error_message.str(),
4525 "TriangleMesh::re_assign_initial_zeta_values_for_internal_boundary()",
4554 if (this->boundary_geom_object_pt(b) != 0)
4588 for (std::list<FiniteElement*>::iterator
it =
4606 for (
unsigned j = 1;
j <
nnod;
j++)
4622 if (this->boundary_geom_object_pt(b) == 0)
4698 boundary_segment_inverted(b)[
old_is];
4702 for (
unsigned i = 0;
i < 2;
i++)
4705 boundary_segment_initial_coordinate(b)[
old_is][
i];
4708 boundary_segment_final_coordinate(b)[
old_is][
i];
4712 if (this->boundary_geom_object_pt(b) != 0)
4715 boundary_segment_initial_zeta(b)[
old_is];
4718 boundary_segment_final_zeta(b)[
old_is];
4724 boundary_segment_initial_arclength(b)[
old_is];
4727 boundary_segment_final_arclength(b)[
old_is];
4735 Boundary_segment_inverted[b].clear();
4736 Boundary_segment_initial_coordinate[b].clear();
4737 Boundary_segment_final_coordinate[b].clear();
4739 Boundary_segment_initial_zeta[b].clear();
4740 Boundary_segment_final_zeta[b].clear();
4742 Boundary_segment_initial_arclength[b].clear();
4743 Boundary_segment_final_arclength[b].clear();
4746 Boundary_segment_inverted[b].resize(nsegments);
4747 Boundary_segment_initial_coordinate[b].resize(nsegments);
4748 Boundary_segment_final_coordinate[b].resize(nsegments);
4751 if (this->boundary_geom_object_pt(b) != 0)
4753 Boundary_segment_initial_zeta[b].resize(nsegments);
4754 Boundary_segment_final_zeta[b].resize(nsegments);
4758 Boundary_segment_initial_arclength[b].resize(nsegments);
4759 Boundary_segment_final_arclength[b].resize(nsegments);
4825 for (
unsigned is = 0;
is < nsegments;
is++)
4849 for (
unsigned i = 0;
i < 2;
i++)
4867 for (
unsigned i = 0;
i < 2;
i++)
4895 if (this->boundary_geom_object_pt(b) != 0)
4902 Boundary_segment_initial_zeta[b][
is] =
4927 Boundary_segment_initial_arclength[b][
is] =
4938 if (this->boundary_geom_object_pt(b) != 0)
4970 Boundary_segment_initial_arclength[b][
is] =
5005 if (this->boundary_geom_object_pt(b) != 0)
5046 if (this->boundary_geom_object_pt(b) != 0)
5125 std::stringstream error_message;
5127 <<
"Working with boundary (" << b <<
").\nOnly the first node or "
5128 <<
"the last node of the old segment (" <<
old_is <<
") was\n"
5129 <<
"found. Both, first and last node should have been found in "
5130 <<
"the same segment!!!.\n"
5134 "TriangleMesh::re_assign_initial_zeta_values_"
5135 "for_internal_boundary()",
5149 for (
unsigned is = 0;
is < nsegments;
is++)
5171 for (
unsigned i = 0;
i < 2;
i++)
5189 for (
unsigned i = 0;
i < 2;
i++)
5198 if (this->boundary_geom_object_pt(b) != 0)
5219 if (this->boundary_geom_object_pt(b) != 0)
5236 Boundary_segment_inverted[b][
is] = 0;
5252 std::stringstream error_message;
5253 error_message <<
"Working with boundary (" << b
5254 <<
").\nThe number of re-assigned "
5256 <<
") is different from the number\nof segments ("
5257 << nsegments <<
")\n\n";
5259 error_message.str(),
5260 "TriangleMesh::re_assign_initial_zeta_values_for_internal_boundary()",
5266 for (
unsigned i = 0;
i <
nele;
i++)
5282 template<
class ELEMENT>
5292 const unsigned my_rank = comm_pt->my_rank();
5302 const unsigned nregions = this->nregion();
5311 static_cast<unsigned>(this->Region_attribute[
ir]);
5315 this->nboundary_element_in_region(b,
region_id);
5327 this->boundary_element_in_region_pt(b,
region_id,
e);
5332 this->face_index_at_boundary_in_region(b,
region_id,
e);
5358 const unsigned nbound_ele = this->nboundary_element(b);
5372 int face_index = this->face_index_at_boundary(b,
e);
5393 std::map<FiniteElement*, bool>
done_face;
5611 template<
class ELEMENT>
5622 const unsigned nproc = comm_pt->nproc();
5623 const unsigned my_rank = comm_pt->my_rank();
5629 const unsigned nregions = this->nregion();
5642 static_cast<unsigned>(this->Region_attribute[
ir]);
5646 this->nboundary_element_in_region(b,
region_id);
5657 this->boundary_element_in_region_pt(b,
region_id,
e);
5661 this->face_index_at_boundary_in_region(b,
region_id,
e);
5686 const unsigned nbound_ele = this->nboundary_element(b);
5698 int face_index = this->face_index_at_boundary(b,
e);
5722 std::map<FiniteElement*, bool>
done_face;
5902 std::ostringstream error_message;
5904 <<
"The info. to perform the synchronisation of the boundary "
5905 <<
"coordinates was not completely established\n"
5906 <<
"In this case it was the number of non repeated boundary elements\n"
5907 <<
"Number of boundary elements: (" <<
nbound_ele <<
")\n"
5908 <<
"Number of nonrepeated boundary elements: (" <<
nface_ele <<
")\n";
5910 "TriangleMesh::synchronize_boundary_coordinates()",
6002 std::ostringstream error_message;
6004 <<
"The node was marked to be halo but the processor in "
6005 <<
"charge was found to be -1\n\n";
6007 error_message.str(),
6008 "TriangleMesh::synchronize_boundary_coordinates()",
6042 std::ostringstream error_message;
6044 <<
"The halo id of the current node: (" <<
face_node_pt->x(0)
6046 <<
") was not found!!!\n\n";
6048 error_message.str(),
6049 "TriangleMesh::synchronize_boundary_coordinates()",
6122 std::ostringstream error_message;
6125 <<
") is different from the number of\nfound halo face ids ("
6128 error_message.str(),
6129 "TriangleMesh::synchronize_boundary_coordinates()",
6175 comm_pt->mpi_comm(),
6184 comm_pt->mpi_comm(),
6196 comm_pt->mpi_comm(),
6208 comm_pt->mpi_comm(),
6230 comm_pt->mpi_comm(),
6239 comm_pt->mpi_comm(),
6252 comm_pt->mpi_comm(),
6264 comm_pt->mpi_comm(),
6277 std::ostringstream error_message;
6278 error_message <<
"The number of unsigned received data ("
6280 <<
"number\nof double received data ("
6283 error_message.str(),
6284 "TriangleMesh::synchronize_boundary_coordinates()",
6411 comm_pt->mpi_comm(),
6420 comm_pt->mpi_comm(),
6432 comm_pt->mpi_comm(),
6444 comm_pt->mpi_comm(),
6461 comm_pt->mpi_comm(),
6470 comm_pt->mpi_comm(),
6482 comm_pt->mpi_comm(),
6494 comm_pt->mpi_comm(),
6507 std::ostringstream error_message;
6508 error_message <<
"The number of unsigned received data ("
6510 <<
"number\nof double received data ("
6513 error_message.str(),
6514 "TriangleMesh::synchronize_boundary_coordinates()",
6560 re_scale_re_assigned_initial_zeta_values_for_internal_boundary(b);
6570 template<
class ELEMENT>
6590 const unsigned n_regions = this->nregion();
6602 static_cast<unsigned>(this->Region_attribute[
rr]);
6606 this->nboundary_element_in_region(b,
region_id);
6622 this->boundary_element_in_region_pt(b,
region_id,
e);
6633 this->face_index_at_boundary_in_region(b,
region_id,
e);
6643 std::pair<Node*, Node*>
tmp_pair = std::make_pair(
6693 nele = this->nboundary_element(b);
6702 for (
unsigned e = 0;
e <
nele;
e++)
6717 int face_index = this->face_index_at_boundary(b,
e);
6727 std::pair<Node*, Node*>
tmp_pair = std::make_pair(
6777 std::ostringstream error_message;
6779 <<
"The independet counting of face elements (" <<
nele <<
") for "
6780 <<
"boundary (" << b <<
") is different\n"
6781 <<
"from the real number of face elements in the container ("
6785 "TriangleMesh::re_scale_re_assigned_initial_zeta_"
6786 "values_for_internal_boundary()",
6807 std::map<FiniteElement*, bool>
done_el;
6848 std::ostringstream error_message;
6850 <<
"Could not find an initial face element for the current segment\n";
6853 "TriangleMesh::re_scale_re_assigned_initial_zeta_"
6854 "values_for_internal_boundary()",
6960 std::ostringstream error_message;
6962 <<
"The number of segments is zero, but the number of nonhalo\n"
6965 "TriangleMesh::re_scale_re_assigned_initial_zeta_"
6966 "values_for_internal_boundary()",
6982 for (
unsigned is = 0;
is < nsegments;
is++)
6987 std::ostringstream error_message;
6988 error_message <<
"The (" <<
is <<
")-th segment has no elements\n";
6990 "TriangleMesh::re_scale_re_assigned_initial_zeta_"
6991 "values_for_internal_boundary()",
7030 if (this->boundary_geom_object_pt(b) != 0)
7043 for (std::list<FiniteElement*>::iterator
it =
7061 for (
unsigned j = 1;
j <
nnod;
j++)
7101 Boundary_segment_inverted[b].clear();
7102 Boundary_segment_initial_coordinate[b].clear();
7103 Boundary_segment_final_coordinate[b].clear();
7105 Boundary_segment_initial_zeta[b].clear();
7106 Boundary_segment_final_zeta[b].clear();
7108 Boundary_segment_initial_arclength[b].clear();
7109 Boundary_segment_final_arclength[b].clear();
7123 for (
unsigned is = 0;
is < nsegments;
is++)
7160 for (
unsigned i = 0;
i < 2;
i++)
7167 Boundary_segment_inverted[b].push_back(0);
7172 if (this->boundary_geom_object_pt(b) != 0)
7174 Boundary_segment_initial_zeta[b].push_back(
zeta_first[0]);
7175 Boundary_segment_final_zeta[b].push_back(
zeta_last[0]);
7180 Boundary_segment_initial_arclength[b].push_back(
zeta_first[0] *
7182 Boundary_segment_final_arclength[b].push_back(
zeta_last[0] *
7189 for (
unsigned i = 0;
i <
nele;
i++)
7198#ifdef OOMPH_HAS_TRIANGLE_LIB
7203 template<
class ELEMENT>
7269 oomph_info <<
"===================================================="
7272 oomph_info <<
"Reading the .poly file via oomph_lib \n"
7273 <<
"point's attribute and point's markers \n"
7274 <<
"are automatically set to 0" << std::endl;
7275 oomph_info <<
"===================================================="
7345 error_stream <<
"The segment marker should be provided \n"
7346 <<
"In order to assign each segment to a boundary \n "
7391 for (
unsigned i = 0;
i < 2 *
nhole;
i += 2)
7408 std::cerr <<
"Regions: " << nregion << std::endl;
7423 for (
unsigned i = 0;
i < nregion;
i++)
7436#ifdef OOMPH_HAS_TRIANGLE_LIB
7442 template<
class ELEMENT>
7447 if (this->is_mesh_distributed())
7450 const unsigned nboundary = this->nboundary();
7451 dump_file << nboundary <<
" # number of original boundaries" << std::endl;
7454 const unsigned nshared_boundaries = this->nshared_boundaries();
7455 dump_file << nshared_boundaries <<
" # number of shared boundaries"
7468 const unsigned nprocs = this->shared_boundaries_ids().
size();
7482 this->shared_boundaries_ids(
ip,
jp).
size();
7487 <<
" # number of shared boundaries with in two "
7488 <<
"processors" << std::endl;
7492 this->shared_boundaries_ids(
ip,
jp,
is);
7494 <<
" # ip jp shared_boundary of processors ip and jp"
7508 this->nshared_boundary_overlaps_internal_boundary();
7510 <<
" # number of shared boundaries that overlap internal "
7511 <<
"boundaries" << std::endl;
7519 if (this->shared_boundary_overlaps_internal_boundary(
isb))
7524 shared_boundary_overlapping_internal_boundary(
isb);
7527 <<
" # the shared boundary overlaps the internal "
7528 <<
"boundary " << std::endl;
7539 for (
unsigned b = 0; b < nboundary; b++)
7544 if (Assigned_segments_initial_zeta_values[b])
7548 dump_file <<
"1 # assigned boundary coordinates initial zeta values"
7556 this->boundary_initial_coordinate(b);
7562 <<
" # initial coordinates for the current boundary"
7567 <<
" # final coordinates for the current boundary"
7575 this->boundary_initial_zeta_coordinate(b).
size();
7579 std::ostringstream error_message;
7581 <<
"The dimension for the zeta values container is different\n"
7582 <<
"from 1, the current implementation only supports\n"
7583 <<
"one-dimensioned zeta containers\n\n";
7585 error_message.str(),
7586 "TriangleMesh::dump_distributed_info_for_restart()",
7592 this->boundary_initial_zeta_coordinate(b);
7596 <<
" # initial zeta value for the current boundary"
7600 <<
" # final zeta value for the current boundary"
7604 const unsigned nsegments = this->nboundary_segment(b);
7607 <<
" # of segments for the current boundary" << std::endl;
7610 for (
unsigned is = 0;
is < nsegments;
is++)
7614 this->boundary_segment_initial_coordinate(b)[
is];
7616 this->boundary_segment_final_coordinate(b)[
is];
7621 <<
" # initial segment coordinates for the current boundary"
7626 <<
" # final segment coordinates for the current boundary"
7631 if (this->boundary_geom_object_pt(b) != 0)
7634 this->boundary_segment_initial_zeta(b)[
is];
7636 this->boundary_segment_final_zeta(b)[
is];
7640 <<
" # initial segment zeta value for the current boundary"
7645 <<
" # final segment zeta value for the current boundary"
7651 this->boundary_segment_initial_arclength(b)[
is];
7653 this->boundary_segment_final_arclength(b)[
is];
7657 <<
" # initial segment arclength for the current boundary"
7661 <<
" # final segment arclength for the current boundary"
7673 dump_file <<
"0 # assigned boundary coordinates initial zeta values"
7685 template<
class ELEMENT>
7690 if (this->is_mesh_distributed())
7698 std::ostringstream error_message;
7700 <<
"The number of boundaries (" <<
n_boundary <<
") on the "
7701 <<
"file used for restarting is different\nfrom the number of "
7702 <<
"boundaries (" << this->nboundary() <<
") on the current "
7705 "TriangleMesh::read_distributed_info_for_restart()",
7735 if (
static_cast<int>(
n_procs) != this->communicator_pt()->
nproc())
7737 std::ostringstream error_message;
7739 <<
"The number of previously used processors (" <<
n_procs
7740 <<
") (read from the restart file) is different\nfrom the "
7741 <<
"number of current used processors ("
7742 << this->communicator_pt()->nproc() <<
")\n\n";
7744 "TriangleMesh::read_distributed_info_for_restart()",
7750 this->shared_boundaries_ids().clear();
7751 this->shared_boundary_from_processors().clear();
7752 this->shared_boundary_overlaps_internal_boundary().clear();
7756 this->shared_boundaries_ids().resize(
n_procs);
7764 this->shared_boundaries_ids(
ip).resize(
n_procs);
7811 for (
unsigned isb = 0;
7824 this->shared_boundary_overlaps_internal_boundary()
7845 Boundary_initial_coordinate[b].clear();
7846 Boundary_final_coordinate[b].clear();
7848 Boundary_initial_zeta_coordinate[b].clear();
7849 Boundary_final_zeta_coordinate[b].clear();
7852 Boundary_segment_inverted[b].clear();
7853 Boundary_segment_initial_coordinate[b].clear();
7854 Boundary_segment_final_coordinate[b].clear();
7856 Boundary_segment_initial_zeta[b].clear();
7857 Boundary_segment_final_zeta[b].clear();
7859 Boundary_segment_initial_arclength[b].clear();
7860 Boundary_segment_final_arclength[b].clear();
7901 this->boundary_initial_zeta_coordinate(b) =
zeta_initial;
7902 this->boundary_final_zeta_coordinate(b) =
zeta_final;
7911 std::ostringstream error_message;
7913 <<
"The current boundary id from the restart file ("
7915 << b <<
"currently used to re-establish the initial and\nfinal "
7916 <<
"segment's zeta values\n\n";
7918 error_message.str(),
7919 "TriangleMesh::read_distributed_info_for_restart()",
7934 for (
unsigned is = 0;
is < nsegments;
is++)
7956 this->boundary_segment_initial_coordinate(b).push_back(
7958 this->boundary_segment_final_coordinate(b).push_back(
7962 if (this->boundary_geom_object_pt(b) != 0)
7977 this->boundary_segment_initial_zeta(b).push_back(
7979 this->boundary_segment_final_zeta(b).push_back(
7997 this->boundary_segment_initial_arclength(b).push_back(
7999 this->boundary_segment_final_arclength(b).push_back(
8019 template<
class ELEMENT>
8042 int face_index = this->face_index_at_boundary(b,
e);
8066 outfile <<
"ZONE T=\"Boundary nodes" << b <<
"\"\n";
8084 for (
unsigned j = 0;
j <
n_dim;
j++)
8100 for (
unsigned j = 0;
j <
n_dim;
j++)
8105 outfile <<
"0.0" << std::endl;
8109 outfile <<
"ZONE T=\"Boundary coordinates " << b <<
"\"\n";
8119 for (
unsigned j = 0;
j <
n_dim;
j++)
8136 template<
class ELEMENT>
8147 const unsigned my_rank = this->communicator_pt()->my_rank();
8169 const unsigned nouter = this->Outer_boundary_pt.
size();
8172 const unsigned npolylines = this->Outer_boundary_pt[
i]->npolyline();
8177 this->Outer_boundary_pt[
i]->polyline_pt(
p);
8185 if (!boundary_was_splitted(
bound_id))
8198 std::ostringstream error_message;
8199 error_message <<
"The boundary (" <<
bound_id
8200 <<
") was marked to be splitted but\n"
8202 <<
") polylines to represent it.\n";
8217 std::ostringstream error_message;
8219 <<
"The current chunk (" <<
isub <<
") of the polyline with\n"
8220 <<
"boundary id (" <<
bound_id <<
") has no vertices\n";
8260 const unsigned npolylines = this->Internal_polygon_pt[
i]->npolyline();
8265 this->Internal_polygon_pt[
i]->polyline_pt(
p);
8273 if (!boundary_was_splitted(
bound_id))
8286 std::ostringstream error_message;
8287 error_message <<
"The boundary (" <<
bound_id
8288 <<
") was marked to be splitted but\n"
8290 <<
") polylines to represent it.\n";
8306 std::ostringstream error_message;
8308 <<
"The current chunk (" <<
isub <<
") of the polyline with\n"
8309 <<
"boundary id (" <<
bound_id <<
") has no vertices\n";
8350 const unsigned ncurve_section =
8351 this->Internal_open_curve_pt[
i]->ncurve_section();
8352 for (
unsigned p = 0;
p < ncurve_section;
p++)
8356 this->Internal_open_curve_pt[
i]->polyline_pt(
p);
8364 if (!boundary_was_splitted(
bound_id))
8368 if (!boundary_marked_as_shared_boundary(
bound_id, 0))
8382 std::ostringstream error_message;
8383 error_message <<
"The boundary (" <<
bound_id
8384 <<
") was marked to be splitted but\n"
8386 <<
") polylines to represent it.\n";
8398 if (!boundary_marked_as_shared_boundary(
bound_id,
isub))
8407 std::ostringstream error_message;
8409 <<
"The current chunk (" <<
isub <<
") of the polyline with\n"
8410 <<
"boundary id (" <<
bound_id <<
") has no vertices\n";
8456 const unsigned nvertex =
8457 shared_boundary_polyline_pt(
my_rank,
i,
p)->nvertex();
8461 shared_boundary_polyline_pt(
my_rank,
i,
p);
8465 if (this->nshared_boundary_overlaps_internal_boundary() > 0)
8472 if (this->shared_boundary_overlaps_internal_boundary(
shd_bnd_id))
8551 this->create_shared_polylines_connections();
8568 const unsigned n_holes = this->Internal_polygon_pt.
size();
8569 for (
unsigned h = 0; h <
n_holes; h++)
8572 this->Internal_polygon_pt[h]->internal_point();
8582 if (First_time_compute_holes_left_by_halo_elements)
8593 Original_extra_holes_coordinates = Extra_holes_coordinates;
8596 First_time_compute_holes_left_by_halo_elements =
false;
8604 Original_extra_holes_coordinates.
size();
8636 template<
class ELEMENT>
8693 std::stringstream
err;
8694 err <<
"The root curve to create a polygon from the shared and "
8695 <<
"original boundaries was not found!!!\n";
8697 "TriangleMesh::create_tmp_polygons_helper()",
8949 std::stringstream error_message;
8951 <<
"It was no possible to create a TriangleMeshPolygon with "
8952 <<
"the input set of curves\n"
8953 <<
"These are the initial and final vertices in the current "
8954 <<
"sorted list of\nTriangleMeshPolyLines\n\n";
8964 error_message <<
"TriangleMeshCurve #" <<
icurve <<
"\n"
8965 <<
"-----------------------------------\n";
8972 error_message <<
"TriangleMeshPolyLine #" <<
ip <<
"\n"
8981 "TriangleMesh::create_tmp_polygons_helper()",
9036 template<
class ELEMENT>
9053 for (
unsigned j = 0;
j <
npoly;
j++)
9076 template<
class ELEMENT>
9081 std::map<
unsigned, std::map<Node*, bool>>&
9122 const unsigned noriginal_bnd = this->initial_shared_boundary_id();
9170 std::set<FiniteElement*>::iterator
it =
9178 int face_index = this->face_index_at_boundary(
bb,
e);
9255 std::set<FiniteElement*>::iterator
it =
9263 int face_index = this->face_index_at_boundary(
bb,
e);
9364 for (std::map<
unsigned, std::list<Node*>>
::iterator it =
9372 const unsigned i_bnd_id = (*it).first;
9375 std::list<Node*>::iterator
it_list = (*it).second.begin();
9516 template<
class ELEMENT>
9520 const unsigned my_rank = this->communicator_pt()->my_rank();
9524 this->Shared_boundary_polyline_pt[
my_rank];
9629 if (boundary_marked_as_shared_boundary(
9645 if (boundary_marked_as_shared_boundary(
9678 std::stringstream
error;
9680 <<
"The current shared boundary (" <<
bound_id <<
") was "
9681 <<
"marked to have a connection\nto the left with the "
9683 <<
"The problem is that the destination boundary (possibly\n"
9684 <<
"another shared boundary) is marked to be split\n"
9685 <<
"There should not be split shared boundaries\n\n";
9688 "TriangleMesh::create_shared_polylines_connections()",
9717 get_connected_vertex_number_on_destination_polyline(
9724 std::stringstream
error;
9726 <<
"The current shared boundary (" <<
bound_id <<
") was "
9727 <<
"marked to have a connection\nto the left with the "
9729 <<
"The problem is that the left vertex of the current\n"
9730 <<
"shared boundary is not in the list of vertices of the\n"
9731 <<
"boundary to connect.\n\n"
9732 <<
"This is the left vertex of the current shared "
9736 <<
"This is the list of vertices on the destination "
9739 for (
unsigned i = 0;
i <
n_v;
i++)
9748 "TriangleMesh::create_shared_polylines_connections()",
9773 get_shared_boundaries_overlapping_internal_boundary(
9799 get_connected_vertex_number_on_destination_polyline(
9817 std::stringstream
error;
9819 <<
"The current shared boundary (" <<
bound_id <<
") was "
9820 <<
"marked to have a connection\nto the left with the "
9822 <<
"This last boundary is marked to be overlaped by "
9823 <<
"shared boundaries\n"
9824 <<
"The problem is that the left vertex of the current\n"
9825 <<
"shared boundary is not in the list of vertices of the\n"
9826 <<
"boundary to connect.\n\n"
9827 <<
"This is the left vertex of the current shared "
9831 <<
"This is the list of vertices on the destination "
9834 get_shared_boundaries_overlapping_internal_boundary(
9851 for (
unsigned i = 0;
i <
n_v;
i++)
9863 "TriangleMesh::create_shared_polylines_connections()",
9892 std::ostringstream error_message;
9895 <<
"marked to be splitted but\n"
9896 <<
"there are only (" <<
nsub_poly <<
") polylines to "
9897 <<
"represent it.\n";
9899 error_message.str(),
9900 "TriangleMesh::create_shared_polylines_connections()",
9933 get_connected_vertex_number_on_destination_polyline(
9951 std::stringstream
error;
9953 <<
"The current shared boundary (" <<
bound_id <<
") was "
9954 <<
"marked to have a connection\nto the left with the "
9956 <<
"The problem is that the left vertex of the current\n"
9957 <<
"shared boundary is not in the list of vertices of any\n"
9958 <<
"of the sub polylines that represent the boundary to\n"
9960 <<
"This is the left vertex of the current shared "
9964 <<
"This is the list of vertices on the destination "
9968 error <<
"Subpolyline #(" <<
p <<
")\n";
9971 for (
unsigned i = 0;
i <
n_v;
i++)
9981 "TriangleMesh::create_shared_polylines_connections()",
10011 get_shared_boundaries_overlapping_internal_boundary(
10041 get_connected_vertex_number_on_destination_polyline(
10069 if (!boundary_marked_as_shared_boundary(
10076 get_connected_vertex_number_on_destination_polyline(
10101 std::stringstream
error;
10103 <<
"The current shared boundary (" <<
bound_id <<
") was "
10104 <<
"marked to have a connection\nto the left with the "
10106 <<
"This last boundary is marked to be overlaped by "
10107 <<
"shared boundaries\n"
10108 <<
"The problem is that the left vertex of the current\n"
10109 <<
"shared boundary is not in the list of vertices of "
10110 <<
"the\nboundary to connect.\n\n"
10111 <<
"This is the left vertex of the current shared "
10115 <<
"This is the list of vertices on the destination "
10116 <<
"boundary (only those subpolylines not marked as "
10117 <<
"overlaped by\nshared boundaries)\n";
10120 if (!boundary_marked_as_shared_boundary(
10123 error <<
"Subpolyline #(" <<
p <<
")\n";
10126 for (
unsigned i = 0;
i <
n_v;
i++)
10135 error <<
"\nThis is the list of vertices of the shared "
10136 <<
"polylines that overlap\nthe internal "
10139 get_shared_boundaries_overlapping_internal_boundary(
10156 for (
unsigned i = 0;
i <
n_v;
i++)
10168 "TriangleMesh::create_shared_polylines_connections()",
10254 if (boundary_marked_as_shared_boundary(
10270 if (boundary_marked_as_shared_boundary(
10303 std::stringstream
error;
10305 <<
"The current shared boundary (" <<
bound_id <<
") was "
10306 <<
"marked to have a connection\nto the right with the "
10308 <<
"The problem is that the destination boundary (possibly\n"
10309 <<
"another shared boundary) is marked to be split\n"
10310 <<
"There should not be split shared boundaries\n\n";
10313 "TriangleMesh::create_shared_polylines_connections()",
10343 get_connected_vertex_number_on_destination_polyline(
10350 std::stringstream
error;
10352 <<
"The current shared boundary (" <<
bound_id <<
") was "
10353 <<
"marked to have a connection\nto the right with the "
10355 <<
"The problem is that the right vertex of the current\n"
10356 <<
"shared boundary is not in the list of vertices of the\n"
10357 <<
"boundary to connect.\n\n"
10358 <<
"This is the right vertex of the current shared "
10362 <<
"This is the list of vertices on the destination "
10365 for (
unsigned i = 0;
i <
n_v;
i++)
10374 "TriangleMesh::create_shared_polylines_connections()",
10399 get_shared_boundaries_overlapping_internal_boundary(
10425 get_connected_vertex_number_on_destination_polyline(
10443 std::stringstream
error;
10445 <<
"The current shared boundary (" <<
bound_id <<
") was "
10446 <<
"marked to have a connection\nto the right with the "
10448 <<
"This last boundary is marked to be overlaped by "
10449 <<
"shared boundaries\n"
10450 <<
"The problem is that the right vertex of the current\n"
10451 <<
"shared boundary is not in the list of vertices of the\n"
10452 <<
"boundary to connect.\n\n"
10453 <<
"This is the right vertex of the current shared "
10457 <<
"This is the list of vertices on the destination "
10460 get_shared_boundaries_overlapping_internal_boundary(
10477 for (
unsigned i = 0;
i <
n_v;
i++)
10489 "TriangleMesh::create_shared_polylines_connections()",
10518 std::ostringstream error_message;
10521 <<
"marked to be splitted but\n"
10522 <<
"there are only (" <<
nsub_poly <<
") polylines to "
10523 <<
"represent it.\n";
10525 error_message.str(),
10526 "TriangleMesh::create_shared_polylines_connections()",
10560 get_connected_vertex_number_on_destination_polyline(
10578 std::stringstream
error;
10580 <<
"The current shared boundary (" <<
bound_id <<
") was "
10581 <<
"marked to have a connection\nto the right with the "
10583 <<
"The problem is that the right vertex of the current\n"
10584 <<
"shared boundary is not in the list of vertices of any\n"
10585 <<
"of the sub polylines that represent the boundary to\n"
10587 <<
"This is the right vertex of the current shared "
10591 <<
"This is the list of vertices on the destination "
10595 error <<
"Subpolyline #(" <<
p <<
")\n";
10598 for (
unsigned i = 0;
i <
n_v;
i++)
10608 "TriangleMesh::create_shared_polylines_connections()",
10638 get_shared_boundaries_overlapping_internal_boundary(
10668 get_connected_vertex_number_on_destination_polyline(
10696 if (!boundary_marked_as_shared_boundary(
10703 get_connected_vertex_number_on_destination_polyline(
10728 std::stringstream
error;
10730 <<
"The current shared boundary (" <<
bound_id <<
") was "
10731 <<
"marked to have a connection\nto the right with the "
10733 <<
"This last boundary is marked to be overlaped by "
10734 <<
"shared boundaries\n"
10735 <<
"The problem is that the right vertex of the current\n"
10736 <<
"shared boundary is not in the list of vertices of "
10737 <<
"the\nboundary to connect.\n\n"
10738 <<
"This is the right vertex of the current shared "
10742 <<
"This is the list of vertices on the destination "
10743 <<
"boundary (only those subpolylines not marked as "
10744 <<
"overlaped by\nshared boundaries)\n";
10747 if (!boundary_marked_as_shared_boundary(
10750 error <<
"Subpolyline #(" <<
p <<
")\n";
10753 for (
unsigned i = 0;
i <
n_v;
i++)
10762 error <<
"\nThis is the list of vertices of the shared "
10763 <<
"polylines that overlap\nthe internal "
10766 get_shared_boundaries_overlapping_internal_boundary(
10783 for (
unsigned i = 0;
i <
n_v;
i++)
10795 "TriangleMesh::create_shared_polylines_connections()",
10824 template<
class ELEMENT>
10829 const unsigned n_proc = this->communicator_pt()->nproc();
10830 const unsigned my_rank = this->communicator_pt()->my_rank();
10834 std::map<FiniteElement*, bool>
done_ele;
10854 <<
"The number of shared boundaries of processor (" <<
my_rank
10857 <<
"is different from the number of shared boundaries of "
10858 <<
"processor (" <<
iproc <<
")\nwith processor (" <<
my_rank
10898 for (
unsigned d = 0; d < 2; d++)
10905 for (
unsigned d = 0; d < 2; d++)
10933 template<
class ELEMENT>
11032 const unsigned dim = 2;
11034 for (
unsigned d = 0; d <
dim; d++)
11343 template<
class ELEMENT>
11483 std::stringstream
err;
11484 err <<
"It was not possible to find a root polyline to sort the "
11485 <<
"others around it.\nThe number of unsorted and sorted "
11486 <<
"polylines is different, it means that\nnot all the "
11487 <<
"polylines have been sorted.\n"
11492 "TriangleMesh::sort_polylines_helper()",
11507 std::list<TriangleMeshPolyLine*>::iterator
it_polyline;
11527 std::stringstream
err;
11528 err <<
"The number of polylines on the unsorted and sorted vectors"
11529 <<
" is different,\n"
11530 <<
"it means that not all the polylines have been sorted.\n"
11534 "TriangleMesh::sort_polylines_helper()",
11543 template<
class ELEMENT>
11553 const unsigned nproc = comm_pt->nproc();
11554 const unsigned my_rank = comm_pt->my_rank();
11573 this->get_halo_elements_on_all_procs(
nproc,
11582 flush_shared_boundary_polyline_pt();
11583 Shared_boundary_polyline_pt.resize(
nproc);
11591 for (
unsigned e = 0;
e <
n_ele;
e++)
11607 this->create_polylines_from_halo_elements_helper(
11613 Shared_boundary_polyline_pt);
11621 template<
class ELEMENT>
11623 const unsigned&
nproc,
11641 for (
unsigned e = 0;
e <
n_ele;
e++)
11654 if ((this->Keep_all_elements_as_halos) ||
11682 std::set<unsigned>::iterator
it =
11710 template<
class ELEMENT>
11715 const unsigned nbound = this->nboundary();
11717 for (
unsigned b = 0; b <
nbound; b++)
11720 std::map<std::pair<Node*, Node*>,
bool>
edge_done;
11722 const unsigned nbound_ele = this->nboundary_element(b);
11728 int face_index = this->face_index_at_boundary(b,
e);
11739 std::pair<Node*, Node*>
edge =
11749 std::pair<Node*, Node*>
inv_edge =
11775 template<
class ELEMENT>
11784 const unsigned nproc = this->communicator_pt()->nproc();
11785 const unsigned my_rank = this->communicator_pt()->my_rank();
11816 Shared_boundaries_ids.resize(
nproc);
11817 for (
unsigned j = 0;
j <
nproc;
j++)
11822 edge_boundary[
j].resize(
nproc);
11825 Shared_boundaries_ids[
j].resize(
nproc);
11877 std::stringstream
err;
11878 err <<
"There are no halo elements from processor (" <<
jproc
11880 <<
"with processor (" <<
iproc <<
").\n"
11881 <<
"This is strange since there are halo elements from "
11882 <<
"processor (" <<
iproc <<
") with processor (" <<
jproc
11884 <<
"Number of halo elements from (" <<
iproc <<
") to ("
11886 <<
"Number of halo elements from (" <<
jproc <<
") to ("
11890 "TriangleMesh::create_polylines_from_halo_elements_helper()",
11906 std::map<std::pair<std::pair<Node*, Node*>,
FiniteElement*>,
int>
11915 std::map<std::pair<std::pair<Node*, Node*>,
FiniteElement*>,
int>
11931 std::stringstream
err;
11932 err <<
"There was a problem on the ihalo-jhalo classification.\n"
11933 <<
"One of the elements, (the one with the (" <<
e <<
")-th "
11934 <<
"index ) is not on the (" <<
jproc <<
")-th processor\n"
11935 <<
"but it was stored as a halo element of processor ("
11936 <<
iproc <<
") with processor (" <<
jproc <<
").\n";
11939 "TriangleMesh::create_polylines_from_halo_elements_helper()",
11949 std::stringstream
err;
11950 err <<
"The halo element (" <<
ih
11951 <<
") could not be casted to the "
11952 <<
"FiniteElement type.\n";
11955 "TriangleMesh::create_polylines_from_halo_elements_helper()",
11968 std::stringstream
err;
11969 err <<
"The number of nodes of the " <<
ih
11970 <<
"-th halo element is"
11971 <<
" (" <<
n_nodes <<
").\nWe can not work with triangle "
11972 <<
"elements with less than three nodes\n";
11975 "TriangleMesh::create_polylines_from_halo_elements_helper()",
11999 std::pair<Node*, Node*>
edge1 =
12003 std::pair<Node*, Node*>
edge2 =
12007 std::pair<Node*, Node*>
edge3 =
12039 std::stringstream
err;
12040 err <<
"There was a problem on the jhalo-ihalo classification.\n"
12041 <<
"One of the elements, (the one with the (" <<
e <<
")-th "
12042 <<
"index ) is not on the (" <<
iproc <<
")-th processor\n"
12043 <<
"but it was stored as a halo element of processor ("
12044 <<
jproc <<
") with processor (" <<
iproc <<
").\n";
12047 "TriangleMesh::create_polylines_from_halo_elements_helper()",
12056 std::stringstream
err;
12057 err <<
"The halo element (" <<
jh
12058 <<
") could not be casted to the "
12059 <<
"FiniteElement type.\n";
12062 "TriangleMesh::create_polylines_from_halo_elements_helper()",
12075 std::stringstream
err;
12076 err <<
"The number of nodes of the " <<
jh
12077 <<
"-th halo element is"
12078 <<
" (" <<
n_nodes <<
").\nWe can not work with triangle "
12079 <<
"elements with less than three nodes\n";
12082 "TriangleMesh::create_polylines_from_halo_elements_helper()",
12106 std::pair<Node*, Node*>
edge1 =
12110 std::pair<Node*, Node*>
edge2 =
12114 std::pair<Node*, Node*>
edge3 =
12155 std::pair<Node*, Node*>
tmp_edge =
12162 std::map<std::pair<Node*, Node*>,
unsigned>
::iterator it;
12202 std::pair<Node*, Node*>
new_edge =
12216 std::stringstream
err;
12217 err <<
"There is no associated elements with the new "
12218 <<
"shared boundary. This is an storing problem,\n"
12219 <<
"possibly related with a memory leak problem!!!\n"
12220 <<
"The nodes that compound the edge are these:\n"
12221 <<
"On processor (" <<
iproc <<
"):\n"
12225 <<
"On processor (" <<
jproc <<
"):\n"
12229 <<
"The nodes coordinates should be the same!!!\n";
12231 "TriangleMesh::create_polylines_from_"
12232 "halo_elements_helper()",
12287 std::stringstream
err;
12288 err <<
"There is no associated face indexes to the"
12289 <<
"elements that gave\nrise to the shared edge\n"
12290 <<
"The nodes that compound the edge are these:\n"
12291 <<
"On processor (" <<
iproc <<
"):\n"
12295 <<
"On processor (" <<
jproc <<
"):\n"
12299 <<
"The nodes coordinates should be the same!!!\n";
12301 "TriangleMesh::create_polylines_from_"
12302 "halo_elements_helper()",
12325 std::pair<Node*, Node*>
new_edge =
12343 std::stringstream
err;
12344 err <<
"There is no associated elements with the new "
12345 <<
"shared boundary (reversed version). This is an "
12346 <<
"storing problem, possibly related with a memory "
12347 <<
"leak problem!!!\n"
12348 <<
"The nodes that compound the edge are these:\n"
12349 <<
"On processor (" <<
iproc <<
"):\n"
12353 <<
"On processor (" <<
jproc <<
"):\n"
12357 <<
"The nodes coordinates should be the same!!!\n";
12359 "TriangleMesh::create_polylines_from_"
12360 "halo_elements_helper()",
12415 std::stringstream
err;
12416 err <<
"There is no associated face indexes to the"
12417 <<
"elements that gave\nrise to the shared edge\n"
12418 <<
"The nodes that compound the edge are these:\n"
12419 <<
"On processor (" <<
iproc <<
"):\n"
12423 <<
"On processor (" <<
jproc <<
"):\n"
12427 <<
"The nodes coordinates should be the same!!!\n";
12429 "TriangleMesh::create_polylines_from_"
12430 "halo_elements_helper()",
12470 std::map<std::pair<Node*, Node*>,
bool>
edge_done;
12496 std::stringstream error_message;
12498 <<
"The number of shared edges between processor iproc and jproc\n"
12499 <<
"is different form the number of edge elements between the\n"
12500 <<
"pair of processors\n"
12501 <<
"iproc: (" <<
iproc <<
")\n"
12502 <<
"jproc: (" <<
jproc <<
")\n"
12503 <<
"# of shared edges: (" <<
nshd_edges <<
")\n"
12506 error_message.str(),
12507 "TriangleMesh::create_polylines_from_halo_elements_helper()",
12516 std::stringstream error_message;
12518 <<
"The number of shared edges between processor iproc and jproc\n"
12519 <<
"is different form the number of edge element faces between "
12521 <<
"pair of processors\n"
12522 <<
"iproc: (" <<
iproc <<
")\n"
12523 <<
"jproc: (" <<
jproc <<
")\n"
12524 <<
"# of shared edges: (" <<
nshd_edges <<
")\n"
12527 error_message.str(),
12528 "TriangleMesh::create_polylines_from_halo_elements_helper()",
12536 std::stringstream error_message;
12538 <<
"The number of shared edges between processor iproc and jproc\n"
12539 <<
"is different form the number of edge boundaries ids between "
12541 <<
"pair of processors\n"
12542 <<
"iproc: (" <<
iproc <<
")\n"
12543 <<
"jproc: (" <<
jproc <<
")\n"
12544 <<
"# of shared edges: (" <<
nshd_edges <<
")\n"
12547 error_message.str(),
12548 "TriangleMesh::create_polylines_from_halo_elements_helper()",
12563 std::stringstream error_message;
12565 <<
"The shared edge between processor iproc and processor\n"
12566 <<
"jproc has been already visited, this is weird since the\n"
12567 <<
"edge should not be shared by other pair of processors\n"
12568 <<
"iproc: (" <<
iproc <<
")\n"
12569 <<
"jproc: (" <<
jproc <<
")\n"
12570 <<
"First node of edge: (" <<
edge.first->x(0) <<
", "
12571 <<
edge.first->x(1) <<
")\n"
12572 <<
"Second node of edge: (" <<
edge.second->x(0) <<
", "
12573 <<
edge.second->x(1) <<
")\n"
12574 <<
"Associated edge boundary id: ("
12577 error_message.str(),
12578 "TriangleMesh::create_polylines_from_halo_elements_helper()",
12585 std::pair<Node*, Node*>
rev_edge =
12586 std::make_pair(
edge.second,
edge.first);
12634 std::map<unsigned, std::map<Node*, bool>>
12644 std::pair<Node*, Node*>
edge_pair = (*it_map).first;
12651 unsigned b = (*it_map).second;
12715 std::map<std::pair<Node*, Node*>,
bool>
edge_done;
12728 std::pair<Node*, Node*>
edge;
12733 unsigned iedge = 0;
12754 std::ostringstream error_message;
12756 <<
"All the edge are already done, but the number of done\n"
12758 <<
") is still less than the total\n"
12759 <<
"number of edges (" <<
nedges <<
").\n";
12762 error_message.str(),
12763 "TriangleMesh::create_polylines_from_halo_elements_helper()",
12877 check_connections_of_polyline_nodes(
13043 check_connections_of_polyline_nodes(
13074 check_connections_of_polyline_nodes(
13133 for (std::list<FiniteElement*>::iterator
it_bnd_ele =
13167 break_loops_on_shared_polyline_helper(
13194 create_shared_polyline(
my_rank,
13246 std::ostringstream error_message;
13247 error_message <<
" The total number of unsorted polylines ("
13249 <<
") in common with\nprocessor (" <<
iproc
13250 <<
") is different from the total number of sorted "
13252 <<
") with\nthe same "
13270 template<
class ELEMENT>
13373 std::stringstream error_message;
13375 <<
"The number of sub-list of nodes created from the shared\n"
13376 <<
"polyline with loops was (" <<
n_sub_list <<
").\n"
13377 <<
"We can only handle up to three sub-list of nodes\n";
13405 std::stringstream error_message;
13408 <<
") indicates a connection\n"
13409 <<
"with the same polyline.\n However, only one sub-polyline was "
13410 <<
"found and no loop\nwas identified\n\n";
13430 std::stringstream error_message;
13433 <<
") indicates a connection\n"
13434 <<
"with the same polyline.\n However, only one sub-polyline was "
13435 <<
"found and no loop\nwas identified\n\n";
13437 error_message.str(),
13438 "TriangleMesh::break_loops_on_shared_polyline_helper()",
13873 std::stringstream error_message;
13875 <<
"The second sub-list of nodes creates a loop but this is not\n"
13876 <<
"the last list of sub-nodes.\n"
13877 <<
"This configuration is not supported\n";
13879 error_message.str(),
13880 "TriangleMesh::break_loops_on_shared_polyline_helper()",
13924 std::stringstream error_message;
13926 <<
"The connection flag to the right ("
13928 <<
"with the same polyline.\n However, the second sub-list of\n"
13929 <<
"nodes was found not making a loop so no connection with\n"
13930 <<
"itself should be marked\n\n";
13932 error_message.str(),
13933 "TriangleMesh::break_loops_on_shared_polyline_helper()",
14144 std::stringstream error_message;
14146 <<
"The connection flag to the right ("
14148 <<
"stop adding nodes'.\n However, the thrid sub-list of\n"
14149 <<
"nodes must have a connection to the right with the same\n"
14150 <<
"shared polyline or with any other polyline\n\n";
14152 error_message.str(),
14153 "TriangleMesh::break_loops_on_shared_polyline_helper()",
14158 std::stringstream error_message;
14160 <<
"The connection flag to the right ("
14162 <<
"However, the thrid sub-list of nodes must have a connection\n"
14163 <<
"to the right with the same shared polyline or with any other\n"
14166 error_message.str(),
14167 "TriangleMesh::break_loops_on_shared_polyline_helper()",
14194 template<
class ELEMENT>
14308 std::stringstream error_message;
14310 <<
"The number of sub-list of nodes created from the shared\n"
14311 <<
"polyline with loops was (" <<
n_sub_list <<
").\n"
14312 <<
"We can only handle one list which may still contain loops\n"
14313 <<
"(or repeated nodes)\n";
14315 error_message.str(),
14316 "TriangleMesh::break_loops_on_shared_polyline_load_balance_helper()",
14345 std::stringstream error_message;
14348 <<
") indicates a connection\n"
14349 <<
"with the same polyline.\n However, only one sub-polyline was "
14350 <<
"found and no loops\nwere identified\n\n";
14352 error_message.str(),
14353 "TriangleMesh::break_loops_on_shared_polyline_load_balance_helper()",
14371 std::stringstream error_message;
14374 <<
") indicates a connection\n"
14375 <<
"with the same polyline.\n However, only one sub-polyline was "
14376 <<
"found and no loops\nwere identified\n\n";
14378 error_message.str(),
14379 "TriangleMesh::break_loops_on_shared_polyline_load_balance_helper()",
14603 std::stringstream error_message;
14605 <<
"The initial and final node in the current shared polyline are not\n"
14606 <<
"the same and the number of sublists is (" <<
n_sub_list <<
").\n"
14607 <<
"We can not handle more than one sublist in the method to break\n"
14608 <<
"loops at the load balance stage\n\n";
14610 error_message.str(),
14611 "TriangleMesh::break_loops_on_shared_polyline_load_balance_helper()",
14622 template<
class ELEMENT>
14626 const unsigned&
iproc,
14627 const unsigned&
jproc,
14701 Shared_boundary_overlaps_internal_boundary[
shd_bnd_id] =
14717 std::ostringstream error_message;
14719 <<
"The number of shared boundary elements is different from the\n"
14720 <<
"number of face indexes associated to the shared boundary\n"
14722 <<
"Number of shared boundary elements: ("
14724 <<
"Number of face indexes: (" <<
n_face_index <<
")\n\n";
14726 "TriangleMesh::create_shared_polyline()",
14752 this->Boundary_curve_section_pt[
shd_bnd_id] = polyline_pt;
14776 this->Free_curve_section_pt.insert(polyline_pt);
14791 std::ostringstream error_message;
14793 <<
"The only accepted values for the connection flags are:\n"
14794 <<
"POSITIVE values or -1, any other value is rejected, please\n"
14795 <<
"check that you previously called the methods to deal with\n"
14796 <<
"other flag values\n"
14797 <<
"The current flag value for connection to the left is: ("
14800 "TriangleMesh::create_shared_polyline()",
14811 std::ostringstream error_message;
14813 <<
"The only accepted values for the connection flags are:\n"
14814 <<
"POSITIVE values or -1, any other value is rejected, please\n"
14815 <<
"check that you previously called the methods to deal with\n"
14816 <<
"other flag values\n"
14817 <<
"The current flag value for connection to the right is: ("
14820 "TriangleMesh::create_shared_polyline()",
14865 template<
class ELEMENT>
14872 const unsigned nbound = this->nboundary();
14875 const unsigned n_regions = this->nregion();
14878 for (
unsigned b = 0; b <
nbound; b++)
14883 const unsigned nbound_ele = this->nboundary_element(b);
14893 this->face_index_at_boundary(b,
e);
14907 static_cast<unsigned>(this->region_attribute(
ir));
14910 this->nboundary_element_in_region(b,
region_id);
14917 this->boundary_element_in_region_pt(b,
region_id,
e);
14921 this->face_index_at_boundary_in_region(b,
region_id,
e);
14927 this->Boundary_element_pt[b].clear();
14928 this->Face_index_at_boundary[b].clear();
14931 this->Boundary_region_element_pt[b].clear();
14932 this->Face_index_region_at_boundary[b].clear();
14954 this->Boundary_element_pt[b].push_back(
add_ele_pt);
14956 this->Face_index_at_boundary[b].push_back(face_index);
14968 static_cast<unsigned>(this->region_attribute(
ir));
14990 this->Boundary_region_element_pt[b][
region_id].push_back(
14992 const int face_index =
14994 this->Face_index_region_at_boundary[b][
region_id].push_back(
15010 this->Boundary_element_pt[b].push_back(
add_ele_pt);
15012 this->Face_index_at_boundary[b].push_back(face_index);
15022 static_cast<unsigned>(this->region_attribute(
ir));
15030 this->nboundary_element_in_region(b,
region_id);
15040 this->Face_index_region_at_boundary[b][
region_id].push_back(
15049 Lookup_for_elements_next_boundary_is_setup =
true;
15054#ifdef OOMPH_HAS_TRIANGLE_LIB
15059 template<
class ELEMENT>
15151 std::stringstream
err;
15153 <<
" doesn't match\n"
15198#ifdef OOMPH_HAS_MPI
15211 const std::pair<double, double>&
rhs)
const
15229 <<
"Dodgy \"lower left\" (lexicographic) comparison "
15230 <<
"of points with cooordinates: "
15231 <<
" lhs = ( " <<
lhs.first <<
" , " <<
lhs.second <<
" ) \n"
15232 <<
" rhs = ( " <<
rhs.first <<
" , " <<
rhs.second <<
" ) \n"
15233 <<
"x and y coordinates differ by less than tolerance!\n"
15234 <<
"diff_x = " <<
diff_x <<
"\n"
15235 <<
"diff_y = " <<
diff_y <<
"\n"
15236 <<
"Tol = " <<
Tol <<
"\n";
15242 if (
lhs.first <
rhs.first)
15293 template<
class ELEMENT>
15323 const unsigned nbnd_node = this->nshared_boundary_node(b);
15330 std::pair<double, double>
vertex =
15341 Node* node2_pt = this->shared_boundary_node_pt(b,
j_node);
15345 for (
unsigned ii = 0;
ii < 2;
ii++)
15360 warning_message <<
"Minimum distance between nodes on boundary " << b
15363 <<
" which is less than "
15364 <<
"Bottom_left_sorter.Tol = "
15366 <<
"This may screw up the ordering of the nodes on "
15367 "shared boundaries\n";
15378 this->Sorted_shared_boundary_node_pt[b].resize(
nbnd_node);
15390 this->Sorted_shared_boundary_node_pt[b][
counter++] = (*it_map).second;
15401 template<
class ELEMENT>
15409 const unsigned my_rank = this->communicator_pt()->my_rank();
15415 const unsigned initial_id = this->initial_shared_boundary_id();
15418 const unsigned final_id = this->final_shared_boundary_id();
15423 this->flush_shared_boundary_element();
15425 this->flush_face_index_at_shared_boundary();
15431 this->flush_shared_boundary_node();
15460 this->add_shared_boundary_element(b,
bnd_ele_pt);
15462 int face_index = this->face_index_at_boundary(b,
e);
15463 this->add_face_index_at_shared_boundary(b, face_index);
15469 const unsigned nboundary_node = this->nboundary_node(b);
15470 for (
unsigned n = 0;
n < nboundary_node;
n++)
15485 template<
class ELEMENT>
15489 unsigned nproc = this->communicator_pt()->nproc();
15491 unsigned my_rank = this->communicator_pt()->my_rank();
15552 const unsigned n_ele = this->nelement();
15554 if (Print_timings_level_adaptation > 1)
15560 oomph_info <<
"CPU for computing global node names and shared nodes "
15561 <<
"[n_ele=" <<
n_ele
15585 send_boundary_node_info_of_shared_nodes(
15588 if (Print_timings_level_adaptation > 1)
15593 <<
"CPU for sending info. of shared nodes on original boundaries: "
15632 for (
unsigned e = 0;
e <
n_ele;
e++)
15747 Flat_packed_unsigneds.clear();
15748 Flat_packed_doubles.clear();
15749#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
15750 Flat_packed_unsigneds_string.clear();
15762 const unsigned nel_bnd = this->nshared_boundary_element(
bnd_id);
15780 this->shared_boundary_element_pt(
bnd_id,
e);
15832#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
15833 std::stringstream
junk;
15835 Flat_packed_unsigneds_string.push_back(
junk.str());
15844 this->nroot_haloed_element(
iproc);
15856 Flat_packed_unsigneds.push_back(1);
15857#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
15858 Flat_packed_unsigneds_string.push_back(
15859 "Haloed element needs to be constructed");
15863 get_required_elemental_information_helper(
iproc,
ele_pt);
15879 Flat_packed_unsigneds.push_back(0);
15880#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
15881 Flat_packed_unsigneds_string.push_back(
15882 "Haloed element already exists");
15885#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
15886 Flat_packed_unsigneds_string.push_back(
15887 "Index of existing haloed element");
15913 Counter_for_flat_packed_doubles = 0;
15914 Counter_for_flat_packed_unsigneds = 0;
15921 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
15923#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
15925 <<
"Rec:" << Counter_for_flat_packed_unsigneds
15926 <<
" Number of elements need to be constructed "
15927 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
15936 create_halo_element(
iproc,
15953 if (Print_timings_level_adaptation > 1)
15960 oomph_info <<
"CPU for re-generating halo(ed) elements/nodes "
15961 <<
"(first stage) [n_ele=" <<
n_ele <<
"]: "
15990 if (Print_timings_level_adaptation > 1)
15997 oomph_info <<
"CPU for re-generating halo(ed) elements/nodes "
15998 <<
"(second stage) [n_ele=" <<
n_ele <<
"]: "
16009 Flat_packed_unsigneds.clear();
16010 Flat_packed_doubles.clear();
16011#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
16012 Flat_packed_unsigneds_string.clear();
16017 if (Print_timings_level_adaptation > 1)
16020 oomph_info <<
"CPU for resetting halo-haloed scheme (without "
16021 "classification of halo and haloed nodes): "
16037 if (Print_timings_level_adaptation > 1)
16040 oomph_info <<
"CPU for resetting halo-haloed scheme (with classification "
16041 "of halo and haloed nodes): "
16059 template<
class ELEMENT>
16069 const unsigned nproc = this->communicator_pt()->nproc();
16071 const unsigned my_rank = this->communicator_pt()->my_rank();
16164 unsigned index = 0;
16196 std::ostringstream error_message;
16197 error_message <<
"The index of the node on boundary ("
16199 <<
"These are the node coordinates\n"
16353 comm_pt->mpi_comm());
16416 comm_pt->mpi_comm());
16487 std::map<Vector<unsigned>,
bool>
done_name;
16547 std::ostringstream error_message;
16548 error_message <<
"The counter-part of the current name node was "
16549 <<
"not found,\nthe current node name is:\n"
16552 <<
"ishd_bnd:(" <<
node_name[2] <<
")\n"
16745 comm_pt->mpi_comm());
16763 comm_pt->mpi_comm());
16830 <<
"The info. received from root regarding the global names of "
16831 <<
"the nodes\nwas not completely read.\n"
16832 <<
"The number of data sent/received from root is: ("
16834 <<
"The number of data read from the received info. is: (" <<
counter
16951 error_stream <<
"The local node names corresponding to the local "
16953 <<
"not found on the global node names.\n\n"
16954 <<
"These are the names of the local node\n"
16955 <<
"Name k: iproc, jproc, ishd_bnd, idx. #node\n";
16967 error_stream <<
"\n\nThese are the names of the global node\n"
16968 <<
"Name k: iproc, jproc, ishd_bnd, idx. #node\n";
17055 template<
class ELEMENT>
17062 const unsigned nproc = this->communicator_pt()->nproc();
17063 const unsigned my_rank = this->communicator_pt()->my_rank();
17109 if (
i != (*it).second)
17111 std::ostringstream error_message;
17113 <<
"The global node number " << (*it).second
17114 <<
") obtained from the current node\n"
17115 <<
"name is not the same as the current node number (" <<
i
17120 <<
"shd_bnd_id:" <<
node_name[2] <<
"\n"
17129 std::ostringstream error_message;
17131 <<
"The node name is not registerd as living in this processor.\n"
17135 <<
"shd_bnd_id:" <<
node_name[2] <<
"\n"
17150 std::ostringstream error_message;
17151 error_message <<
"There is not global shared node within this\n"
17152 <<
"global node number (" <<
i
17153 <<
"). The global shared\n"
17154 <<
"node pointer is null\n\n";
17181 if (
i != (*it).second)
17183 std::ostringstream error_message;
17185 <<
"The global node number " << (*it).second
17186 <<
") obtained from the current node\n"
17187 <<
"name is not the same as the current node number (" <<
i
17192 <<
"shd_bnd_id:" <<
node_name[2] <<
"\n"
17201 std::ostringstream error_message;
17203 <<
"The node name is not registerd as living in this processor.\n"
17207 <<
"shd_bnd_id:" <<
node_name[2] <<
"\n"
17222 std::ostringstream error_message;
17223 error_message <<
"There is not global shared node within this\n"
17224 <<
"global node number (" <<
i
17225 <<
"). The global shared\n"
17226 <<
"node pointer is null\n\n";
17282 const unsigned n_bnd = this->initial_shared_boundary_id();
17305 std::map<Node*, unsigned>::iterator
it_index =
17310 std::ostringstream error_message;
17312 <<
"We could not find the global shared node index associated\n"
17313 <<
"with the node pointer with vertices coordinates:\n"
17437 comm_pt->mpi_comm(),
17446 comm_pt->mpi_comm(),
17457 comm_pt->mpi_comm(),
17474 comm_pt->mpi_comm(),
17495 comm_pt->mpi_comm(),
17504 comm_pt->mpi_comm(),
17515 comm_pt->mpi_comm(),
17532 comm_pt->mpi_comm(),
17556 std::ostringstream error_message;
17558 <<
"The number of shared nodes between the pair of processors is\n"
17559 <<
"not the same\n"
17560 <<
"N.shared nodes proc (" <<
my_rank <<
") with proc (" <<
iproc
17562 <<
"N.shared nodes proc (" <<
iproc <<
") with proc (" <<
my_rank
17564 <<
"You should have got the same error in proc: (" <<
iproc
17602 std::ostringstream error_message;
17605 <<
"could not be found in this processor!!!\n"
17606 <<
"However, it was found in processor (" <<
iproc <<
"). The "
17607 <<
"data may be no synchronised,\ntherefore "
17608 <<
"we may be looking for a global shared node number that "
17609 <<
"do not\ncorrespond with the one that was sent by "
17610 <<
"processor (" <<
iproc <<
")\n\n";
17654 template<
class ELEMENT>
17664 const unsigned nproc = this->communicator_pt()->nproc();
17665 const unsigned my_rank = this->communicator_pt()->my_rank();
17715 this->root_haloed_element_pt(
iproc);
17790 for (std::set<GeneralisedElement*>::iterator
it =
iproc_ele_pt.begin();
17799 this->root_haloed_element_pt(
iproc);
17865 Flat_packed_unsigneds.clear();
17866 Flat_packed_doubles.clear();
17867#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
17868 Flat_packed_unsigneds_string.clear();
17875#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
17876 std::stringstream
junk;
17878 Flat_packed_unsigneds_string.push_back(
junk.str());
17901 Flat_packed_unsigneds.push_back(1);
17902#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
17903 Flat_packed_unsigneds_string.push_back(
17904 "Haloed element needs to be constructed");
17908 get_required_elemental_information_helper(
iproc,
ele_pt);
17925 Flat_packed_unsigneds.push_back(0);
17926#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
17927 Flat_packed_unsigneds_string.push_back(
17928 "Haloed element already exists");
17931#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
17932 Flat_packed_unsigneds_string.push_back(
17933 "Index of existing haloed element");
17949 Counter_for_flat_packed_doubles = 0;
17950 Counter_for_flat_packed_unsigneds = 0;
17954 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
17956#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
17957 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
17958 <<
" Number of elements need to be constructed "
17959 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
17968 create_halo_element(
iproc,
17991 template<
class ELEMENT>
17993 ELEMENT>::get_required_elemental_information_helper(
unsigned&
iproc,
17997 const unsigned nbound = this->initial_shared_boundary_id();
18007 for (
unsigned b = 0; b <
nbound; b++)
18013 if (
ele_pt == this->boundary_element_pt(b,
e))
18023 std::stringstream error_message;
18025 <<
"A triangular element can not have more than two of its faces "
18026 <<
"on a boundary!!!\n\n";
18050 Flat_packed_unsigneds.push_back(1);
18051#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
18052 Flat_packed_unsigneds_string.push_back(
18053 "The element is a boundary element");
18056#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
18057 std::stringstream
junk;
18060 Flat_packed_unsigneds_string.push_back(
junk.str());
18070 Flat_packed_unsigneds.push_back(b);
18071#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
18072 std::stringstream
junk;
18073 junk <<
"Element associated to boundary " << b <<
" of "
18075 Flat_packed_unsigneds_string.push_back(
junk.str());
18078 Flat_packed_unsigneds.push_back(f);
18079#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
18080 std::stringstream
junk2;
18081 junk2 <<
"Face index " << f <<
" for associated boundary " << b;
18082 Flat_packed_unsigneds_string.push_back(
junk2.str());
18096 const unsigned n_regions = this->nregion();
18103 for (
unsigned b = 0; b <
nbound; b++)
18110 static_cast<unsigned>(this->Region_attribute[
i_reg]);
18116 this->nboundary_element_in_region(b,
region_id);
18122 this->boundary_element_in_region_pt(b,
region_id,
ee))
18137 this->face_index_at_boundary_in_region(b,
region_id,
ee));
18146 std::stringstream error_message;
18147 error_message <<
"A triangular element can not have more "
18148 "than two of its\n"
18149 <<
"faces on a boundary!!!\n\n";
18171 Flat_packed_unsigneds.push_back(1);
18172#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
18173 Flat_packed_unsigneds_string.push_back(
18174 "The element is associated to boundaries and regions");
18178#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
18179 std::stringstream
junk;
18180 junk <<
"The element is associated to "
18182 Flat_packed_unsigneds_string.push_back(
junk.str());
18192 Flat_packed_unsigneds.push_back(b);
18193#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
18194 std::stringstream
junk;
18195 junk <<
"Element associated to boundary " << b <<
" of "
18197 <<
" total associated boundaries-regions";
18198 Flat_packed_unsigneds_string.push_back(
junk.str());
18202 Flat_packed_unsigneds.push_back(
r);
18203#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
18204 std::stringstream
junk2;
18205 junk2 <<
"Element associated to region " <<
r <<
" of "
18207 <<
" total associated boundaries-regions";
18208 Flat_packed_unsigneds_string.push_back(
junk2.str());
18212 Flat_packed_unsigneds.push_back(f);
18213#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
18214 std::stringstream
junk3;
18215 junk3 <<
"Face index " << f <<
" for associated boundary-region ("
18216 << b <<
"-" <<
r <<
")";
18217 Flat_packed_unsigneds_string.push_back(
junk3.str());
18223 Flat_packed_unsigneds.push_back(0);
18224#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
18225 Flat_packed_unsigneds_string.push_back(
18226 "The element is NOT associated to boundaries and regions");
18232 Flat_packed_unsigneds.push_back(0);
18233#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
18234 Flat_packed_unsigneds_string.push_back(
18235 "The element is not associated to any original boundary");
18263 if (
ele_pt == this->shared_boundary_element_pt(
sb,
e))
18269 this->face_index_at_shared_boundary(
sb,
e));
18280 Flat_packed_unsigneds.push_back(3);
18281#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
18282 Flat_packed_unsigneds_string.push_back(
18283 "The element is a shared boundary element");
18286#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
18287 std::stringstream
junk;
18289 <<
"shared boundaries";
18290 Flat_packed_unsigneds_string.push_back(
junk.str());
18297 Flat_packed_unsigneds.push_back(b);
18298#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
18299 std::stringstream
junk;
18300 junk <<
"Element associated to shared boundary " << b <<
" of "
18302 Flat_packed_unsigneds_string.push_back(
junk.str());
18306 Flat_packed_unsigneds.push_back(f);
18307#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
18308 std::stringstream
junk2;
18309 junk2 <<
"Face index " << f <<
" for associated shared boundary " << b;
18310 Flat_packed_unsigneds_string.push_back(
junk2.str());
18316 Flat_packed_unsigneds.push_back(0);
18317#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
18318 Flat_packed_unsigneds_string.push_back(
18319 "The element is not associated to any shared boundary");
18329 template<
class ELEMENT>
18333 unsigned my_rank = this->communicator_pt()->my_rank();
18334 const unsigned nproc = this->communicator_pt()->nproc();
18340 Flat_packed_unsigneds.push_back(
n_val);
18341#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
18342 Flat_packed_unsigneds_string.push_back(
"Number of values");
18349 if (this->Time_stepper_pt != 0)
18352 n_prev = this->Time_stepper_pt->ntstorage();
18361 const unsigned n_bnd = this->initial_shared_boundary_id();
18376 Flat_packed_unsigneds.push_back(2);
18377#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
18378 Flat_packed_unsigneds_string.push_back(
18379 "Node is on the original boundaries");
18383#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
18384 std::stringstream
junk;
18386 Flat_packed_unsigneds_string.push_back(
junk.str());
18393#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
18394 std::stringstream
junk;
18397 Flat_packed_unsigneds_string.push_back(
junk.str());
18402 Flat_packed_doubles.push_back(
zeta[0]);
18408 Flat_packed_unsigneds.push_back(0);
18409#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
18410 Flat_packed_unsigneds_string.push_back(
18411 "Node is on any original boundary");
18426 if (this->is_node_on_shared_boundary(
i_bnd,
nod_pt))
18438 Flat_packed_unsigneds.push_back(1);
18439#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
18440 Flat_packed_unsigneds_string.push_back(
"Node is on shared boundary");
18451 if (this->is_node_on_shared_boundary(
i_bnd,
nod_pt))
18461#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
18462 std::stringstream
junk;
18464 Flat_packed_unsigneds_string.push_back(
junk.str());
18471#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
18472 std::stringstream
junk;
18474 Flat_packed_unsigneds_string.push_back(
junk.str());
18494 Node* shared_node_pt =
18497 if (shared_node_pt ==
nod_pt)
18513 std::ostringstream error_message;
18514 error_message <<
"The index of the node on boundary ("
18516 <<
"The node coordinates are (" <<
nod_pt->x(0) <<
","
18517 <<
nod_pt->x(1) <<
").\n";
18519 error_message.str(),
18520 "RefineableTriangleMesh::get_required_nodal_information_helper()",
18526#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
18527 std::stringstream
junk2;
18530 Flat_packed_unsigneds_string.push_back(
junk2.str());
18537 Flat_packed_unsigneds.push_back(0);
18538#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
18539 Flat_packed_unsigneds_string.push_back(
18540 "Node is not on a shared boundary");
18600 Flat_packed_unsigneds.push_back(4);
18601#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
18602 Flat_packed_unsigneds_string.push_back(
18603 "Node is on shared boundary no related with the received processor: 4");
18609 Flat_packed_unsigneds.push_back(
18611#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
18612 std::stringstream
junk;
18613 junk <<
"Number of other shared boundaries that the node is on: "
18615 Flat_packed_unsigneds_string.push_back(
junk.str());
18681 Node* shared_node_pt = sorted_shared_boundary_node_pt(
shd_bnd_id,
i);
18683 if (shared_node_pt ==
nod_pt)
18702 std::ostringstream error_message;
18703 error_message <<
"The index of the node on boundary (" <<
shd_bnd_id
18704 <<
"), shared by other processors\nwas not found.\n"
18705 <<
"The node coordinates are (" <<
nod_pt->x(0) <<
","
18706 <<
nod_pt->x(1) <<
").\n";
18708 error_message.str(),
18709 "RefineableTriangleMesh::get_required_nodal_information_helper()",
18722 std::ostringstream error_message;
18723 error_message <<
"The number of shared boundaries where the node is on "
18724 <<
"is different:\n"
18725 <<
"nshared_boundaries_with_other_processors_have_node: ("
18728 <<
"counter_shd_bnd_with_other_procs_have_node: ("
18731 error_message.str(),
18732 "RefineableTriangleMesh::get_required_nodal_information_helper()",
18742#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
18743 std::stringstream
junk1;
18744 junk1 <<
"Processor where the other shared boundary "
18746 Flat_packed_unsigneds_string.push_back(
junk1.str());
18750#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
18751 std::stringstream
junk2;
18752 junk2 <<
"Processor where the other shared boundary "
18754 Flat_packed_unsigneds_string.push_back(
junk2.str());
18758#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
18759 std::stringstream
junk3;
18760 junk3 <<
"Other shared boundary id where the node is on"
18762 Flat_packed_unsigneds_string.push_back(
junk3.str());
18765 Flat_packed_unsigneds.push_back(
indexes[
i]);
18766#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
18767 std::stringstream
junk4;
18770 Flat_packed_unsigneds_string.push_back(
junk4.str());
18778 Flat_packed_unsigneds.push_back(0);
18779#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
18780 Flat_packed_unsigneds_string.push_back(
18781 "Node is on any shared boundary with other processors");
18804 Flat_packed_unsigneds.push_back(
update_id);
18805#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
18806 Flat_packed_unsigneds_string.push_back(
"Alg Node update id");
18811 Flat_packed_unsigneds.push_back(
n_ref_val);
18812#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
18813 Flat_packed_unsigneds_string.push_back(
"Alg Node n ref values");
18822 Flat_packed_unsigneds.push_back(
n_geom_obj);
18823#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
18824 Flat_packed_unsigneds_string.push_back(
"Alg Node n geom objects");
18843#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
18844 Flat_packed_unsigneds_string.push_back(
"Found geom object");
18858 Flat_packed_doubles.push_back(
18867#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
18868 std::stringstream
junk;
18870 Flat_packed_unsigneds_string.push_back(
junk.str());
18883 Flat_packed_doubles.push_back(
nod_pt->value(
t,
i_val));
18892 Flat_packed_doubles.push_back(
nod_pt->x(
t,
idim));
18902 template<
class ELEMENT>
18914 Flat_packed_unsigneds.push_back(1);
18916#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
18917 std::stringstream
junk;
18918 junk <<
"Node needs to be constructed [size="
18919 << Flat_packed_unsigneds.size() <<
"]; last entry: "
18920 << Flat_packed_unsigneds[Flat_packed_unsigneds.size() - 1];
18921 Flat_packed_unsigneds_string.push_back(
junk.str());
18927 get_required_nodal_information_helper(
iproc,
nod_pt);
18931 Flat_packed_unsigneds.push_back(0);
18932#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
18933 std::stringstream
junk;
18934 junk <<
"Node was already added [size=" << Flat_packed_unsigneds.size()
18935 <<
"]; last entry: "
18936 << Flat_packed_unsigneds[Flat_packed_unsigneds.size() - 1];
18938 Flat_packed_unsigneds_string.push_back(
junk.str());
18944#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
18945 Flat_packed_unsigneds_string.push_back(
"haloed node index");
18954 template<
class ELEMENT>
18977 comm_pt->mpi_comm(),
18986 comm_pt->mpi_comm(),
18997 comm_pt->mpi_comm(),
19008 comm_pt->mpi_comm(),
19019#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
19024 std::ostringstream error_message;
19025 error_message <<
"The number of unsigned values to send to processor ("
19027 <<
") is different from the\nnumber of annotated strings "
19028 <<
"for the communication\n\n";
19039 comm_pt->mpi_comm(),
19048 comm_pt->mpi_comm(),
19060 comm_pt->mpi_comm(),
19062#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
19066 << Flat_packed_unsigneds_string[
i] <<
": "
19067 << Flat_packed_unsigneds[
i] << std::endl;
19079 comm_pt->mpi_comm(),
19110 template<
class ELEMENT>
19120#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
19121 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
19122 <<
" Bool: New element needs to be constructed "
19123 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
19127 if (Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++] == 1)
19167#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
19168 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
19169 <<
" Index of existing halo element "
19170 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
19175 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
19184 throw OomphLibError(
"Halo element is not a FiniteElement\n",
19198 template<
class ELEMENT>
19202#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
19203 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
19204 <<
" Bool: Element is associated to an original boundary "
19205 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
19209 if (Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++] == 1)
19211#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
19212 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
19213 <<
" How many boundaries are associated with the element "
19214 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
19218 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
19222#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
19223 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
19224 <<
" Boundary associated to the element "
19225 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
19228 const unsigned bnd =
19229 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
19231#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
19232 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
19233 <<
" Face index of the element "
19234 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
19237 const unsigned face_index =
19238 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
19242 this->Boundary_element_pt[
bnd].push_back(
ele_pt);
19243 this->Face_index_at_boundary[
bnd].push_back(face_index);
19248#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
19249 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
19250 <<
" Bool: Element is associated to a boundary-region "
19251 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
19255 if (Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++] == 1)
19257#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
19259 <<
"Rec:" << Counter_for_flat_packed_unsigneds
19260 <<
" How many boundaries-regions are associated with the element "
19261 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
19265 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
19269#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
19270 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
19271 <<
" Boundary associated to the element "
19272 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
19275 const unsigned bnd =
19276 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
19278#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
19279 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
19280 <<
" Region associated to the element "
19281 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
19285 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
19287#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
19288 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
19289 <<
" Face index of the element in boundary-region "
19290 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
19293 const unsigned face_index =
19294 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
19299 this->Face_index_region_at_boundary[
bnd][
region].push_back(
19308#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
19309 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
19310 <<
" Bool: Element is associated to a shared boundary "
19311 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
19314 if (Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++] == 3)
19316#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
19318 <<
"Rec:" << Counter_for_flat_packed_unsigneds
19319 <<
" How many shared boundaries are associated with the element "
19320 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
19324 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
19328#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
19329 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
19330 <<
" Shared boundary associated to the element "
19331 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
19334 const unsigned bnd =
19335 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
19337#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
19339 <<
"Rec:" << Counter_for_flat_packed_unsigneds
19340 <<
" Face index of the element associated to the shared boundary "
19341 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
19345 const unsigned face_index =
19346 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
19348 this->add_shared_boundary_element(
bnd,
ele_pt);
19349 this->add_face_index_at_shared_boundary(
bnd, face_index);
19359 template<
class ELEMENT>
19374#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
19375 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
19376 <<
" Bool: New node needs to be constructed "
19377 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
19380 if (Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++] == 1)
19396#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
19397 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
19398 <<
" Index of existing halo node "
19399 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
19405 [Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++]];
19415 template<
class ELEMENT>
19431#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
19432 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
19433 <<
" Number of values of external halo node "
19434 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
19437 unsigned n_val = Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
19446#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
19447 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
19448 <<
" Is the node on an original boundary "
19449 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
19455 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
19467#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
19468 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
19469 <<
" Number of boundaries the node is on: "
19470 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
19474 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
19483#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
19484 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
19485 <<
" Node is on boundary "
19486 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
19490 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
19492 Flat_packed_doubles[Counter_for_flat_packed_doubles++];
19501 std::ostringstream error_message;
19503 <<
"The current node is not on an original boundary, this should\n"
19504 <<
"be indicated by a zero flag. However, the read value for\n"
19507 error_message.str(),
19508 "RefineableTriangleMesh::construct_new_halo_node_helper()",
19517#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
19518 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
19519 <<
" Is node on shared boundary? "
19520 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
19523 const unsigned is_node_on_shared_boundary =
19524 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
19525 if (is_node_on_shared_boundary == 1)
19528#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
19529 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
19530 <<
" Number of boundaries the node is on: "
19531 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
19535 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
19540#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
19541 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
19542 <<
" Node is on boundary "
19543 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
19547 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
19551#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
19552 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
19553 <<
" Index of node on boundary "
19554 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
19559 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
19562 new_nod_pt = this->sorted_shared_boundary_node_pt(
19569 if (is_node_on_shared_boundary != 0)
19571 std::ostringstream error_message;
19573 <<
"The current node is not on a shared boundary, this should\n"
19574 <<
"be indicated by a zero flag. However, the read value for\n"
19575 <<
"that flag is (" << is_node_on_shared_boundary <<
").\n\n";
19577 error_message.str(),
19578 "RefineableTriangleMesh::construct_new_halo_node_helper()",
19586#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
19587 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
19588 <<
" Is the node on shared boundaries with other processors "
19589 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
19596 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
19610#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
19611 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
19612 <<
" In how many shared boundaries with other "
19613 <<
"processors is the node "
19614 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
19620 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
19630#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
19631 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
19632 <<
" Processor where the other shared boundary"
19634 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
19639 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
19641#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
19642 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
19643 <<
" Processor where the other shared boundary"
19645 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
19650 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
19652#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
19653 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
19654 <<
" Other shared boundary id where the node is on: "
19655 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
19661 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
19663#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
19664 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
19665 <<
" Node index on the other shared boundary "
19666 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
19672 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
19682 std::ostringstream error_message;
19684 <<
"The current node is not on a shared boundary with\n"
19685 <<
"other processors, this should be indicated by a zero flag.\n"
19686 <<
"However, the read value for that flag is ("
19689 error_message.str(),
19690 "RefineableTriangleMesh::construct_new_halo_node_helper()",
19700 if (is_node_on_shared_boundary == 1)
19800 std::map<unsigned, Node*>::iterator
it =
19832 std::ostringstream error_message;
19834 <<
"The instances of the node that was found on\n"
19835 <<
"shared boundaries with other processors (but not\n"
19836 <<
"on shared boundaries with this processor) are not\n"
19838 <<
"These are the coordinates of the instances of the\n"
19844 <<
"Dont be surprised if they are the same since the "
19845 <<
"node is\nrepeated.\n";
19859 if (is_node_on_shared_boundary == 1)
19870 std::ostringstream error_message;
19872 <<
"The pointer of the node that was found to be on a\n"
19873 <<
"shared boundary with other processor(s) and the pointer\n"
19874 <<
"of the node on shared boundary with the receiver\n"
19875 <<
"processor (iproc) are not the same. This means we have a\n"
19876 <<
"repeated node)\n"
19877 <<
"The coordinates for the nodes are:\n"
19881 <<
"Dont be surprised if they are the same since the "
19882 <<
"node is\nrepeated.\n";
19906 if (is_node_on_shared_boundary != 1)
20011#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
20012 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
20013 <<
" Alg node update id "
20014 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
20019 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
20025#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
20026 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
20027 <<
" Alg node # of ref values "
20028 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
20032 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
20040 Flat_packed_doubles[Counter_for_flat_packed_doubles++];
20050#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
20051 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
20052 <<
" Alg node # of geom objects "
20053 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
20057 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
20064#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
20065 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
20066 <<
" Alg node: geom object index "
20067 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
20071 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
20115 geom_object_vector_pt =
macro_mesh_pt->geom_object_vector_pt();
20149 if (
bnod_pt->index_of_first_value_assigned_by_face_element_pt() == 0)
20151 bnod_pt->index_of_first_value_assigned_by_face_element_pt() =
20152 new std::map<unsigned, unsigned>;
20156 std::map<unsigned, unsigned>*
map_pt =
20157 bnod_pt->index_of_first_value_assigned_by_face_element_pt();
20163 std::map<unsigned, unsigned>::const_iterator
p =
20191 Flat_packed_doubles[Counter_for_flat_packed_doubles++];
20203#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
20204 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
20205 <<
" Number of values solid node: "
20206 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
20210 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
20215 Flat_packed_doubles[Counter_for_flat_packed_doubles++];
20222 unsigned index = 0;
20234 Flat_packed_doubles[Counter_for_flat_packed_doubles++];
20253 Flat_packed_doubles[Counter_for_flat_packed_doubles++];
20285 this->update_other_proc_shd_bnd_node_helper(
new_nod_pt,
20302 template<
class ELEMENT>
20339 error_stream <<
"The node name does not exist in the global node names\n"
20340 <<
"This is the name of the node\n"
20341 <<
"Name: iproc, jproc, ishd_bnd, idx\n"
20388 <<
"Not all the node names of the current node were found on the\n"
20389 <<
"global node names. This happened when adding the node pointer\n"
20390 <<
"to the data structure that keeps tracks of nodes on shared\n"
20391 <<
"boundaries with other processors\n\n"
20392 <<
"These are the names of the current node\n"
20393 <<
"Name k: iproc, jproc, ishd_bnd, idx\n";
20402 error_stream <<
"\n\nThese are the names of the global node\n"
20403 <<
"Name k: iproc, jproc, ishd_bnd, idx\n";
20451 template<
class ELEMENT>
20455 oomph_info <<
"Load balance (unstructured mesh) [BEGIN]" << std::endl;
20459 if (!this->is_mesh_distributed())
20463 <<
"\n===============================================================\n"
20464 <<
"The load balancing can only be performed in distributed meshes,\n"
20465 <<
"your mesh has not been distributed.\n"
20466 <<
"==============================================================="
20476 const unsigned nproc = this->communicator_pt()->nproc();
20478 const unsigned my_rank = this->communicator_pt()->my_rank();
20485 <<
"\n===============================================================\n"
20486 <<
"The load balancing can only be performed when there are at least\n"
20487 <<
"two procesors, the current number of processors is one.\n"
20488 <<
"==============================================================="
20499 if (Print_timings_level_load_balance > 1)
20512 std::ostringstream error_message;
20513 error_message <<
"The number of non halo elements in the current mesh ("
20514 << nnon_halo_element() <<
") and the number\n"
20515 <<
"of target areas for the local non halo elements ("
20517 <<
") is different\n\n";
20536 if (Print_timings_level_load_balance > 1)
20600 this->root_haloed_element_pt(
iproc,
ihd);
20663 std::ostringstream error_message;
20664 error_message <<
"The independent counting of found haloed elements ("
20666 <<
") with processor (" <<
iproc
20667 <<
") is not equal to the number of haloed elements ("
20781 this->communicator_pt()->
mpi_comm());
20810 if (Print_timings_level_load_balance > 1)
20812 oomph_info <<
"CPU for getting domains halo elements (load balance) [1]: "
20829 if (Print_timings_level_load_balance > 1)
20848 this->root_halo_element_pt(
iproc);
20865 this->root_haloed_element_pt(
iproc);
20884 if (Print_timings_level_load_balance > 1)
20886 oomph_info <<
"CPU for getting finite element versions from generalised "
20887 "halo(ed) elements (load balance) [2]: "
20907 if (Print_timings_level_load_balance > 1)
20917 std::map<Data*, std::set<unsigned>>
20967 this->root_halo_element_pt(
iproc);
20999 if (Print_timings_level_load_balance > 1)
21001 oomph_info <<
"CPU for preparing elements to send to other processors "
21002 "(load balance) [3]: "
21027 if (Print_timings_level_load_balance > 1)
21097 std::set<unsigned>::iterator
it =
21164 this->root_halo_element_pt(
jproc);
21216 std::set<unsigned>::iterator
it =
21264 if (Print_timings_level_load_balance > 1)
21267 <<
"CPU for computing new local halo elements (load balance) [4]: "
21288 if (Print_timings_level_load_balance > 1)
21320 this->get_shared_boundary_elements_and_face_indexes(
21331 if (Print_timings_level_load_balance > 1)
21333 oomph_info <<
"CPU for computing new local shared boundary elements "
21334 "(load balance) [5]: "
21356 if (Print_timings_level_load_balance > 1)
21364 this->sort_nodes_on_shared_boundaries();
21453 Flat_packed_unsigneds.clear();
21454 Flat_packed_doubles.clear();
21455#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
21456 Flat_packed_unsigneds_string.clear();
21467#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
21468 std::stringstream
junk;
21469 junk <<
"Number of elements to send from processor " <<
my_rank
21471 Flat_packed_unsigneds_string.push_back(
junk.str());
21485 const unsigned index_ele = try_to_add_element_pt_load_balance(
21491 Flat_packed_unsigneds.push_back(1);
21492#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
21493 Flat_packed_unsigneds_string.push_back(
21494 "Element needs to be constructed");
21498 get_required_elemental_information_load_balance_helper(
21510 add_node_load_balance_helper(
iproc,
21520 Flat_packed_unsigneds.push_back(0);
21521#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
21522 Flat_packed_unsigneds_string.push_back(
"Element already exists");
21524 Flat_packed_unsigneds.push_back(
index_ele);
21525#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
21526 Flat_packed_unsigneds_string.push_back(
"Index of existing element");
21566 for (
unsigned e = 0;
21614 std::ostringstream error_message;
21615 error_message <<
"Was only possible to identify ("
21620 <<
"elements between\nprocessor (" <<
iproc
21621 <<
") and (" <<
jproc <<
") "
21622 <<
"when sending elements to processor (" <<
iproc
21631 Flat_packed_unsigneds.push_back(9999);
21632#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
21633 std::stringstream
junk;
21634 junk <<
"Flag for synchronisation 9999";
21635 Flat_packed_unsigneds_string.push_back(
junk.str());
21640 Flat_packed_unsigneds.push_back(
21642#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
21643 std::stringstream
junk2;
21644 junk2 <<
"Number of new local halo shared boundary elements "
21646 Flat_packed_unsigneds_string.push_back(
junk2.str());
21654 for (
unsigned e = 0;
21672 const unsigned face_index =
21678 Flat_packed_unsigneds.push_back(
ele_index);
21679#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
21680 std::stringstream
junk;
21681 junk <<
"The index of the halo shared boundary element "
21683 Flat_packed_unsigneds_string.push_back(
junk.str());
21688 Flat_packed_unsigneds.push_back(face_index);
21689#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
21690 std::stringstream
junk2;
21691 junk2 <<
"The face index of the halo shared boundary element "
21693 Flat_packed_unsigneds_string.push_back(
junk2.str());
21721 Counter_for_flat_packed_doubles = 0;
21722 Counter_for_flat_packed_unsigneds = 0;
21724#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
21725 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
21726 <<
" Number of elements need to be constructed "
21727 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
21733 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
21739 create_element_load_balance_helper(
iproc,
21773 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
21777 std::ostringstream error_message;
21778 error_message <<
"The synchronisation flag was not read, the\n"
21779 <<
"information sent between processor (" <<
my_rank
21781 <<
"and (" <<
iproc
21782 <<
")\nis no longer synchronised\n\n";
21792 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
21795 for (
unsigned e = 0;
21802 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
21805 const unsigned face_index =
21806 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
21819 .push_back(face_index);
21830 if (Print_timings_level_load_balance > 1)
21832 oomph_info <<
"CPU for sending elements to their new processors (load "
21855 if (Print_timings_level_load_balance > 1)
21897 this->get_shared_boundary_elements_and_face_indexes(
21909 this->get_shared_boundary_elements_and_face_indexes(
21922 if (Print_timings_level_load_balance > 1)
21925 <<
"CPU for computing additional shared boundaries (load balance) [7]: "
21947 if (Print_timings_level_load_balance > 1)
21995 const unsigned face_index =
22022 const unsigned face_index =
22048 const unsigned face_index =
22076 const unsigned face_index =
22109 const unsigned face_index =
22135 const unsigned face_index =
22149 if (Print_timings_level_load_balance > 1)
22151 oomph_info <<
"CPU for sorting shared boundaries (load balance) [8]: "
22174 if (Print_timings_level_load_balance > 1)
22240 if (Print_timings_level_load_balance > 1)
22243 <<
"CPU for creating new shared boundaries (load balance) [9]: "
22267 if (Print_timings_level_load_balance > 1)
22280 this->Halo_node_pt.clear();
22281 this->Root_halo_element_pt.clear();
22283 this->Haloed_node_pt.clear();
22284 this->Root_haloed_element_pt.clear();
22294 this->flush_element_storage();
22297 this->delete_all_external_storage();
22300 this->External_halo_node_pt.clear();
22301 this->External_halo_element_pt.clear();
22303 this->External_haloed_node_pt.clear();
22304 this->External_haloed_element_pt.clear();
22320 this->add_element_pt(
ele_pt);
22365 this->add_element_pt(
ele_pt);
22382 this->prune_dead_nodes();
22385 if (Print_timings_level_load_balance > 1)
22387 oomph_info <<
"CPU for deleting elements no longer belonging to this "
22388 "processor (load balance) [10]: "
22408 if (Print_timings_level_load_balance > 1)
22417 this->sort_nodes_on_shared_boundaries();
22430 const unsigned n_regions = this->nregion();
22446 static_cast<unsigned>(this->region_attribute(
rr));
22452 this->nboundary_element_in_region(
ib,
region_id);
22459 this->reset_halo_haloed_scheme();
22495 if (this->boundary_geom_object_pt(b) != 0)
22498 this->flush_boundary_segment_node(b);
22511 this->set_nboundary_segment_node(b, nsegments);
22517 if (Print_timings_level_load_balance > 1)
22520 <<
"CPU for re-establishing halo(ed) information (load balance) [11]: "
22532 if (Print_timings_level_load_balance > 1)
22534 oomph_info <<
"CPU for load balance [n_ele_before="
22541 oomph_info <<
"Load balance (unstructured mesh) [END]" << std::endl;
22549 template<
class ELEMENT>
22702 template<
class ELEMENT>
22709 const unsigned nproc = this->communicator_pt()->nproc();
22711 const unsigned my_rank = this->communicator_pt()->my_rank();
22722 if (Print_timings_level_load_balance > 2)
22779 int face_index =
static_cast<int>(
22831 std::pair<Node*, Node*>
tmp_edge =
22839 std::map<std::pair<Node*, Node*>,
unsigned>
::iterator it;
22891 if (Print_timings_level_load_balance > 2)
22893 oomph_info <<
"CPU for getting edges from shared boundary face elements "
22894 "(load balance) [9.1]: "
22918 if (Print_timings_level_load_balance > 2)
23033 unsigned index = 0;
23113 <<
"The number of face elements before sorting them starting\n"
23114 <<
"from their bottom-left vertex is different from the number\n"
23115 <<
"of face elements after the sorting\n"
23116 <<
"N. ele before sorting: (" <<
n_face_ele <<
")\n"
23120 "RefineableTriangleMesh::create_new_shared_boundaries()",
23130 if (Print_timings_level_load_balance > 2)
23132 oomph_info <<
"CPU for sorting shared boundary face elements (load "
23157 if (Print_timings_level_load_balance > 2)
23169 if (Print_timings_level_load_balance > 2)
23172 <<
"CPU for computing the valency of nodes (load balance) [9.3]: "
23192 if (Print_timings_level_load_balance > 2)
23199 std::map<unsigned, std::map<Node*, bool>>
23209 std::pair<Node*, Node*>
edge_pair = (*it_map).first;
23215 unsigned b = (*it_map).second;
23231 if (Print_timings_level_load_balance > 2)
23233 oomph_info <<
"CPU for computing nodes on non overlapped shared "
23234 "boundaries (load balance) [9.4]: "
23260 if (Print_timings_level_load_balance > 2)
23292 std::map<unsigned, std::list<Node*>>
23303 std::map<FiniteElement*, bool>
done_ele;
23434 <<
"It was not possible the found the root element\n\n";
23496 this->check_connections_of_polyline_nodes(
23520 this->check_connections_of_polyline_nodes(
23753 this->check_connections_of_polyline_nodes(
23782 this->check_connections_of_polyline_nodes(
23834 for (std::list<FiniteElement*>::iterator
it =
23846 for (std::list<FiniteElement*>::iterator
it =
23882 this->break_loops_on_shared_polyline_load_balance_helper(
23949 if (Print_timings_level_load_balance > 2)
23951 oomph_info <<
"CPU for joining shared boundary face elements (load "
23982 if (Print_timings_level_load_balance > 2)
24032 comm_pt->mpi_comm());
24079 <<
"ROOT PROCESSOR ERROR\n\n"
24080 <<
"The number of shared boundaries between processor (" <<
iproc
24081 <<
") and (" <<
jproc <<
") is not the same:\n"
24082 <<
"Shared boundaries of processor (" <<
iproc
24083 <<
") with processor (" <<
jproc <<
"): ("
24085 <<
"Shared boundaries of processor (" <<
jproc
24086 <<
") with processor (" <<
iproc <<
"): ("
24199 comm_pt->mpi_comm());
24216 comm_pt->mpi_comm());
24262 if (Print_timings_level_load_balance > 2)
24265 <<
"CPU for computing new shared boundaries ids (load balance) [9.6]: "
24288 if (Print_timings_level_load_balance > 2)
24300 this->flush_shared_boundary_polyline_pt();
24301 this->Shared_boundary_polyline_pt.resize(
nproc);
24304 this->Shared_boundaries_ids.clear();
24305 this->Shared_boundaries_ids.resize(
nproc);
24308 this->Shared_boundaries_ids[
iproc].clear();
24309 this->Shared_boundaries_ids[
iproc].resize(
nproc);
24313 this->Shared_boundary_from_processors.clear();
24314 this->Shared_boundary_overlaps_internal_boundary.clear();
24315 this->Boundary_was_splitted.clear();
24316 this->Boundary_subpolylines.clear();
24317 this->Boundary_marked_as_shared_boundary.clear();
24320 this->flush_shared_boundary_element();
24321 this->flush_face_index_at_shared_boundary();
24322 this->flush_shared_boundary_node();
24323 this->flush_sorted_shared_boundary_node();
24406 this->Shared_boundary_overlaps_internal_boundary[
shd_bnd_id] =
24465 const int face_index =
24470 this->add_face_index_at_shared_boundary(
shd_bnd_id, face_index);
24539 this->Boundary_curve_section_pt[
shd_bnd_id] = polyline_pt;
24546 this->Free_curve_section_pt.insert(polyline_pt);
24601 std::map<unsigned, unsigned>::iterator
it =
24608 std::stringstream error_message;
24610 <<
"The global shared boundary id was not found for\n"
24611 <<
"the local shared boundary shared with processor ("
24613 <<
"This processor: (" <<
my_rank <<
")\n"
24614 <<
"Boundary shared with processor: (" <<
ref_proc <<
")\n"
24615 <<
"Local shared boundary: ("
24662 std::map<unsigned, unsigned>::iterator
it =
24669 std::stringstream error_message;
24671 <<
"The global shared boundary id was not found for\n"
24672 <<
"the local shared boundary shared with processor ("
24674 <<
"This processor: (" <<
my_rank <<
")\n"
24675 <<
"Boundary shared with processor: (" <<
ref_proc <<
")\n"
24676 <<
"Local shared boundary: ("
24772 if (Print_timings_level_load_balance > 2)
24774 oomph_info <<
"CPU for creating new shared boundaries representations "
24775 "(load balance) [9.7]: "
24796 if (Print_timings_level_load_balance > 2)
24808 this->Shared_boundary_polyline_pt[
my_rank]);
24824 if (Print_timings_level_load_balance > 2)
24827 <<
"CPU for creating the new shared curves (load balance) [9.8]: "
24845 template<
class ELEMENT>
24851 const unsigned nproc = this->communicator_pt()->nproc();
24852 const unsigned my_rank = this->communicator_pt()->my_rank();
24863 std::map<Node*, Vector<Vector<unsigned>>>
node_alias;
24969 comm_pt->mpi_comm());
25036 comm_pt->mpi_comm());
25086 <<
"The read processor is different from the jproc, this is\n"
25087 <<
"a synchronisation issue. The data are not read in the\n"
25088 <<
"sameorder as the were packaged\n"
25089 <<
"Read processor: (" <<
read_jproc <<
")\n"
25090 <<
"Current jproc: (" <<
jproc <<
")\n\n";
25093 "RefineableTriangleMesh::compute_shared_node_degree_helper()",
25169 <<
"The number of data decoded in root received from others\n"
25170 <<
"processors is different from the total number of data received\n"
25174 <<
"This is a synchronisation issue so you are probably sending\n"
25175 <<
"more or less info. than the one that is being decoded\n\n";
25178 "RefineableTriangleMesh::compute_shared_node_degree_helper()",
25189 std::map<Vector<unsigned>,
bool>
alias_done;
25211 <<
"The number of nodes shared between iproc and jproc is\n"
25212 <<
"different from the number of nodes shared between jproc\n"
25214 <<
"Nodes shared between processor (" <<
iproc <<
") and "
25217 <<
"Nodes shared between processor (" <<
jproc <<
") and "
25222 "RefineableTriangleMesh::compute_shared_node_degree_helper()",
25494 <<
"The local node in processors iproc and jproc has no\n"
25495 <<
"global node assigned\n"
25496 <<
"iproc processor: (" <<
iproc <<
")\n"
25497 <<
"jproc processor: (" <<
jproc <<
")\n"
25498 <<
"Local node: (" <<
ishd <<
")\n\n";
25500 "RefineableTriangleMesh::compute_shared_"
25501 "node_degree_helper()",
25511 <<
"The local node in processors iproc and jproc has no\n"
25512 <<
"global node assigned\n"
25513 <<
"iproc processor: (" <<
iproc <<
")\n"
25514 <<
"jproc processor: (" <<
jproc <<
")\n"
25515 <<
"Local node: (" <<
jshd <<
")\n\n";
25517 "RefineableTriangleMesh::compute_shared_"
25518 "node_degree_helper()",
25523 const unsigned uleft =
25588 <<
"The local node in processors iproc and jproc has no\n"
25589 <<
"global node assigned\n"
25590 <<
"iproc processor: (" <<
iproc <<
")\n"
25591 <<
"jproc processor: (" <<
jproc <<
")\n"
25592 <<
"Local node: (" <<
ishd <<
")\n\n";
25595 "RefineableTriangleMesh::compute_shared_node_degree_helper()",
25677 comm_pt->mpi_comm());
25738 comm_pt->mpi_comm());
25790 <<
"The local node has already assigned a global degree,\n"
25791 <<
"however, a different degree for the same node has been\n"
25792 <<
"read from the data sent from root processor\n"
25793 <<
"iproc processor: (" <<
iproc <<
")\n"
25794 <<
"Local node: (" <<
ishd <<
")\n"
25795 <<
"---------------------------------------------------------\n"
25796 <<
"Already assigned degree: ("
25799 <<
"---------------------------------------------------------\n"
25800 <<
"Node coordinates: (" <<
shd_node_pt->x(0) <<
", "
25804 "RefineableTriangleMesh::compute_shared_node_degree_helper()",
25823 <<
"The number of data decoded received from root processor is\n"
25824 <<
"different from the total number of data received from the root\n"
25828 <<
"This is a synchronisation issue so you are probably sending\n"
25829 <<
"more or less info. than the one that is being decoded\n\n";
25832 "RefineableTriangleMesh::compute_shared_node_degree_helper()",
25844 template<
class ELEMENT>
25853 const unsigned nproc = this->communicator_pt()->nproc();
25854 const unsigned my_rank = this->communicator_pt()->my_rank();
25898 std::pair<double, double>
vertex =
25915 std::pair<double, double>
vertex =
26030 template<
class ELEMENT>
26062 int face_index = this->face_index_at_shared_boundary(
shd_bnd_id,
e);
26101 std::ostringstream error_message;
26104 <<
") is not the double\nof the number of unsorted nonhalo shared "
26106 <<
")\n for the current boundary (" <<
shd_bnd_id <<
")\n\n";
26108 error_message.str(),
26109 "RefineableTriangleMesh::get_shared_boundary_segment_nodes_helper()",
26117 std::ostringstream error_message;
26120 <<
") is not the double\nof the number of unsorted halo shared "
26122 <<
")\n for the current boundary (" <<
shd_bnd_id <<
")\n\n";
26124 error_message.str(),
26125 "RefineableTriangleMesh::get_shared_boundary_segment_nodes_helper()",
26195 std::ostringstream error_message;
26196 error_message <<
"The number of DONE shared boundary face elements ("
26198 <<
") is not the same\n as the sum of"
26199 <<
"the nonhalo face shared boundary elements ("
26201 <<
")\nand the halo face shared "
26204 <<
"current boundary (" <<
shd_bnd_id <<
")\n\n";
26206 error_message.str(),
26207 "RefineableTriangleMesh::get_shared_boundary_segment_nodes_helper()",
26360 template<
class ELEMENT>
26368 const unsigned nbound = this->initial_shared_boundary_id();
26371 const unsigned nproc = this->communicator_pt()->nproc();
26381 for (
unsigned b = 0; b <
nbound; b++)
26387 if (
ele_pt == this->boundary_element_pt(b,
e))
26397 std::stringstream error_message;
26399 <<
"A triangular element can not have more than two of its faces "
26400 <<
"on a boundary!!!\n\n";
26402 "RefineableTriangleMesh::get_required_"
26403 "elemental_information_helper()",
26425 Flat_packed_unsigneds.push_back(1);
26426#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
26427 Flat_packed_unsigneds_string.push_back(
26428 "The element is a boundary element");
26431#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
26432 std::stringstream
junk;
26435 Flat_packed_unsigneds_string.push_back(
junk.str());
26445 Flat_packed_unsigneds.push_back(b);
26446#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
26447 std::stringstream
junk;
26448 junk <<
"Element associated to boundary " << b <<
" of "
26450 Flat_packed_unsigneds_string.push_back(
junk.str());
26453 Flat_packed_unsigneds.push_back(f);
26454#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
26455 std::stringstream
junk2;
26456 junk2 <<
"Face index " << f <<
" for associated boundary " << b;
26457 Flat_packed_unsigneds_string.push_back(
junk2.str());
26471 const unsigned n_regions = this->nregion();
26478 for (
unsigned b = 0; b <
nbound; b++)
26485 static_cast<unsigned>(this->Region_attribute[
i_reg]);
26491 this->nboundary_element_in_region(b,
region_id);
26497 this->boundary_element_in_region_pt(b,
region_id,
ee))
26512 this->face_index_at_boundary_in_region(b,
region_id,
ee));
26521 std::stringstream error_message;
26522 error_message <<
"A triangular element can not have more "
26523 "than two of its\n"
26524 <<
"faces on a boundary!!!\n\n";
26526 "RefineableTriangleMesh::get_required_"
26527 "elemental_information_helper()",
26547 Flat_packed_unsigneds.push_back(1);
26548#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
26549 Flat_packed_unsigneds_string.push_back(
26550 "The element is associated to boundaries and regions");
26554#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
26555 std::stringstream
junk;
26556 junk <<
"The element is associated to "
26558 Flat_packed_unsigneds_string.push_back(
junk.str());
26568 Flat_packed_unsigneds.push_back(b);
26569#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
26570 std::stringstream
junk;
26571 junk <<
"Element associated to boundary " << b <<
" of "
26573 <<
" total associated boundaries-regions";
26574 Flat_packed_unsigneds_string.push_back(
junk.str());
26578 Flat_packed_unsigneds.push_back(
r);
26579#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
26580 std::stringstream
junk2;
26581 junk2 <<
"Element associated to region " <<
r <<
" of "
26583 <<
" total associated boundaries-regions";
26584 Flat_packed_unsigneds_string.push_back(
junk2.str());
26588 Flat_packed_unsigneds.push_back(f);
26589#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
26590 std::stringstream
junk3;
26591 junk3 <<
"Face index " << f <<
" for associated boundary-region ("
26592 << b <<
"-" <<
r <<
")";
26593 Flat_packed_unsigneds_string.push_back(
junk3.str());
26599 Flat_packed_unsigneds.push_back(0);
26600#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
26601 Flat_packed_unsigneds_string.push_back(
26602 "The element is NOT associated to boundaries and regions");
26608 Flat_packed_unsigneds.push_back(0);
26609#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
26610 Flat_packed_unsigneds_string.push_back(
26611 "The element is not associated to any original boundary");
26639 if (
ele_pt == this->shared_boundary_element_pt(
sb,
e))
26645 this->face_index_at_shared_boundary(
sb,
e));
26656 Flat_packed_unsigneds.push_back(3);
26657#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
26658 Flat_packed_unsigneds_string.push_back(
26659 "The element is a shared boundary element");
26662#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
26663 std::stringstream
junk;
26665 <<
"shared boundaries";
26666 Flat_packed_unsigneds_string.push_back(
junk.str());
26673 Flat_packed_unsigneds.push_back(b);
26674#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
26675 std::stringstream
junk;
26676 junk <<
"Element associated to shared boundary " << b <<
" of "
26678 Flat_packed_unsigneds_string.push_back(
junk.str());
26682 Flat_packed_unsigneds.push_back(f);
26683#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
26684 std::stringstream
junk2;
26685 junk2 <<
"Face index " << f <<
" for associated shared boundary " << b;
26686 Flat_packed_unsigneds_string.push_back(
junk2.str());
26692 Flat_packed_unsigneds.push_back(0);
26693#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
26694 Flat_packed_unsigneds_string.push_back(
26695 "The element is not associated to any shared boundary");
26732#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
26733 Flat_packed_unsigneds_string.push_back(
26734 "The number of haloed indexes the element is with processor jproc");
26739#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
26740 Flat_packed_unsigneds_string.push_back(
26741 "The haloed index of the element with jproc");
26752 template<
class ELEMENT>
26767 Flat_packed_unsigneds.push_back(1);
26769#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
26770 std::stringstream
junk;
26771 junk <<
"Node needs to be constructed [size="
26772 << Flat_packed_unsigneds.size() <<
"]; last entry: "
26773 << Flat_packed_unsigneds[Flat_packed_unsigneds.size() - 1];
26774 Flat_packed_unsigneds_string.push_back(
junk.str());
26780 get_required_nodal_information_load_balance_helper(
26785 Flat_packed_unsigneds.push_back(0);
26786#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
26787 std::stringstream
junk;
26788 junk <<
"Node was already added [size=" << Flat_packed_unsigneds.size()
26789 <<
"]; last entry: "
26790 << Flat_packed_unsigneds[Flat_packed_unsigneds.size() - 1];
26792 Flat_packed_unsigneds_string.push_back(
junk.str());
26798#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
26799 Flat_packed_unsigneds_string.push_back(
"new added node index");
26809 template<
class ELEMENT>
26816 unsigned my_rank = this->communicator_pt()->my_rank();
26817 const unsigned nproc = this->communicator_pt()->nproc();
26823 Flat_packed_unsigneds.push_back(
n_val);
26824#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
26825 Flat_packed_unsigneds_string.push_back(
"Number of values");
26832 if (this->Time_stepper_pt != 0)
26835 n_prev = this->Time_stepper_pt->ntstorage();
26844 const unsigned n_bnd = this->initial_shared_boundary_id();
26859 Flat_packed_unsigneds.push_back(2);
26860#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
26861 Flat_packed_unsigneds_string.push_back(
26862 "Node is on the original boundaries");
26866#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
26867 std::stringstream
junk;
26869 Flat_packed_unsigneds_string.push_back(
junk.str());
26876#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
26877 std::stringstream
junk;
26880 Flat_packed_unsigneds_string.push_back(
junk.str());
26885 Flat_packed_doubles.push_back(
zeta[0]);
26891 Flat_packed_unsigneds.push_back(0);
26892#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
26893 Flat_packed_unsigneds_string.push_back(
26894 "Node is on any original boundary");
26909 if (this->is_node_on_shared_boundary(
i_bnd,
nod_pt))
26921 Flat_packed_unsigneds.push_back(1);
26922#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
26923 Flat_packed_unsigneds_string.push_back(
"Node is on shared boundary");
26934 if (this->is_node_on_shared_boundary(
i_bnd,
nod_pt))
26944#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
26945 std::stringstream
junk;
26947 Flat_packed_unsigneds_string.push_back(
junk.str());
26954#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
26955 std::stringstream
junk;
26957 Flat_packed_unsigneds_string.push_back(
junk.str());
26977 Node* shared_node_pt =
26980 if (shared_node_pt ==
nod_pt)
26996 std::ostringstream error_message;
26997 error_message <<
"The index of the node on boundary ("
26999 <<
"The node coordinates are (" <<
nod_pt->x(0) <<
","
27000 <<
nod_pt->x(1) <<
").\n";
27002 error_message.str(),
27003 "RefineableTriangleMesh::get_required_nodal_information_helper()",
27009#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
27010 std::stringstream
junk2;
27013 Flat_packed_unsigneds_string.push_back(
junk2.str());
27020 Flat_packed_unsigneds.push_back(0);
27021#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
27022 Flat_packed_unsigneds_string.push_back(
27023 "Node is not on a shared boundary");
27083 Flat_packed_unsigneds.push_back(4);
27084#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
27085 Flat_packed_unsigneds_string.push_back(
27086 "Node is on shared boundary no related with the received processor: 4");
27092 Flat_packed_unsigneds.push_back(
27094#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
27095 std::stringstream
junk;
27096 junk <<
"Number of other shared boundaries that the node is on: "
27098 Flat_packed_unsigneds_string.push_back(
junk.str());
27164 Node* shared_node_pt = sorted_shared_boundary_node_pt(
shd_bnd_id,
i);
27166 if (shared_node_pt ==
nod_pt)
27185 std::ostringstream error_message;
27186 error_message <<
"The index of the node on boundary (" <<
shd_bnd_id
27187 <<
"), shared by other processors\nwas not found.\n"
27188 <<
"The node coordinates are (" <<
nod_pt->x(0) <<
","
27189 <<
nod_pt->x(1) <<
").\n";
27191 error_message.str(),
27192 "RefineableTriangleMesh::get_required_nodal_information_helper()",
27205 std::ostringstream error_message;
27206 error_message <<
"The number of shared boundaries where the node is on "
27207 <<
"is different:\n"
27208 <<
"nshared_boundaries_with_other_processors_have_node: ("
27211 <<
"counter_shd_bnd_with_other_procs_have_node: ("
27214 error_message.str(),
27215 "RefineableTriangleMesh::get_required_nodal_information_helper()",
27225#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
27226 std::stringstream
junk1;
27227 junk1 <<
"Processor where the other shared boundary "
27229 Flat_packed_unsigneds_string.push_back(
junk1.str());
27233#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
27234 std::stringstream
junk2;
27235 junk2 <<
"Processor where the other shared boundary "
27237 Flat_packed_unsigneds_string.push_back(
junk2.str());
27241#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
27242 std::stringstream
junk3;
27243 junk3 <<
"Other shared boundary id where the node is on"
27245 Flat_packed_unsigneds_string.push_back(
junk3.str());
27248 Flat_packed_unsigneds.push_back(
indexes[
i]);
27249#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
27250 std::stringstream
junk4;
27253 Flat_packed_unsigneds_string.push_back(
junk4.str());
27261 Flat_packed_unsigneds.push_back(0);
27262#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
27263 Flat_packed_unsigneds_string.push_back(
27264 "Node is on any shared boundary with other processors");
27337#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
27338 std::stringstream
junk5;
27340 <<
"elements with " <<
jproc <<
"-th processor";
27341 Flat_packed_unsigneds_string.push_back(
junk5.str());
27351#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
27352 std::stringstream
junk6;
27354 <<
") with processor (" <<
jproc <<
")";
27355 Flat_packed_unsigneds_string.push_back(
junk6.str());
27359 Flat_packed_unsigneds.push_back(
node_index);
27360#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
27361 std::stringstream
junk7;
27362 junk7 <<
"The node index on the halo element index is (" <<
node_index;
27363 Flat_packed_unsigneds_string.push_back(
junk7.str());
27400 Flat_packed_unsigneds.push_back(
update_id);
27401#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
27402 Flat_packed_unsigneds_string.push_back(
"Alg Node update id");
27407 Flat_packed_unsigneds.push_back(
n_ref_val);
27408#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
27409 Flat_packed_unsigneds_string.push_back(
"Alg Node n ref values");
27418 Flat_packed_unsigneds.push_back(
n_geom_obj);
27419#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
27420 Flat_packed_unsigneds_string.push_back(
"Alg Node n geom objects");
27439#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
27440 Flat_packed_unsigneds_string.push_back(
"Found geom object");
27454 Flat_packed_doubles.push_back(
27463#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
27464 std::stringstream
junk;
27466 Flat_packed_unsigneds_string.push_back(
junk.str());
27479 Flat_packed_doubles.push_back(
nod_pt->value(
t,
i_val));
27488 Flat_packed_doubles.push_back(
nod_pt->x(
t,
idim));
27501 template<
class ELEMENT>
27515#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
27516 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
27517 <<
" Bool: New element needs to be constructed "
27518 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
27522 if (Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++] == 1)
27539 this->add_element_load_balance_helper(
27549 add_received_node_load_balance_helper(
new_nod_pt,
27564#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
27565 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
27566 <<
" Index of existing element "
27567 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
27572 Counter_for_flat_packed_unsigneds++;
27584 template<
class ELEMENT>
27586 const unsigned&
iproc,
27592 const unsigned nproc = this->communicator_pt()->nproc();
27594#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
27595 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
27596 <<
" Bool: Element is associated to a boundary "
27597 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
27603 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
27606#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
27607 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
27608 <<
" How many boundaries are associated with the element "
27609 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
27614 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
27619#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
27620 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
27621 <<
" Boundary associated to the element "
27622 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
27627 const unsigned bnd =
27628 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
27630#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
27631 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
27632 <<
" Face index of the element "
27633 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
27638 const unsigned face_index =
27639 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
27643 this->Boundary_element_pt[
bnd].push_back(
ele_pt);
27644 this->Face_index_at_boundary[
bnd].push_back(face_index);
27649#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
27650 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
27651 <<
" Bool: Element is associated to a boundary-region "
27652 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
27657 if (Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++] == 1)
27659#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
27661 <<
"Rec:" << Counter_for_flat_packed_unsigneds
27662 <<
" How many boundaries-regions are associated with the element "
27663 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
27668 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
27672#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
27673 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
27674 <<
" Boundary associated to the element "
27675 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
27679 const unsigned bnd =
27680 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
27682#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
27683 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
27684 <<
" Region associated to the element "
27685 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
27690 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
27692#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
27693 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
27694 <<
" Face index of the element in boundary-region "
27695 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
27698 const unsigned face_index =
27699 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
27704 this->Face_index_region_at_boundary[
bnd][
region].push_back(
27717 std::ostringstream error_message;
27719 <<
"The current element is not on an original boundary, this should\n"
27720 <<
"be indicated by a zero flag. However, the read value for\n"
27723 error_message.str(),
27724 "RefineableTriangleMesh::add_element_load_balance_helper()",
27730#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
27731 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
27732 <<
" Bool: Element is associated to a shared boundary "
27733 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
27739 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
27742#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
27744 <<
"Rec:" << Counter_for_flat_packed_unsigneds
27745 <<
" How many shared boundaries are associated with the element "
27746 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
27752 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
27757#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
27758 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
27759 <<
" Shared boundary associated to the element "
27760 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
27763 const unsigned bnd =
27764 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
27766#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
27768 <<
"Rec:" << Counter_for_flat_packed_unsigneds
27769 <<
" Face index of the element associated to the shared boundary "
27770 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
27774 const unsigned face_index =
27775 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
27777 this->add_shared_boundary_element(
bnd,
ele_pt);
27778 this->add_face_index_at_shared_boundary(
bnd, face_index);
27788 std::ostringstream error_message;
27790 <<
"The current element is not on a shared boundary, this should\n"
27791 <<
"be indicated by a zero flag. However, the read value for\n"
27794 error_message.str(),
27795 "RefineableTriangleMesh::add_element_load_balance_helper()",
27807#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
27808 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
27809 <<
" Bool: Number of haloed indexes of the element with the "
27810 <<
jproc <<
" processor: "
27811 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
27816 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
27820#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
27821 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
27822 <<
" Bool: The haloed element index with the " <<
jproc
27824 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
27828 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
27841 template<
class ELEMENT>
27859#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
27860 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
27861 <<
" Bool: New node needs to be constructed "
27862 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
27865 if (Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++] == 1)
27869 construct_new_node_load_balance_helper(
new_nod_pt,
27883#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
27884 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
27885 <<
" Index of existing halo node "
27886 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
27893 [Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++]];
27905 template<
class ELEMENT>
27922 const unsigned nproc = this->communicator_pt()->nproc();
27924 const unsigned my_rank = this->communicator_pt()->my_rank();
27929#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
27930 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
27931 <<
" Number of values of external halo node "
27932 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
27935 unsigned n_val = Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
27944#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
27945 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
27946 <<
" Is the node on an original boundary "
27947 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
27953 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
27965#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
27966 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
27967 <<
" Number of boundaries the node is on: "
27968 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
27972 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
27981#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
27982 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
27983 <<
" Node is on boundary "
27984 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
27988 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
27990 Flat_packed_doubles[Counter_for_flat_packed_doubles++];
27999 std::ostringstream error_message;
28001 <<
"The current node is not on an original boundary, this should\n"
28002 <<
"be indicated by a zero flag. However, the read value for\n"
28005 error_message.str(),
28006 "RefineableTriangleMesh::construct_new_halo_node_helper()",
28015#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
28016 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
28017 <<
" Is node on shared boundary? "
28018 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
28021 const unsigned is_node_on_shared_boundary =
28022 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
28023 if (is_node_on_shared_boundary == 1)
28026#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
28027 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
28028 <<
" Number of boundaries the node is on: "
28029 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
28033 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
28038#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
28039 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
28040 <<
" Node is on boundary "
28041 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
28045 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
28049#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
28050 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
28051 <<
" Index of node on boundary "
28052 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
28057 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
28060 new_nod_pt = this->sorted_shared_boundary_node_pt(
28067 if (is_node_on_shared_boundary != 0)
28069 std::ostringstream error_message;
28071 <<
"The current node is not on a shared boundary, this should\n"
28072 <<
"be indicated by a zero flag. However, the read value for\n"
28073 <<
"that flag is (" << is_node_on_shared_boundary <<
").\n\n";
28075 error_message.str(),
28076 "RefineableTriangleMesh::construct_new_halo_node_helper()",
28084#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
28085 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
28086 <<
" Is the node on shared boundaries with other processors "
28087 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
28094 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
28108#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
28109 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
28110 <<
" In how many shared boundaries with other "
28111 <<
"processors is the node "
28112 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
28118 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
28128#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
28129 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
28130 <<
" Processor where the other shared boundary"
28132 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
28137 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
28139#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
28140 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
28141 <<
" Processor where the other shared boundary"
28143 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
28148 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
28150#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
28151 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
28152 <<
" Other shared boundary id where the node is on: "
28153 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
28159 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
28161#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
28162 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
28163 <<
" Node index on the other shared boundary "
28164 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
28170 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
28180 std::ostringstream error_message;
28182 <<
"The current node is not on a shared boundary with\n"
28183 <<
"other processors, this should be indicated by a zero flag.\n"
28184 <<
"However, the read value for that flag is ("
28187 error_message.str(),
28188 "RefineableTriangleMesh::construct_new_node_load_balance_helper()",
28206#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
28207 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
28208 <<
" The node is on "
28209 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
28210 <<
" halo elements with " <<
jproc <<
" processor"
28216 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
28229#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
28230 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
28231 <<
" The halo element index where the node is on "
28232 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
28237 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
28238#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
28239 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
28240 <<
" The node index on the halo element where the node "
28242 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
28246 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
28263 Node* haloed_node_pt = 0;
28304 std::ostringstream error_message;
28308 <<
"in the currrent processor with the " <<
iproc <<
" processor"
28309 <<
"it was found that\nthe node pointer is different from the other"
28310 <<
"instances of the node.\nIt means we have a repeated node."
28311 <<
"This are the node coordinates of the previous node instances\n"
28312 <<
"The last entry is for the just added node with a different "
28319 error_message <<
"Node: (" << (*it)->x(0) <<
", " << (*it)->x(1)
28322 error_message <<
"\n";
28324 error_message.str(),
28325 "RefineableTriangleMesh::construct_new_node_load_balance_helper()",
28359 std::map<unsigned, FiniteElement*>::iterator
it_map =
28384 std::ostringstream error_message;
28388 <<
"of the " <<
jproc <<
" processor\nwith the " <<
iproc
28389 <<
" processor, it was found that\n"
28390 <<
"the node pointer is different from the other\n"
28391 <<
"instances of the node.\nThis means we have a repeated "
28393 <<
"These are the node coordinates of the previous node "
28395 <<
"The last entry is for the just added node with a "
28397 <<
"node pointer\n";
28402 error_message <<
"Node: (" << (*it)->x(0) <<
", " << (*it)->x(1)
28405 error_message <<
"\n";
28407 "RefineableTriangleMesh::construct_new_node_"
28408 "load_balance_helper()",
28439 if (is_node_on_shared_boundary == 1 ||
28534 std::map<unsigned, Node*>::iterator
it =
28564 std::ostringstream error_message;
28566 <<
"The instances of the node that was found to be on a\n"
28567 <<
"shared boundary with other processors are not the same,\n"
28568 <<
"the coordinates for the nodes are these:\n"
28573 <<
"Not be surprised if they are the same since the node is\n"
28574 <<
"repeated!!!\n";
28576 error_message.str(),
28577 "RefineableTriangleMesh::construct_new_halo_node_helper()",
28589 if (is_node_on_shared_boundary == 1)
28596 std::ostringstream error_message;
28598 <<
"The pointer of the node that was found to be on a\n"
28599 <<
"shared boundary with other processor(s) and the pointer\n"
28600 <<
"of the node on shared boundary with the receiver\n"
28601 <<
"processor (iproc) are not the same. This means we have a\n"
28602 <<
"repeated node)\n"
28603 <<
"The coordinates for the nodes are:\n"
28607 <<
"Not to be surprised if they are the same since the node is\n"
28608 <<
"repeated!!!\n";
28610 error_message.str(),
28611 "RefineableTriangleMesh::construct_new_halo_node_helper()",
28633 if (is_node_on_shared_boundary != 1 &&
28752#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
28753 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
28754 <<
" Alg node update id "
28755 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
28760 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
28766#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
28767 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
28768 <<
" Alg node # of ref values "
28769 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
28773 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
28781 Flat_packed_doubles[Counter_for_flat_packed_doubles++];
28791#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
28792 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
28793 <<
" Alg node # of geom objects "
28794 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
28798 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
28805#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
28806 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
28807 <<
" Alg node: geom object index "
28808 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
28812 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
28863 geom_object_vector_pt =
macro_mesh_pt->geom_object_vector_pt();
28901 if (
bnod_pt->index_of_first_value_assigned_by_face_element_pt() == 0)
28903 bnod_pt->index_of_first_value_assigned_by_face_element_pt() =
28904 new std::map<unsigned, unsigned>;
28908 std::map<unsigned, unsigned>*
map_pt =
28909 bnod_pt->index_of_first_value_assigned_by_face_element_pt();
28915 std::map<unsigned, unsigned>::const_iterator
p =
28944 Flat_packed_doubles[Counter_for_flat_packed_doubles++];
28960#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION_LOAD_BALANCE
28961 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
28962 <<
" Number of values solid node: "
28963 << Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds]
28967 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
28972 Flat_packed_doubles[Counter_for_flat_packed_doubles++];
28982 unsigned index = 0;
28995 Flat_packed_doubles[Counter_for_flat_packed_doubles++];
29017 Flat_packed_doubles[Counter_for_flat_packed_doubles++];
29052 this->update_other_proc_shd_bnd_node_helper(
new_nod_pt,
29073 template<
class ELEMENT>
29091 const unsigned n_regions = this->nregion();
29102 static_cast<unsigned>(this->Region_attribute[
rr]);
29106 this->nboundary_element_in_region(b,
region_id);
29124 this->boundary_element_in_region_pt(b,
region_id,
e);
29126#ifdef OOMPH_HAS_MPI
29139 this->face_index_at_boundary_in_region(b,
region_id,
e);
29150 std::pair<Node*, Node*>
tmp_pair = std::make_pair(
29206 nel = this->nboundary_element(b);
29216 for (
unsigned e = 0;
e <
nel;
e++)
29221#ifdef OOMPH_HAS_MPI
29233 int face_index = this->face_index_at_boundary(b,
e);
29243 std::pair<Node*, Node*>
tmp_pair = std::make_pair(
29293 std::ostringstream error_message;
29295 <<
"The independet counting of face elements (" <<
nel <<
") for "
29296 <<
"boundary (" << b <<
") is different\n"
29297 <<
"from the real number of face elements in the container ("
29300 error_message.str(),
29301 "RefineableTriangleMesh::get_boundary_segment_nodes_helper()",
29322 std::map<FiniteElement*, bool>
done_ele;
29345 unsigned iface = 0;
29346#ifdef OOMPH_HAS_MPI
29347 if (this->is_mesh_distributed())
29391#ifdef OOMPH_HAS_MPI
29398 std::ostringstream error_message;
29399 error_message <<
"Could not find an initial face element for the "
29400 "current segment\n";
29402 error_message.str(),
29403 "RefineableTriangleMesh::get_boundary_segment_nodes_helper()",
29503 std::ostringstream error_message;
29505 <<
"The number of segments is zero, but the number of nonhalo\n"
29508 error_message.str(),
29509 "RefineableTriangleMesh::get_boundary_segment_nodes_helper()",
29521 for (
unsigned is = 0;
is < nsegments;
is++)
29526 std::ostringstream error_message;
29527 error_message <<
"The (" <<
is <<
")-th segment has no elements\n";
29529 error_message.str(),
29530 "RefineableTriangleMesh::get_boundary_segment_nodes_helper()",
29552 for (std::list<FiniteElement*>::iterator
it =
29583 for (
unsigned e = 0;
e <
nel;
e++)
29596 template<
class ELEMENT>
29622#ifdef OOMPH_HAS_MPI
29623 if (this->is_mesh_distributed())
29630 for (
unsigned e = 0;
e <
n;
e++)
29649 for (
unsigned e = 0;
e <
n;
e++)
29658 for (
unsigned e = 0;
e <
n;
e++)
29664 for (
unsigned e = 0;
e <
n;
e++)
29682 for (
unsigned e = 0;
e <
n;
e++)
29702 oomph_info <<
"Number of elements to be refined: " << this->Nrefined
29704 oomph_info <<
"Number of elements to be unrefined: " << this->Nunrefined
29726 const unsigned nouter = this->Outer_boundary_pt.
size();
29728 if (this->is_automatic_creation_of_vertices_on_boundaries_allowed())
29745 const unsigned nhole = this->Internal_polygon_pt.
size();
29760 this->update_open_curve_using_face_mesh(
29775#ifdef OOMPH_HAS_MPI
29781 if (this->is_mesh_distributed())
29784 if ((Nrefined > 0) || (Nunrefined > max_keep_unrefined()) ||
29802 comm_pt->mpi_comm());
29810 if ((Nrefined > 0) || (Nunrefined > max_keep_unrefined()) ||
29816 if (!((Nrefined > 0) || (Nunrefined > max_keep_unrefined())))
29823 <<
"Mesh regeneration triggered by inaccurate interface/surface\n"
29824 <<
"representation; setting Nrefined to number of elements.\n"
29825 <<
"outer_boundary_update_necessary : "
29827 <<
"inner_boundary_update_necessary : "
29829 <<
"inner_open_boundary_update_necessary: "
29831 Nrefined = nelement();
29835 oomph_info <<
"Mesh regeneration triggered by min angle criterion;\n"
29836 <<
"setting Nrefined to number of elements.\n";
29837 Nrefined = nelement();
29844#ifdef OOMPH_HAS_MPI
29849 <<
") processor(s) "
29850 <<
"that require(s)\n adaptation\n";
29865 add_vertices_for_non_deletion();
29870#ifdef OOMPH_HAS_MPI
29875 if (this->is_mesh_distributed())
29877 synchronize_shared_boundary_connections();
29890 if (this->is_automatic_creation_of_vertices_on_boundaries_allowed())
29893 unsigned nhole = this->Internal_polygon_pt.
size();
29900 this->update_polygon_using_face_mesh(
29901 this->Outer_boundary_pt[
i_outer]);
29909 this->update_open_curve_using_face_mesh(
29910 this->Internal_open_curve_pt[
i]);
29919 const unsigned ninternal = this->Internal_polygon_pt.
size();
29922 this->update_polygon_using_elements_area(
29930 this->update_polygon_using_elements_area(
29939 this->update_open_curve_using_elements_area(
29951#ifdef OOMPH_HAS_MPI
29953 if (this->is_mesh_distributed())
29956 const unsigned my_rank = this->communicator_pt()->my_rank();
29964 this->update_shared_curve_using_elements_area(
29965 this->Shared_boundary_polyline_pt[
my_rank][
nc],
29992 const unsigned n_boundary = this->nboundary();
30000#ifdef OOMPH_HAS_MPI
30003 if (this->is_mesh_distributed())
30005 this->Assigned_segments_initial_zeta_values.clear();
30018#ifdef OOMPH_HAS_MPI
30019 if (this->is_mesh_distributed())
30025 this->compute_boundary_segments_connectivity_and_initial_zeta_values(
30034 if (this->boundary_geom_object_pt(b) == 0)
30042#ifdef OOMPH_HAS_MPI
30043 if (this->is_mesh_distributed())
30048 this->synchronize_boundary_coordinates(b);
30068#ifdef OOMPH_HAS_MPI
30083 if (this->is_mesh_distributed())
30115 unsigned n_region = this->nregion();
30119 this->Regions_coordinates.begin();
30120 it != this->Regions_coordinates.end();
30131 <<
it->second[1] <<
" ";
30142 for (
unsigned n = 0;
n < 3;
n++)
30145 for (
unsigned i = 0;
i < 2;
i++)
30150 for (
unsigned i = 0;
i < 2;
i++)
30186#ifdef OOMPH_HAS_MPI
30187 if (!this->is_mesh_distributed())
30198 const unsigned n_holes = this->Internal_polygon_pt.
size();
30202 hole_pt[
i] = this->Internal_polygon_pt[
i];
30216#ifdef OOMPH_HAS_MPI
30262 this->Extra_holes_coordinates;
30266 this->Regions_coordinates;
30269 if (this->Use_attributes)
30275 if (!this->is_automatic_creation_of_vertices_on_boundaries_allowed())
30278 .disable_automatic_creation_of_vertices_on_boundaries();
30283#ifdef OOMPH_HAS_MPI
30284 if (this->is_mesh_distributed())
30308 if (Print_timings_level_adaptation > 2)
30310 oomph_info <<
"CPU for building background mesh: "
30329#ifdef OOMPH_HAS_MPI
30333 if (this->is_mesh_distributed())
30337 if (this->nshared_boundary_overlaps_internal_boundary() > 0)
30342 this->shared_boundary_overlaps_internal_boundary();
30347 this->shared_boundaries_ids();
30352 ->fill_boundary_elements_and_nodes_for_internal_boundaries();
30368 this->boundary_geom_object_pt();
30373 this->boundary_coordinate_limits();
30383#ifdef OOMPH_HAS_MPI
30384 if (this->is_mesh_distributed())
30389 ->identify_boundary_segments_and_assign_initial_zeta_values(b,
30420 if (Print_timings_level_adaptation > 2)
30422 oomph_info <<
"CPU for snapping nodes onto boundaries "
30428 if (Mesh_update_fct_pt != 0)
30468#ifdef OOMPH_HAS_CGAL
30474 cgal_params.enable_use_eulerian_coordinates_during_setup();
30484 params.enable_use_eulerian_coordinates_during_setup();
30487 bin_dim[0] = Nbin_x_for_area_transfer;
30488 bin_dim[1] = Nbin_y_for_area_transfer;
30497 unsigned nelem = this->nelement();
30498 for (
unsigned e = 0;
e <
nelem;
e++)
30503#ifndef OOMPH_HAS_CGAL
30517 "Sample point container has to be NonRefineableBinArray",
30523 unsigned n_bin = 0;
30532 <<
" nbin:(" <<
n_bin <<
")"
30533 <<
" nempty:(" <<
n_empty <<
")"
30536 <<
" average entries:("
30542 oomph_info <<
"Going into diffusion bit...\n";
30544 oomph_info <<
"Back from diffusion bit...\n";
30550 unsigned n_bin = 0;
30559 <<
" nbin:(" <<
n_bin <<
")"
30560 <<
" nempty:(" <<
n_empty <<
")"
30563 <<
" average entries:("
30589 for (
unsigned u = 0; u <
n_bin; u++)
30601 unsigned ib = (*it).first;
30639 const bool output_bins =
false;
30643 for (
unsigned u = 0; u <
length; u++)
30656#ifdef OOMPH_HAS_MPI
30696 for (
unsigned e = 0;
e <
nelem;
e++)
30705 for (
unsigned i = 0;
i < 2;
i++)
30719 Max_sample_points_for_limited_locate_zeta_during_target_area_transfer;
30726 std::stringstream error_message;
30727 error_message <<
"Limited locate zeta failed for zeta = [ "
30728 << x[0] <<
" " << x[1] <<
" ]. Makes no sense!\n";
30740 std::stringstream error_message;
30741 error_message <<
"Cast to FE for GeomObject returned by "
30742 "limited locate zeta failed for zeta = [ "
30743 << x[0] <<
" " << x[1] <<
" ]. Makes no sense!\n";
30784 std::stringstream error_message;
30785 error_message <<
"Very odd -- we're looking for a point[ " << x[0]
30786 <<
" " << x[1] <<
" ] that's not even \n"
30787 <<
"located within the bin boundaries.\n";
30789 "RefineableTriangleMesh::adapt()",
30822 for (
unsigned u = 0; u <
length; u++)
30829 oomph_info <<
"Time for loop over integration points in new mesh: "
30864 if (Print_timings_level_adaptation > 2)
30867 const unsigned n_element = this->nelement();
30871 oomph_info <<
"CPU for transfer of target areas "
30874 <<
"] (iter " <<
iter
30894#ifdef OOMPH_HAS_MPI
30919 <<
"This shouldn't happen! Element whose centroid is at "
30928 <<
" has no target area assigned\n";
30957#ifdef OOMPH_HAS_MPI
30975 if (Print_timings_level_adaptation > 2)
30978 const unsigned n_element = this->nelement();
30982 oomph_info <<
"CPU for limiting target areas "
30985 <<
"] (iter " <<
iter
30992 <<
"All area adjustments accommodated by max. permitted area"
30993 <<
" reduction \n";
30997 oomph_info <<
"NOT all area adjustments accommodated by max. "
30998 <<
"permitted area reduction \n";
31019 this->Time_stepper_pt,
31020 this->Use_attributes,
31021 this->Allow_automatic_creation_of_vertices_on_boundaries,
31022 this->communicator_pt());
31030 this->Time_stepper_pt,
31031 this->Use_attributes,
31032 this->Allow_automatic_creation_of_vertices_on_boundaries,
31033 this->communicator_pt());
31043 if (Print_timings_level_adaptation > 2)
31048 oomph_info <<
"CPU for creation of new adapted mesh "
31055#ifdef OOMPH_HAS_MPI
31066 if (this->nshared_boundary_overlaps_internal_boundary() > 0)
31070 new_mesh_pt->shared_boundary_overlaps_internal_boundary() =
31071 this->shared_boundary_overlaps_internal_boundary();
31075 new_mesh_pt->shared_boundaries_ids() = this->shared_boundaries_ids();
31080 ->fill_boundary_elements_and_nodes_for_internal_boundaries();
31093 this->boundary_geom_object_pt();
31098 this->boundary_coordinate_limits();
31112#ifdef OOMPH_HAS_MPI
31113 if (this->is_mesh_distributed())
31118 ->identify_boundary_segments_and_assign_initial_zeta_values(b,
31128 if (
new_mesh_pt->boundary_geom_object_pt(b) != 0)
31152 if (Print_timings_level_adaptation > 2)
31154 oomph_info <<
"CPU for snapping nodes onto boundaries (new mesh) "
31155 <<
"(iter " <<
iter
31160 if (Mesh_update_fct_pt != 0)
31171 new_mesh_pt->set_nodal_and_elemental_time_stepper(
31172 this->Time_stepper_pt,
false);
31173 new_mesh_pt->set_mesh_level_time_stepper(this->Time_stepper_pt,
31181#ifdef OOMPH_HAS_MPI
31201#ifdef OOMPH_HAS_MPI
31202 if (this->is_mesh_distributed())
31229 comm_pt->mpi_comm());
31234 <<
"At least one processors requires further refinement. "
31235 <<
"Go for another iteration." << std::endl;
31248 if (Print_timings_level_adaptation > 2)
31250 oomph_info <<
"CPU for waiting other processors "
31251 <<
"(iter " <<
iter
31264 oomph_info <<
"Going for another iteration. Current iteration ("
31265 <<
iter <<
")" << std::endl;
31278 oomph_info <<
"CPU for iterative generation of new mesh (TOTAL): "
31281 if (Print_timings_level_adaptation > 1)
31283 oomph_info <<
"-- CPU for creating new adapted meshes (TOTAL): "
31286 oomph_info <<
"-- CPU for limiting target areas (TOTAL): "
31289 oomph_info <<
"-- CPU for transferring target areas (TOTAL): "
31292 oomph_info <<
"-- CPU for waiting other processors (TOTAL): "
31305 if (!Disable_projection)
31311 if (Print_timings_projection)
31320 oomph_info <<
"About to begin projection.\n";
31329#ifdef OOMPH_HAS_MPI
31330 if (this->is_mesh_distributed())
31353 if (!this->use_iterative_solver_for_projection())
31379 if (!this->use_iterative_solver_for_projection())
31389 if (Print_timings_projection)
31401 if (Print_timings_level_adaptation > 1)
31404 const unsigned n_element = this->nelement();
31407 oomph_info <<
"CPU for projection (in mesh adaptation) "
31415#ifdef OOMPH_HAS_MPI
31416 if (this->is_mesh_distributed())
31429 this->communicator_pt()->
mpi_comm());
31443 this->communicator_pt()->
mpi_comm());
31450 this->communicator_pt()->
mpi_comm());
31452 if (this->communicator_pt()->
my_rank() == 0)
31454 oomph_info <<
"CPU for projection global (MIN): "
31456 oomph_info <<
"CPU for projection global (MAX) "
31460 std::cerr <<
"CPU for projection global (MIN): "
31462 std::cerr <<
"CPU for projection global (MAX): "
31474 oomph_info <<
"CPU for projection of solution onto new mesh: "
31483 oomph_info <<
"Projection disabled! The new mesh will contain zeros"
31495 for (
unsigned j =
nnod;
j > 0;
j--)
31500 unsigned nel = nelement();
31501 for (
unsigned e =
nel;
e > 0;
e--)
31503 delete Element_pt[
e - 1];
31504 Element_pt[
e - 1] = 0;
31512 Element_pt.resize(
nel);
31513 for (
unsigned j = 0;
j <
nnod;
j++)
31517 for (
unsigned e = 0;
e <
nel;
e++)
31526#ifdef OOMPH_HAS_MPI
31530 if (this->is_mesh_distributed())
31547 Boundary_element_pt.resize(
nbound);
31548 Face_index_at_boundary.resize(
nbound);
31549 Boundary_node_pt.resize(
nbound);
31550 for (
unsigned b = 0; b <
nbound; b++)
31553 Boundary_element_pt[b].resize(
nel);
31554 Face_index_at_boundary[b].resize(
nel);
31555 for (
unsigned e = 0;
e <
nel;
e++)
31557 Boundary_element_pt[b][
e] =
new_mesh_pt->boundary_element_pt(b,
e);
31558 Face_index_at_boundary[b][
e] =
31562 Boundary_node_pt[b].resize(
nnod);
31563 for (
unsigned j = 0;
j <
nnod;
j++)
31565 Boundary_node_pt[b][
j] =
new_mesh_pt->boundary_node_pt(b,
j);
31575 this->Region_attribute.resize(
n_region);
31578 this->Region_attribute[
r] =
new_mesh_pt->region_attribute(
r);
31580 unsigned r_id =
static_cast<unsigned>(this->Region_attribute[
r]);
31586 this->Region_element_pt[
r_id][
e] =
31592 this->Boundary_region_element_pt.resize(
nbound);
31593 this->Face_index_region_at_boundary.resize(
nbound);
31596 for (
unsigned b = 0; b <
nbound; ++b)
31601 unsigned r =
static_cast<unsigned>(this->Region_attribute[
rr]);
31609 this->Boundary_region_element_pt[b][
r].resize(
31611 this->Face_index_region_at_boundary[b][
r].resize(
31617 this->Boundary_region_element_pt[b][
r][
e] =
31619 this->Face_index_region_at_boundary[b][
r][
e] =
31633#ifdef OOMPH_HAS_MPI
31634 if (this->is_mesh_distributed())
31639 if (this->is_mesh_distributed())
31641 this->Halo_node_pt.clear();
31642 this->Root_halo_element_pt.clear();
31644 this->Haloed_node_pt.clear();
31645 this->Root_haloed_element_pt.clear();
31647 this->External_halo_node_pt.clear();
31648 this->External_halo_element_pt.clear();
31650 this->External_haloed_node_pt.clear();
31651 this->External_haloed_element_pt.clear();
31656 this->reset_shared_boundary_elements_and_nodes();
31667 this->shared_boundaries_in_this_processor(
31680 this->Boundary_element_pt[
shd_bnd_id].clear();
31698 this->sort_nodes_on_shared_boundaries();
31701 this->reset_halo_haloed_scheme();
31707 if (this->boundary_geom_object_pt(b) != 0)
31709 const unsigned nsegments =
new_mesh_pt->nboundary_segment(b);
31710 this->set_nboundary_segment_node(b, nsegments);
31727 this->snap_nodes_onto_geometric_objects();
31730 this->Oomph_vertex_nodes_id =
new_mesh_pt->oomph_vertex_nodes_id();
31735 this->Triangulateio =
31746 if (Print_timings_level_adaptation > 2)
31750 oomph_info <<
"CPU for segments connectivity (first stage) [sec]: "
31752 oomph_info <<
"CPU for segments connectivity (second stage) [sec]: "
31754 oomph_info <<
"CPU for segments connectivity (third stage) [sec]: "
31758 if (Print_timings_level_adaptation > 1)
31765 oomph_info <<
"CPU for segments connectivity (TOTAL) [sec]: "
31768 if (Print_timings_level_adaptation > 2)
31771 oomph_info <<
"CPU for snapping nodes onto boundaries "
31776 oomph_info <<
"CPU for snapping nodes onto boundaries (TOTAL): "
31787 oomph_info <<
"CPU time for final bits [sec]: "
31792 oomph_info <<
"Not enough benefit in adaptation.\n";
31804#ifdef OOMPH_HAS_MPI
31805 if (this->is_mesh_distributed())
31810 const unsigned n_proc = comm_pt->nproc();
31811 if (Print_timings_level_adaptation > 1 &&
n_proc > 1)
31824 comm_pt->mpi_comm());
31831 comm_pt->mpi_comm());
31838 comm_pt->mpi_comm());
31841 const unsigned my_rank = comm_pt->my_rank();
31848 oomph_info <<
"CPU for adaptation (AVERAGE): "
31868 template<
class ELEMENT>
31873 Boundary_connections_pt.clear();
32024 this->Internal_open_curve_pt[
i];
32082#ifdef OOMPH_HAS_MPI
32089 if (this->is_mesh_distributed())
32092 const unsigned my_rank = this->communicator_pt()->my_rank();
32110 this->shared_boundary_polyline_pt(
my_rank,
i,
p);
32174 const unsigned bnd_id = (*it);
32175#ifdef OOMPH_HAS_MPI
32177 if (this->is_mesh_distributed())
32275 add_non_delete_vertices_from_boundary_helper(
32304 add_non_delete_vertices_from_boundary_helper(
32354 add_non_delete_vertices_from_boundary_helper(
32383 add_non_delete_vertices_from_boundary_helper(
32400 this->Internal_open_curve_pt[
i];
32438 add_non_delete_vertices_from_boundary_helper(
32467 add_non_delete_vertices_from_boundary_helper(
32476#ifdef OOMPH_HAS_MPI
32483 if (this->is_mesh_distributed())
32486 const unsigned my_rank = this->communicator_pt()->my_rank();
32504 this->shared_boundary_polyline_pt(
my_rank,
i,
p);
32530 add_non_delete_vertices_from_boundary_helper(
32559 add_non_delete_vertices_from_boundary_helper(
32578 template<
class ELEMENT>
32659#ifdef OOMPH_HAS_MPI
32665 template<
class ELEMENT>
32667 ELEMENT>::synchronize_shared_boundary_connections()
32670 const unsigned nproc = this->communicator_pt()->nproc();
32672 const unsigned my_rank = this->communicator_pt()->my_rank();
32832 comm_pt->mpi_comm(),
32841 comm_pt->mpi_comm(),
32854 comm_pt->mpi_comm(),
32867 comm_pt->mpi_comm(),
32885 comm_pt->mpi_comm(),
32894 comm_pt->mpi_comm(),
32907 comm_pt->mpi_comm(),
32920 comm_pt->mpi_comm(),
33041 template<
class ELEMENT>
33097 restore_polyline_connections_helper(
33144 restore_polyline_connections_helper(
33166 template<
class ELEMENT>
33201 restore_polyline_connections_helper(
33232 restore_polyline_connections_helper(
33253 this->Internal_open_curve_pt[
i];
33268 restore_polyline_connections_helper(
33286 template<
class ELEMENT>
33312#ifdef OOMPH_HAS_MPI
33313 if (this->is_mesh_distributed())
33322 std::ostringstream error_message;
33324 <<
"INITIAL VERTEX CONNECTION\n"
33325 <<
"The current original boundary is trying to connect to a\n"
33326 <<
"shared boundary, this is not allowed. In this case the\n"
33327 <<
"shared boundary should be the one that connects with the\n"
33328 <<
"original boundary\n"
33329 <<
"The current original boundary (" <<
bnd_id <<
") is marked\n"
33330 <<
"to have a connection at the\nINITIAL vertex ("
33334 <<
"This is the list of vertices on the shared destination "
33350 error_message.str(),
33351 "RefineableTriangleMesh::restore_polyline_connections_helper()",
33380#ifdef OOMPH_HAS_MPI
33381 if (this->is_mesh_distributed())
33462 this->get_connected_vertex_number_on_destination_polyline(
33478#ifdef OOMPH_HAS_MPI
33493 std::ostringstream error_message;
33495 <<
"marked to be splitted but\n"
33496 <<
"there are only (" <<
nsub_poly <<
") polylines to "
33497 <<
"represent it.\n";
33499 error_message.str(),
33500 "RefineableTriangleMesh::restore_polyline_connections_helper()",
33526 this->get_connected_vertex_number_on_destination_polyline(
33565 this->get_connected_vertex_number_on_destination_polyline(
33593#ifdef OOMPH_HAS_MPI
33594 if (this->is_mesh_distributed())
33617 std::ostringstream error_message;
33619 <<
"INITIAL VERTEX CONNECTION\n"
33620 <<
"It was not possible to find the associated "
33621 <<
"vertex number on the destination boundary\n"
33622 <<
"The current boundary (" <<
bnd_id <<
") is marked to have"
33623 <<
"a connection at the\nINITIAL vertex ("
33627 <<
"This is the list of vertices on the destination boundary\n";
33642 error_message.str(),
33643 "RefineableTriangleMesh::restore_polyline_connections_helper()",
33681#ifdef OOMPH_HAS_MPI
33682 if (this->is_mesh_distributed())
33691 std::ostringstream error_message;
33693 <<
"FINAL VERTEX CONNECTION\n"
33694 <<
"The current original boundary is trying to connect to a\n"
33695 <<
"shared boundary, this is not allowed. In this case the\n"
33696 <<
"shared boundary should be the one that connects with the\n"
33697 <<
"original boundary\n"
33698 <<
"The current boundary (" <<
bnd_id <<
") is marked to have "
33699 <<
"a connection at the\nFINAL vertex ("
33703 <<
"This is the list of vertices on the destination boundary\n";
33718 error_message.str(),
33719 "RefineableTriangleMesh::restore_polyline_connections_helper()",
33748#ifdef OOMPH_HAS_MPI
33749 if (this->is_mesh_distributed())
33829 this->get_connected_vertex_number_on_destination_polyline(
33845#ifdef OOMPH_HAS_MPI
33860 std::ostringstream error_message;
33862 <<
"marked to be splitted but\n"
33863 <<
"there are only (" <<
nsub_poly <<
") polylines to "
33864 <<
"represent it.\n";
33866 error_message.str(),
33867 "RefineableTriangleMesh::restore_polyline_connections_helper()",
33893 this->get_connected_vertex_number_on_destination_polyline(
33932 this->get_connected_vertex_number_on_destination_polyline(
33960#ifdef OOMPH_HAS_MPI
33961 if (this->is_mesh_distributed())
33984 std::ostringstream error_message;
33986 <<
"FINAL VERTEX CONNECTION\n"
33987 <<
"It was not possible to find the associated "
33988 <<
"vertex number on the destination boundary\n"
33989 <<
"The current boundary (" <<
bnd_id <<
") is marked to have "
33990 <<
"a connection at the\nFINAL vertex ("
33994 <<
"This is the list of vertices on the destination boundary\n";
34009 error_message.str(),
34010 "RefineableTriangleMesh::restore_polyline_connections_helper()",
34038 template<
class ELEMENT>
34081 template<
class ELEMENT>
34086 unsigned& vertex_number)
34128 template<
class ELEMENT>
34138 if (this->is_mesh_distributed() && !
check_only)
34140 std::stringstream error_message;
34142 <<
"The updating of polygons of a distributed mesh can ONLY be\n"
34143 <<
"performed using the element's area associated to the halo(ed)\n"
34145 <<
"1) Make sure you have enabled the parallel mesh adaptation\n"
34146 <<
"option if you are working with a distributed mesh, OR\n"
34147 <<
"2) Make sure to call the update_..._using_elements_area() methods\n"
34148 <<
"if the mesh is marked as distributed\n\n";
34194#ifdef OOMPH_HAS_MPI
34211 for (
unsigned i = 0;
i < 2;
i++)
34225 for (
unsigned i = 0;
i < 2;
i++)
34235 unsigned count = 0;
34252 double unrefinement_tolerance =
34253 polygon_pt->polyline_pt(
p)->unrefinement_tolerance();
34258 if (unrefinement_tolerance > 0.0 &&
n_vertex >= 3)
34263 unrefinement_tolerance,
34290 double refinement_tolerance =
34291 polygon_pt->polyline_pt(
p)->refinement_tolerance();
34292 if (refinement_tolerance > 0.0 &&
n_vertex >= 2)
34296 refinement_tolerance,
34324 double maximum_length =
polygon_pt->polyline_pt(
p)->maximum_length();
34325 if (maximum_length > 0.0 &&
n_vertex >= 2)
34357#ifdef OOMPH_HAS_MPI
34361 if (!this->is_mesh_distributed())
34375 polygon_pt->curve_section_pt(
p - 1)->boundary_id();
34379 double error = 0.0;
34380 for (
unsigned i = 0;
i < 2;
i++)
34395 for (
unsigned i = 0;
i < 2;
i++)
34416 polygon_pt->polyline_pt(
p - 1)->vertex_coordinate(0);
34419 polygon_pt->curve_section_pt(
p - 1)->boundary_id();
34423 double error = 0.0;
34424 for (
unsigned i = 0;
i < 2;
i++)
34440 for (
unsigned i = 0;
i < 2;
i++)
34455 <<
"The distance between the first node of the current\n"
34456 <<
"line segment (boundary " <<
bound
34457 <<
") and either end of "
34458 <<
"the previous line segment\n"
34460 <<
") is bigger than "
34461 <<
"the desired tolerance "
34464 <<
"This suggests that the polylines defining the "
34466 <<
"representation are not properly ordered.\n"
34467 <<
"Fail on last vertex of polyline: ("
34469 <<
") and\nfirst vertex of polyline (" <<
bound
34470 <<
").\nThis should have failed when first trying to "
34471 <<
"construct the\npolygon.\n";
34498 <<
"The distance between the first node of the current\n"
34499 <<
"line segment (boundary " <<
bound
34500 <<
") and either end of "
34501 <<
"the previous line segment\n"
34503 <<
") is bigger than the "
34504 <<
"desired tolerance "
34507 <<
"This suggests that the polylines defining the polygonal\n"
34508 <<
"representation are not properly ordered.\n"
34509 <<
"Fail on last vertex of polyline: ("
34512 <<
"This should have failed when first trying to construct "
34551 this->copy_connection_information(
polygon_pt->polyline_pt(
p),
34555 std::set<TriangleMeshCurveSection*>::iterator
it =
34556 this->Free_curve_section_pt.find(
polygon_pt->curve_section_pt(
p));
34558 if (
it != this->Free_curve_section_pt.end())
34560 this->Free_curve_section_pt.erase(
it);
34569 this->Boundary_curve_section_pt[
bound] =
34574 this->Free_curve_section_pt.insert(
polygon_pt->curve_section_pt(
p));
34613 template<
class ELEMENT>
34623 if (this->is_mesh_distributed() && !
check_only)
34625 std::stringstream error_message;
34627 <<
"The updating of open curves of a distributed mesh can ONLY be\n"
34628 <<
"performed using the element's area associated to the halo(ed)\n"
34630 <<
"1) Make sure you have enabled the parallel mesh adaptation\n"
34631 <<
"option if you are working with a distributed mesh, OR\n"
34632 <<
"2) Make sure to call the update_..._using_elements_area() methods\n"
34633 <<
"if the mesh is marked as distributed\n\n";
34668 const unsigned bound =
34672 const unsigned chunk =
34691 for (
unsigned i = 0;
i < 2;
i++)
34705 for (
unsigned i = 0;
i < 2;
i++)
34715 unsigned count = 0;
34732 double unrefinement_tolerance =
34738 if (unrefinement_tolerance > 0.0 &&
n_vertex >= 3)
34743 unrefinement_tolerance,
34771 double refinement_tolerance =
34773 if (refinement_tolerance > 0.0 &&
n_vertex >= 2)
34777 refinement_tolerance,
34805 double maximum_length =
34807 if (maximum_length > 0.0 &&
n_vertex >= 2)
34840#ifdef OOMPH_HAS_MPI
34844 if (!this->is_mesh_distributed())
34865 double error = 0.0;
34866 for (
unsigned i = 0;
i < 2;
i++)
34881 for (
unsigned i = 0;
i < 2;
i++)
34907 for (
unsigned i = 0;
i < 2;
i++)
34923 for (
unsigned i = 0;
i < 2;
i++)
34936 <<
"The distance between the first node of the current\n"
34937 <<
"line segment (boundary " <<
bound
34938 <<
") and either end of the previous line segment\n"
34940 <<
") is bigger than "
34941 <<
"the desired tolerance "
34944 <<
"This suggests that the polylines defining the open "
34946 <<
"representation are not properly ordered.\n"
34947 <<
"Fail on last vertex of polyline: ("
34949 <<
") and\nfirst vertex of polyline (" <<
bound <<
").\n"
34950 <<
"This should have failed when first trying to "
34952 <<
"the open curve.\n";
34976 <<
"The distance between the first node of the current\n"
34977 <<
"line segment (boundary " <<
bound
34978 <<
") and either end of "
34979 <<
"the previous line segment\n"
34981 <<
") is bigger than the "
34982 <<
"desired tolerance "
34985 <<
"This suggests that the polylines defining the polygonal\n"
34986 <<
"representation are not properly ordered.\n"
34987 <<
"Fail on last vertex of polyline: ("
34990 <<
"This should have failed when first trying to construct "
35022 tmp_polyline->set_unrefinement_tolerance(unrefinement_tolerance);
35023 tmp_polyline->set_refinement_tolerance(refinement_tolerance);
35033 std::set<TriangleMeshCurveSection*>::iterator
it =
35034 this->Free_curve_section_pt.find(
35039 if (
it != this->Free_curve_section_pt.end())
35042 this->Free_curve_section_pt.erase(
it);
35052 this->Boundary_curve_section_pt[
bound] =
35057 this->Free_curve_section_pt.insert(
35097 template<
class ELEMENT>
35102 double& unrefinement_tolerance,
35146 bool do_it =
false;
35147 if (std::fabs(g) < 1.0e-14)
35157 double p_x = (d *
e - b * f) / g;
35158 double p_y = (a * f - c *
e) / g;
35173 unrefinement_tolerance)
35194 const double x = (*it)[0];
35195 const double y = (*it)[1];
35276 bool do_it =
false;
35277 if (std::fabs(g) < 1.0e-14)
35287 double p_x = (d *
e - b * f) / g;
35288 double p_y = (a * f - c *
e) / g;
35303 unrefinement_tolerance)
35324 const double x = (*it)[0];
35325 const double y = (*it)[1];
35392 template<
class ELEMENT>
35396 double& refinement_tolerance,
35426 for (
unsigned i = 0;
i < 2;
i++)
35436 for (
unsigned i = 0;
i < 2;
i++)
35453 for (
unsigned i = 0;
i < 2;
i++)
35538 template<
class ELEMENT>
35567 for (
unsigned i = 0;
i < 2;
i++)
35577 for (
unsigned i = 0;
i < 2;
i++)
35656 template<
class ELEMENT>
35680 el_pt->set_boundary_number_in_bulk_mesh(boundary_id);
35689 template<
class ELEMENT>
35691 const unsigned& boundary_id,
35699 create_unsorted_face_mesh_representation(boundary_id,
35724 std::map<FiniteElement*, bool>
done_el;
35806 std::ostringstream error_message;
35807 error_message <<
"When ordering FaceElements on "
35808 <<
"boundary " << boundary_id <<
" only managed to order \n"
35810 <<
" face elements.\n"
35820 for (std::list<FiniteElement*>::iterator
it =
sorted_el_pt.begin();
35839 this->Boundary_curve_section_pt[boundary_id];
35880 template<
class ELEMENT>
35902 GeomObject*
const geom_object_pt = this->boundary_geom_object_pt(
bound);
35903 if (geom_object_pt != 0)
35912 if (!
polygon_pt->is_redistribution_of_segments_between_polylines_enabled())
35918 if (this->nregion() > 1)
35922 <<
"Can't currently re-distribute segments between polylines if there\n"
35923 <<
"are multiple regions; returning..." << std::endl;
35925 "RefineableTriangleMesh::get_face_mesh_representation()",
35935 <<
"Over-ruling re-distribution of segments between polylines\n"
35936 <<
"because at least one boundary is associated with a GeomObject."
35937 <<
"Returning..." << std::endl;
35939 "RefineableTriangleMesh::get_face_mesh_representation()",
35954 std::vector<bool> is_reversed(
n_polyline,
false);
35984 std::map<FiniteElement*, bool>
done_el;
36071 std::ostringstream error_message;
36072 error_message <<
"When ordering FaceElements on "
36073 <<
"boundary " <<
bound <<
" only managed to order \n"
36075 <<
" face elements.\n"
36103 for (
unsigned i = 0;
i < 2;
i++)
36124 is_reversed[0] =
false;
36129 is_reversed[0] =
true;
36158 if ((!is_reversed[
current]) &&
36163 is_reversed[
pp] =
false;
36171 else if ((!is_reversed[
current]) &&
36176 is_reversed[
pp] =
true;
36184 else if ((is_reversed[
current]) &&
36189 is_reversed[
pp] =
false;
36197 else if ((is_reversed[
current]) &&
36202 is_reversed[
pp] =
true;
36215 std::ostringstream error_message;
36216 error_message <<
"Only found " <<
count_found <<
" out of "
36217 <<
n_polyline - 1 <<
" polylines to be fitted in.\n";
36236 std::map<Node*, std::map<unsigned, unsigned>>
36247 if (is_reversed[
p])
36258 for (
unsigned i = 0;
i < 2;
i++)
36346 for (std::map<unsigned, unsigned>::iterator
it_2 = (*it).second.begin();
36347 it_2 != (*it).second.end();
36351 unsigned bound = (*it_2).first;
36354 if ((*it_2).second == 0)
36378 el_pt->set_boundary_number_in_bulk_mesh(
bound);
36383 setup_boundary_element_info();
36409 template<
class ELEMENT>
36435 template<
class ELEMENT>
36453 if (
poly_pt->can_update_reference_configuration())
36455 poly_pt->reset_reference_configuration();
36490 if (!
poly_pt->internal_point().empty())
36494 if (
poly_pt->is_internal_point_fixed())
36504 if (this->Internal_hole_point_update_fct_pt != 0)
36506 this->Internal_hole_point_update_fct_pt(
ihole,
poly_pt);
36532 for (
unsigned i = 0;
i < 2;
i++)
36539 for (
unsigned i = 0;
i < 2;
i++)
36546 for (
unsigned i = 0;
i < 2;
i++)
36624 template<
class ELEMENT>
36637 std::string
error_msg(
"Failed to open node file: ");
36702 std::map<unsigned, Vector<std::pair<unsigned, unsigned>>>
36719 std::string
error_msg(
"Failed to open poly file: ");
36830 std::ostringstream error_message;
36832 <<
"The number of nodes (" <<
nodes_ids.
size() <<
") and segments ("
36834 <<
"are internal non-closed boundaries defined in\nthe polyfile. "
36835 <<
"If you need this feature please use the TriangleMeshPoyLine\n"
36836 <<
"and TriangleMeshCurviLine objects to define your domain.\n\n";
36848 if (nboundary != this->nboundary())
36850 std::ostringstream error_message;
36852 <<
"The number of boundaries on the mesh (" << this->nboundary()
36853 <<
") is different from the number of\nboundaries read from the "
36866 std::ostringstream error_message;
36868 <<
"The number of boundaries on the mesh (" << this->nboundary()
36869 <<
") is different from the number of\nsorted boundaries ids read "
36880 std::map<unsigned, Vector<std::pair<unsigned, unsigned>>>
::iterator it;
36888 const unsigned bnd_id = (*it).first;
36892 std::map<std::pair<unsigned, unsigned>,
bool>
segment_done;
36914 for (
unsigned i = 1;
i < nsegments;
i++)
36993 std::ostringstream error_message;
36995 <<
"The number of boundaries on the mesh (" << this->nboundary()
36996 <<
") is different from the number\nof sorted boundaries to create the "
37017 for (std::list<unsigned>::iterator
it_list =
37032 for (
unsigned i = 0;
i < nvertices;
i++)
37049 this->Boundary_curve_section_pt[
bnd_id] =
37080 for (
unsigned i = 0;
i < nboundary;
i++)
37103 std::ostringstream error_message;
37104 error_message <<
"Was not possible to found the root polyline to "
37105 "create polygons\n\n";
37211 std::ostringstream error_message;
37213 <<
"It was not possible to create a closed curve, these are the "
37214 <<
"vertices of the already sorted polylines\n\n";
37216 for (std::list<TriangleMeshCurveSection*>::iterator
it_list =
37221 error_message <<
"Polyline (" <<
cpolyline <<
")\n";
37225 for (
unsigned v = 0;
v < nvertex;
v++)
37227 error_message <<
"(" <<
tmp_poly_pt->vertex_coordinate(
v)[0] <<
", "
37230 error_message <<
"\n";
37242 for (std::list<TriangleMeshCurveSection*>::iterator
it_list =
37289 for (
unsigned v = 0;
v < nvertex;
v++)
37316 for (
unsigned v = 0;
v < nvertex;
v++)
37387 <<
"The first set of nodes listed in the input polyfiles does not\n"
37388 <<
"correspond to the outer closed boundary. This may lead to\n"
37389 <<
"problems at the adaptation stage if the holes coordinates\n"
37390 <<
"are no correctly associated to the inner closed boundaries.\n"
37391 <<
"You can check the generated mesh by calling the output() method\n"
37392 <<
"from the mesh object '(problem.mesh_pt()->output(string))'\n\n";
37404 this->Outer_boundary_pt.resize(1);
37407 this->Internal_polygon_pt.resize(
npolygons - 1);
37437 this->Internal_polygon_pt[
i]->npolyline();
37441 this->Internal_polygon_pt[
i]->polyline_pt(
p);
37445 for (
unsigned v = 0;
v < nvertex;
v++)
37462 std::ostringstream error_message;
37464 <<
"The number of holes (" <<
nholes <<
") does not correspond "
37465 <<
"with the number\nof internal polygons (" <<
npolygons - 1 <<
")\n\n"
37466 <<
"Using polyfiles as input does not currently allows the\n"
37467 <<
"definition of more than one outer polygon\n\n";
37498 for (
unsigned h = 0; h <
nholes; h++)
37530 std::ostringstream error_message;
37532 <<
"Not all the holes were associated to an internal closed boundary\n"
37534 <<
") holes were assigned for a total of\n"
37535 <<
"(" <<
npolygons - 1 <<
") internal closed boundaries.\n"
37536 <<
"You can check the generated mesh by calling the output() method\n"
37537 <<
"from the mesh object '(problem.mesh_pt()->output(string))'\n\n";
37554 std::ostringstream error_message;
37556 <<
"The hole vertices coordinates are not listed in the same order\n"
37557 <<
"as the nodes that define the internal closed boundaries.\n"
37558 <<
"This may lead to problems in case that the holes coordinates\n"
37559 <<
"were no properly assigned to the internal closed boundaries.\n"
37560 <<
"You can check the generated mesh by calling the output() method\n"
37561 <<
"from the mesh object '(problem.mesh_pt()->output(string))'\n\n";
37569 this->Internal_polygon_pt[
ihole]->internal_point() =
37598 std::map<unsigned, Vector<double>> regions_coordinates;
37614 regions_coordinates[
region_id].resize(2);
37624 std::ostringstream error_message;
37626 <<
"Please use another region id different from zero.\n"
37627 <<
"It is internally used as the default region number.\n";
37635 this->Regions_coordinates = regions_coordinates;
37644 template<
class ELEMENT>
37651 const unsigned nele = this->nelement();
37698#ifdef OOMPH_HAS_MPI
37741#ifdef OOMPH_HAS_MPI
37762#ifdef OOMPH_HAS_MPI
37777 unsigned iface = 0;
37796 std::ostringstream error_message;
37797 error_message <<
"Could not find an initial face element for the "
37798 "current segment\n";
37801 error_message.str(),
37802 "RefineableTriangleMesh::update_polygon_using_elements_area()",
37835 for (
unsigned i = 0;
i < 2;
i++)
37848 for (
unsigned i = 0;
i < 2;
i++)
37901 std::ostringstream error_message;
37902 error_message <<
"The global index for the (" <<
ef
37903 <<
")-th face element "
37904 <<
"on\nthe (" <<
bound
37905 <<
")-th boundary was not found!!!";
37907 error_message.str(),
37908 "RefineableTriangleMesh::update_polygon_using_elements_area()",
37970 for (
unsigned i = 0;
i < 2;
i++)
37982 for (
unsigned i = 0;
i < 2;
i++)
38029 std::ostringstream error_message;
38030 error_message <<
"The global index for the (" <<
ef
38031 <<
")-th face element "
38032 <<
"on\nthe (" <<
bound
38033 <<
")-th boundary was not found!!!";
38035 "RefineableTriangleMesh::update_polygon_"
38036 "using_elements_area()",
38093 std::ostringstream error_message;
38095 <<
"The boundary (" <<
bound <<
") was split during the "
38096 <<
"distribution process.\n"
38097 <<
"The problem is in the association of the target areas with "
38099 <<
"elements that gave rise to the vertex coordinates.\n"
38101 <<
"), on the 'sub-polyline', is not\n"
38102 <<
"according with the number of target "
38103 <<
"areas (" <<
ntarget_areas <<
")\nfor that number of nodes.\n"
38104 <<
"The target areas number MUST be equal to the number of\n"
38105 <<
"local nodes minus one\n\n";
38119 double unrefinement_tolerance =
38120 polygon_pt->polyline_pt(
p)->unrefinement_tolerance();
38124 unrefine_boundary_constrained_by_target_area(
38128 unrefinement_tolerance,
38132 double refinement_tolerance =
38133 polygon_pt->polyline_pt(
p)->refinement_tolerance();
38139 refinement_tolerance,
38163#ifdef OOMPH_HAS_MPI
38164 if (this->is_mesh_distributed())
38181 unsigned count = 0;
38193#ifdef OOMPH_HAS_MPI
38200 std::ostringstream error_message;
38202 <<
"The number of found sub-boundaries and the number of counted\n"
38203 <<
"sub-boundaries are different:\n"
38205 <<
"Number of counted sub-boundaries: (" <<
nsub_boundaries <<
")\n";
38216 this->Boundary_was_splitted[
bound] =
true;
38255#ifdef OOMPH_HAS_MPI
38291#ifdef OOMPH_HAS_MPI
38295 if (!this->is_mesh_distributed())
38309 polygon_pt->curve_section_pt(
p - 1)->boundary_id();
38313 double error = 0.0;
38314 for (
unsigned i = 0;
i < 2;
i++)
38329 for (
unsigned i = 0;
i < 2;
i++)
38350 polygon_pt->polyline_pt(
p - 1)->vertex_coordinate(0);
38353 polygon_pt->curve_section_pt(
p - 1)->boundary_id();
38357 double error = 0.0;
38358 for (
unsigned i = 0;
i < 2;
i++)
38374 for (
unsigned i = 0;
i < 2;
i++)
38389 <<
"The distance between the first node of the current\n"
38390 <<
"line segment (boundary " <<
bound
38391 <<
") and either end of "
38392 <<
"the previous line segment\n"
38394 <<
") is bigger than "
38395 <<
"the desired tolerance "
38398 <<
"This suggests that the polylines defining the "
38400 <<
"representation are not properly ordered.\n"
38401 <<
"Fail on last vertex of polyline: ("
38403 <<
"first vertex of polyline (" <<
bound <<
").\n"
38404 <<
"This should have failed when first trying to "
38405 <<
"construct the\npolygon.\n";
38432 <<
"The distance between the first node of the current\n"
38433 <<
"line segment (boundary " <<
bound
38434 <<
") and either end of "
38435 <<
"the previous line segment\n"
38437 <<
") is bigger than the "
38438 <<
"desired tolerance "
38441 <<
"This suggests that the polylines defining the polygonal\n"
38442 <<
"representation are not properly ordered.\n"
38443 <<
"Fail on last vertex of polyline: ("
38446 <<
"This should have failed when first trying to construct"
38447 <<
" the polygon.\n";
38487 double unrefinement_tolerance =
38488 polygon_pt->polyline_pt(
p)->unrefinement_tolerance();
38491 double refinement_tolerance =
38492 polygon_pt->polyline_pt(
p)->refinement_tolerance();
38499 double maximum_length =
polygon_pt->polyline_pt(
p)->maximum_length();
38502#ifdef OOMPH_HAS_MPI
38505 if (this->is_mesh_distributed())
38511 this->copy_connection_information(
polygon_pt->polyline_pt(
p),
38520 this->copy_connection_information(
polygon_pt->polyline_pt(
p),
38529 std::set<TriangleMeshCurveSection*>::iterator
it =
38530 this->Free_curve_section_pt.find(
polygon_pt->curve_section_pt(
p));
38532 if (
it != this->Free_curve_section_pt.end())
38534 this->Free_curve_section_pt.erase(
it);
38548 this->Free_curve_section_pt.insert(
polygon_pt->curve_section_pt(
p));
38551#ifdef OOMPH_HAS_MPI
38560 this->Boundary_subpolylines[
bound].clear();
38606 template<
class ELEMENT>
38613 const unsigned nele = this->nelement();
38632 const unsigned ncurve_section =
open_curve_pt->ncurve_section();
38635 for (
unsigned cs = 0;
cs < ncurve_section;
cs++)
38650 const unsigned chunk =
38680#ifdef OOMPH_HAS_MPI
38681 if (this->is_mesh_distributed())
38747 std::ostringstream error_message;
38749 <<
"The face element at the other side of the boundary (" <<
bound
38750 <<
") was not found!!\n"
38751 <<
"These are the nodes of the face element:\n"
38756 error_message.str(),
38757 "RefineableTriangleMesh::update_open_curve_using_elements_area()",
38783#ifdef OOMPH_HAS_MPI
38818#ifdef OOMPH_HAS_MPI
38843 unsigned iface = 0;
38857#ifdef OOMPH_HAS_MPI
38879 std::ostringstream error_message;
38880 error_message <<
"Could not find an initial face element for the "
38881 "current segment\n";
38916 for (
unsigned i = 0;
i < 2;
i++)
38929 for (
unsigned i = 0;
i < 2;
i++)
38980 std::ostringstream error_message;
38981 error_message <<
"The global index for the (" <<
ef
38982 <<
")-th face element "
38983 <<
"on\nthe (" <<
bound
38984 <<
")-th boundary was not found!!!";
38992 const unsigned ref =
39020 std::ostringstream error_message;
39021 error_message <<
"The global index for the (" <<
ref
39022 <<
")-th face element "
39023 <<
"on\nthe (" <<
bound
39024 <<
")-th boundary was not found (repeated "
39025 <<
"face element)!!!";
39067#ifdef OOMPH_HAS_MPI
39112 for (
unsigned i = 0;
i < 2;
i++)
39124 for (
unsigned i = 0;
i < 2;
i++)
39151 const unsigned lef =
39178 std::ostringstream error_message;
39179 error_message <<
"The global index for the (" <<
lef
39180 <<
")-th face element "
39181 <<
"on\nthe (" <<
bound
39182 <<
")-th boundary was not found!!!";
39190 const unsigned rlef =
39217 std::ostringstream error_message;
39218 error_message <<
"The global index for the (" <<
rlef
39219 <<
")-th face element "
39220 <<
"on\nthe (" <<
bound
39221 <<
")-th boundary was not found "
39222 <<
"(repeated face element)!!!";
39286 std::ostringstream error_message;
39288 <<
"The boundary (" <<
bound <<
") was split during the "
39289 <<
"distribution process.\n"
39290 <<
"The problem comes when associating the target areas with the "
39291 <<
"elements that gave\nrise to the vertex coordinates.\n"
39292 <<
"The number of local nodes on the 'sub-polyline' ("
39293 <<
nlocal_nodes <<
") is not according with the number of target\n"
39294 <<
"areas (" <<
ntarget_areas <<
") for that number of nodes.\n"
39295 <<
"The target areas number must be equal to the number of "
39334 double unrefinement_tolerance =
39339 unrefine_boundary_constrained_by_target_area(
39343 unrefinement_tolerance,
39347 double refinement_tolerance =
39354 refinement_tolerance,
39378#ifdef OOMPH_HAS_MPI
39379 if (this->is_mesh_distributed())
39409 unsigned count = 0;
39421#ifdef OOMPH_HAS_MPI
39431 std::ostringstream error_message;
39433 <<
"The number of found sub-boundaries and the number of marked "
39434 <<
"internal\nboundaries are different\n"
39436 <<
"Number of marked internal boundaries: ("
39448 std::ostringstream error_message;
39450 <<
"The number of found sub-boundaries and the number of counted\n"
39451 <<
"sub-boundaries are different:\n"
39465 this->Boundary_was_splitted[
bound] =
true;
39505#ifdef OOMPH_HAS_MPI
39540#ifdef OOMPH_HAS_MPI
39544 if (!this->is_mesh_distributed())
39562 double error = 0.0;
39563 for (
unsigned i = 0;
i < 2;
i++)
39578 for (
unsigned i = 0;
i < 2;
i++)
39606 double error = 0.0;
39607 for (
unsigned i = 0;
i < 2;
i++)
39623 for (
unsigned i = 0;
i < 2;
i++)
39637 <<
"The distance between the first node of the current\n"
39638 <<
"line segment (boundary " <<
bound
39639 <<
") and either end of "
39640 <<
"the previous line segment\n"
39642 <<
") is bigger than"
39643 <<
" the desired tolerance "
39646 <<
"This suggests that the polylines defining the "
39648 <<
"representation are not properly ordered.\n"
39649 <<
"Fail on last vertex of polyline: ("
39651 <<
") and\nfirst vertex of polyline (" <<
bound
39652 <<
").\nThis should have failed when first trying to "
39653 <<
"construct the\npolygon.\n";
39679 <<
"The distance between the first node of the current\n"
39680 <<
"line segment (boundary " <<
bound
39681 <<
") and either end of "
39682 <<
"the previous line segment\n"
39684 <<
") is bigger than the "
39685 <<
"desired tolerance "
39688 <<
"This suggests that the polylines defining the polygonal\n"
39689 <<
"representation are not properly ordered.\n"
39690 <<
"Fail on last vertex of polyline: ("
39693 <<
"This should have failed when first trying to construct\n"
39694 <<
"the polygon.\n";
39733 double unrefinement_tolerance =
39737 double refinement_tolerance =
39745 double maximum_length =
open_curve_pt->polyline_pt(
cs)->maximum_length();
39748#ifdef OOMPH_HAS_MPI
39751 if (this->is_mesh_distributed())
39775 std::set<TriangleMeshCurveSection*>::iterator
it =
39776 this->Free_curve_section_pt.find(
open_curve_pt->curve_section_pt(
cs));
39778 if (
it != this->Free_curve_section_pt.end())
39780 this->Free_curve_section_pt.erase(
it);
39790 this->Boundary_curve_section_pt[
bound] =
39795 this->Free_curve_section_pt.insert(
open_curve_pt->curve_section_pt(
cs));
39798#ifdef OOMPH_HAS_MPI
39804 this->Boundary_marked_as_shared_boundary[
bound].clear();
39807 this->Boundary_marked_as_shared_boundary[
bound].push_back(
39818 this->Boundary_subpolylines[
bound].clear();
39823 this->Boundary_marked_as_shared_boundary[
bound].clear();
39840 this->Boundary_marked_as_shared_boundary[
bound][
isub] =
39852 this->copy_connection_information_to_sub_polylines(
39868 for (
unsigned p = 0;
p < ncurve_section;
p++)
39877#ifdef OOMPH_HAS_MPI
39882 template<
class ELEMENT>
39928 int face_index = this->face_index_at_shared_boundary(
shd_bnd_id,
e);
39972 std::ostringstream error_message;
39975 <<
") is not the double\nof the number of unsorted NONHALO shared "
39977 <<
"for the current boundary (" <<
shd_bnd_id <<
")\n\n";
39987 std::ostringstream error_message;
39990 <<
") is not the double\nof the number of unsorted HALO shared "
39992 <<
"for the current boundary (" <<
shd_bnd_id <<
")\n\n";
40108 std::ostringstream error_message;
40111 <<
") is not the double\nof the number of unsorted shared bulk "
40113 <<
"for the current boundary (" <<
shd_bnd_id <<
")\n\n";
40124 std::ostringstream error_message;
40125 error_message <<
"The number of DONE shared boundary face elements ("
40127 <<
") is not the same\n as the sum of"
40128 <<
"the nonhalo face shared boundary elements ("
40130 <<
")\nand the halo face shared "
40133 <<
"current boundary (" <<
shd_bnd_id <<
")\n\n";
40315 for (std::list<FiniteElement*>::iterator
it_ele =
40328 std::map<std::pair<GeneralisedElement*, unsigned>,
bool>
shared_ele_done;
40334 const unsigned nele = this->nelement();
40338 for (
unsigned e = 0;
e <
nele;
e++)
40378 std::ostringstream error_message;
40379 error_message <<
"The number of found target areas ("
40381 <<
") is different from the "
40382 <<
"total number\nof target areas ("
40406 std::ostringstream error_message;
40408 <<
"The number of segments from the current shared polyline "
40409 <<
"(" <<
n_segments <<
") does not\ncorrespond with the number of "
40411 <<
") of the current shared\n"
40422 std::ostringstream error_message;
40424 <<
"The number of segments for the current sorting of edges "
40425 <<
"(" <<
n_segments <<
") is different\nfrom the number of "
40478 unrefine_shared_boundary_constrained_by_target_area(
40502 this->copy_connection_information(curve_section_pt,
new_polyline_pt);
40511 std::set<TriangleMeshCurveSection*>::iterator
it =
40512 this->Free_curve_section_pt.find(curve_section_pt);
40514 if (
it != this->Free_curve_section_pt.end())
40516 this->Free_curve_section_pt.erase(
it);
40517 delete curve_section_pt;
40546 template<
class ELEMENT>
40552 double& unrefinement_tolerance,
40567 if (!Do_boundary_unrefinement_constrained_by_target_areas)
40648 bool do_it =
false;
40649 if (std::fabs(g) < 1.0e-14)
40655 double p_x = (d *
e - b * f) / g;
40656 double p_y = (a * f - c *
e) / g;
40672 unrefinement_tolerance)
40690 const double x = (*it)[0];
40691 const double y = (*it)[1];
40802 template<
class ELEMENT>
40807 double& refinement_tolerance,
40815 if (!Do_boundary_refinement_constrained_by_target_areas)
40872 unsigned n_seg = 1;
40886 for (
unsigned s = 1;
s <
n_seg;
s++)
40944 template<
class ELEMENT>
40964 if (!Do_shared_boundary_unrefinement_constrained_by_target_areas)
41038 const double x = (*it)[0];
41039 const double y = (*it)[1];
41153 template<
class ELEMENT>
41164 if (!Do_shared_boundary_refinement_constrained_by_target_areas)
41179 for (
unsigned s = 0;
s < nsegments;
s++)
41217 for (
unsigned i = 1;
i <
nseg;
i++)
41242 for (
unsigned i = 0;
i < nsegments + 1;
i++)
41256 template<
class ELEMENT>
41303#ifdef OOMPH_HAS_MPI
41343#ifdef OOMPH_HAS_MPI
41344 if (this->is_mesh_distributed())
41367#ifdef OOMPH_HAS_MPI
41382 unsigned iface = 0;
41401 std::ostringstream error_message;
41402 error_message <<
"Could not find an initial face element for the "
41403 "current segment\n";
41406 error_message.str(),
41407 "RefineableTriangleMesh::update_polygon_after_restart()",
41434 for (
unsigned i = 0;
i < 2;
i++)
41447 for (
unsigned i = 0;
i < 2;
i++)
41516 for (
unsigned i = 0;
i < 2;
i++)
41528 for (
unsigned i = 0;
i < 2;
i++)
41593#ifdef OOMPH_HAS_MPI
41594 if (this->is_mesh_distributed())
41609 unsigned count = 0;
41620#ifdef OOMPH_HAS_MPI
41627 std::ostringstream error_message;
41629 <<
"The number of found sub-boundaries and the number of counted\n"
41630 <<
"sub-boundaries are different:\n"
41632 <<
"Number of counted sub-boundaries: (" <<
nsub_boundaries <<
")\n";
41634 error_message.str(),
41635 "RefineableTriangleMesh::update_polygon_after_restart()",
41644 this->Boundary_was_splitted[
bound] =
true;
41683#ifdef OOMPH_HAS_MPI
41719#ifdef OOMPH_HAS_MPI
41723 if (!this->is_mesh_distributed())
41737 polygon_pt->curve_section_pt(
p - 1)->boundary_id();
41741 double error = 0.0;
41742 for (
unsigned i = 0;
i < 2;
i++)
41757 for (
unsigned i = 0;
i < 2;
i++)
41778 polygon_pt->polyline_pt(
p - 1)->vertex_coordinate(0);
41781 polygon_pt->curve_section_pt(
p - 1)->boundary_id();
41785 double error = 0.0;
41786 for (
unsigned i = 0;
i < 2;
i++)
41802 for (
unsigned i = 0;
i < 2;
i++)
41817 <<
"The distance between the first node of the current\n"
41818 <<
"line segment (boundary " <<
bound
41819 <<
") and either end of "
41820 <<
"the previous line segment\n"
41822 <<
") is bigger than "
41823 <<
"the desired tolerance "
41826 <<
"This suggests that the polylines defining the "
41828 <<
"representation are not properly ordered.\n"
41829 <<
"Fail on last vertex of polyline: ("
41831 <<
") and\nfirst vertex of polyline (" <<
bound
41832 <<
").\nThis should have failed when first trying to"
41833 <<
" construct the\npolygon.\n";
41836 "RefineableTriangleMesh::update_polygon_after_restart()",
41860 <<
"The distance between the first node of the current\n"
41861 <<
"line segment (boundary " <<
bound
41862 <<
") and either end of "
41863 <<
"the previous line segment\n"
41865 <<
") is bigger than the "
41866 <<
"desired tolerance "
41869 <<
"This suggests that the polylines defining the polygonal\n"
41870 <<
"representation are not properly ordered.\n"
41871 <<
"Fail on last vertex of polyline: ("
41874 <<
"This should have failed when first trying to construct "
41879 "RefineableTriangleMesh::update_polygon_after_restart()",
41922 double unrefinement_tolerance =
41923 polygon_pt->polyline_pt(
p)->unrefinement_tolerance();
41926 double refinement_tolerance =
41927 polygon_pt->polyline_pt(
p)->refinement_tolerance();
41934 double maximum_length =
polygon_pt->polyline_pt(
p)->maximum_length();
41941 this->copy_connection_information(
polygon_pt->polyline_pt(
p),
41950 std::set<TriangleMeshCurveSection*>::iterator
it =
41951 this->Free_curve_section_pt.find(
polygon_pt->curve_section_pt(
p));
41953 if (
it != this->Free_curve_section_pt.end())
41955 this->Free_curve_section_pt.erase(
it);
41965 this->Boundary_curve_section_pt[
bound] =
41970 this->Free_curve_section_pt.insert(
polygon_pt->curve_section_pt(
p));
41973#ifdef OOMPH_HAS_MPI
41981 this->Boundary_subpolylines[
bound].clear();
42028 template<
class ELEMENT>
42047 const unsigned ncurve_section =
open_curve_pt->ncurve_section();
42049 for (
unsigned cs = 0;
cs < ncurve_section;
cs++)
42089#ifdef OOMPH_HAS_MPI
42090 if (this->is_mesh_distributed())
42158 std::ostringstream error_message;
42160 <<
"The face element at the other side of the boundary (" <<
bound
42161 <<
") was not found!!\n"
42162 <<
"These are the nodes of the face element:\n"
42167 error_message.str(),
42168 "RefineableTriangleMesh::update_open_curve_after_restart()",
42194#ifdef OOMPH_HAS_MPI
42227#ifdef OOMPH_HAS_MPI
42252 unsigned iface = 0;
42266#ifdef OOMPH_HAS_MPI
42288 std::ostringstream error_message;
42289 error_message <<
"Could not find an initial face element for the "
42290 "current segment\n";
42320 for (
unsigned i = 0;
i < 2;
i++)
42333 for (
unsigned i = 0;
i < 2;
i++)
42369#ifdef OOMPH_HAS_MPI
42414 for (
unsigned i = 0;
i < 2;
i++)
42426 for (
unsigned i = 0;
i < 2;
i++)
42517#ifdef OOMPH_HAS_MPI
42518 if (this->is_mesh_distributed())
42548 unsigned count = 0;
42559#ifdef OOMPH_HAS_MPI
42569 std::ostringstream error_message;
42571 <<
"The number of found sub-boundaries and the number of marked "
42572 <<
"internal\nboundaries are different\n"
42574 <<
"Number of marked internal boundaries: ("
42577 error_message.str(),
42578 "RefineableTriangleMesh::update_open_curve_after_restart()",
42587 std::ostringstream error_message;
42589 <<
"The number of found sub-boundaries and the number of counted\n"
42590 <<
"sub-boundaries are different:\n"
42595 error_message.str(),
42596 "RefineableTriangleMesh::update_open_curve_after_restart()",
42605 this->Boundary_was_splitted[
bound] =
true;
42643#ifdef OOMPH_HAS_MPI
42679#ifdef OOMPH_HAS_MPI
42683 if (!this->is_mesh_distributed())
42701 double error = 0.0;
42702 for (
unsigned i = 0;
i < 2;
i++)
42717 for (
unsigned i = 0;
i < 2;
i++)
42745 double error = 0.0;
42746 for (
unsigned i = 0;
i < 2;
i++)
42762 for (
unsigned i = 0;
i < 2;
i++)
42776 <<
"The distance between the first node of the current\n"
42777 <<
"line segment (boundary " <<
bound
42778 <<
") and either end of "
42779 <<
"the previous line segment\n"
42781 <<
") is bigger than"
42782 <<
" the desired tolerance "
42785 <<
"This suggests that the polylines defining the "
42787 <<
"representation are not properly ordered.\n"
42788 <<
"Fail on last vertex of polyline: ("
42790 <<
") and\nfirst vertex of polyline (" <<
bound
42791 <<
").\nThis should have failed when first trying to "
42792 <<
"construct the\npolygon.\n";
42794 "RefineableTriangleMesh::update_open_"
42795 "curve_after_restart()",
42819 <<
"The distance between the first node of the current\n"
42820 <<
"line segment (boundary " <<
bound
42821 <<
") and either end of "
42822 <<
"the previous line segment\n"
42824 <<
") is bigger than the "
42825 <<
"desired tolerance "
42828 <<
"This suggests that the polylines defining the polygonal\n"
42829 <<
"representation are not properly ordered.\n"
42830 <<
"Fail on last vertex of polyline: ("
42833 <<
"This should have failed when first trying to construct "
42838 "RefineableTriangleMesh::update_open_curve_after_restart()",
42877 double unrefinement_tolerance =
42881 double refinement_tolerance =
42889 double maximum_length =
42906 std::set<TriangleMeshCurveSection*>::iterator
it =
42907 this->Free_curve_section_pt.find(
open_curve_pt->curve_section_pt(
cs));
42909 if (
it != this->Free_curve_section_pt.end())
42911 this->Free_curve_section_pt.erase(
it);
42921 this->Boundary_curve_section_pt[
bound] =
42926 this->Free_curve_section_pt.insert(
42930#ifdef OOMPH_HAS_MPI
42937 this->Boundary_marked_as_shared_boundary[
bound].clear();
42940 this->Boundary_marked_as_shared_boundary[
bound].push_back(
42950 this->Boundary_subpolylines[
bound].clear();
42955 this->Boundary_marked_as_shared_boundary[
bound].clear();
42958 this->Boundary_marked_as_shared_boundary[
bound].resize(
42974 this->Boundary_marked_as_shared_boundary[
bound][
isub] =
42996 for (
unsigned p = 0;
p < ncurve_section;
p++)
43003#ifdef OOMPH_HAS_MPI
43007 template<
class ELEMENT>
43054 std::pair<Node*, Node*>
edge1 =
43058 std::pair<Node*, Node*>
edge2 =
43062 std::pair<Node*, Node*>
edge3 =
43079 std::pair<Node*, Node*>
edge1 =
43083 std::pair<Node*, Node*>
edge2 =
43087 std::pair<Node*, Node*>
edge3 =
43097 std::map<std::pair<Node*, Node*>,
bool>
edge_done;
43114 std::pair<Node*, Node*>
new_edge =
43158 std::pair<Node*, Node*>
new_edge =
43199 std::map<std::pair<Node*, Node*>,
bool>
edge_sorted;
43208 std::ostringstream error_message;
43211 <<
") is not the double\nof the number of unsorted edges ("
43212 <<
nunsorted_edges <<
") for the current boundary (" << b <<
")\n\n";
43214 error_message.str(),
43215 "RefineableTriangleMesh::update_shared_curve_after_restart()",
43380 this->copy_connection_information(curve_section_pt,
new_polyline_pt);
43389 std::set<TriangleMeshCurveSection*>::iterator
it =
43390 this->Free_curve_section_pt.find(curve_section_pt);
43392 if (
it != this->Free_curve_section_pt.end())
43394 this->Free_curve_section_pt.erase(
it);
43395 delete curve_section_pt;
43422 template<
class ELEMENT>
43424 ELEMENT>::fill_boundary_elements_and_nodes_for_internal_boundaries()
43428 fill_boundary_elements_and_nodes_for_internal_boundaries(
some_file);
43435 template<
class ELEMENT>
43441 const unsigned nproc = this->communicator_pt()->nproc();
43443 unsigned my_rank = this->communicator_pt()->my_rank();
43447 this->Shared_boundary_overlaps_internal_boundary;
43457 const unsigned nbound = this->nboundary();
43459 outfile <<
"Number of elements and nodes associated to each "
43460 <<
"boundary before\nfilling elements and nodes\n\n";
43463 outfile <<
"Boundary (" <<
i <<
") Elements ("
43464 << this->nboundary_element(
i) <<
") "
43465 <<
"Nodes (" << this->nboundary_node(
i) <<
")\n";
43470 std::set<unsigned> shared_boundaries_in_this_processor;
43493 shared_boundaries_in_this_processor.insert(
bnd_id);
43504 for (std::map<unsigned, unsigned>::iterator
it =
43515 std::set<unsigned>::iterator
it_set =
43516 shared_boundaries_in_this_processor.find(
shd_bnd_id);
43517 if (
it_set != shared_boundaries_in_this_processor.end())
43531 <<
") to internal (" <<
int_bnd_id <<
")\n";
43568 int face_index = this->face_index_at_boundary(
shd_bnd_id,
ie);
43570 Face_index_at_boundary[
int_bnd_id].push_back(face_index);
43575 const unsigned nregions = this->nregion();
43582 static_cast<unsigned>(this->Region_attribute[
ir]);
43598 int face_index = this->face_index_at_boundary_in_region(
43602 .push_back(face_index);
43618 const unsigned nbound = this->nboundary();
43620 outfile <<
"Number of elements and nodes associated to each "
43621 <<
"boundary after\nfilling elements and nodes\n\n";
43624 outfile <<
"Boundary (" <<
i <<
") Elements ("
43625 << this->nboundary_element(
i) <<
")"
43626 <<
" Nodes (" << this->nboundary_node(
i) <<
")\n";
43642 overlaped_internal_bnd_id);
43651 template<
class ELEMENT>
43656 if (!boundary_coordinate_exists(b))
43679#ifdef OOMPH_HAS_MPI
43685 int face_index = this->face_index_at_boundary(b,
e);
43703#ifdef OOMPH_HAS_MPI
43715#ifdef OOMPH_HAS_MPI
43717 if (!this->is_mesh_distributed())
43721#ifdef OOMPH_HAS_MPI
43727 create_unsorted_face_mesh_representation(b,
face_mesh_pt);
43773#ifdef OOMPH_HAS_MPI
43775 const unsigned nsegments =
new_mesh_pt->nboundary_segment(b);
43779 const unsigned nsegments = 1;
43782#ifdef OOMPH_HAS_MPI
43787 if (this->is_mesh_distributed())
43796 create_unsorted_face_mesh_representation(b,
face_mesh_pt);
43815 for (
unsigned is = 0;
is < nsegments;
is++)
43817#ifdef OOMPH_HAS_MPI
43830#ifdef OOMPH_HAS_MPI
43882 <<
"New boundary coordinates not found for the first and/or last "
43884 <<
"on the boundary " << b <<
". This should not happen because "
43885 <<
"these\nlimits should have been setup in the constructor\n";
43887 <<
"The distance between the new and old nodes is probably outside\n"
43888 <<
"our tolerance.\n";
43903 "RefineableTriangleMesh::snap_nodes_onto_boundary()",
43910 if (!this->is_mesh_distributed())
43968 "New boundary coordinate not assigned\n",
43969 "RefineableTriangleMesh::snap_nodes_onto_boundary()",
43973#ifdef OOMPH_HAS_MPI
43976 ->boundary_segment_node_pt(
43978 ->get_coordinates_on_boundary(b,
b_coord);
43982 ->boundary_segment_node_pt(
43984 ->set_coordinates_on_boundary(b,
b_coord);
43989 ->get_coordinates_on_boundary(b,
b_coord);
43994 ->set_coordinates_on_boundary(b,
b_coord);
44001 create_unsorted_face_mesh_representation(b,
face_mesh_pt);
44011 for (
unsigned is = 0;
is < nsegments;
is++)
44019#ifdef OOMPH_HAS_MPI
44032 for (
unsigned i = 0;
i < 2;
i++)
44051 for (
unsigned j = 0;
j < 6;
j++)
44080 "Have a three-noded element that's not a TElement<2,2>",
44090 else if ((
nnod == 6) || (
nnod == 7))
44100 "Have a six-noded element that's not a TElement<2,3>",
44107 "Have a seven-noded element that's not a TElement<2,3>",
44129 for (
unsigned i = 0;
i < 2;
i++)
44140 for (
unsigned i = 0;
i < 2;
i++)
44156 for (
unsigned i = 0;
i < 2;
i++)
44167 for (
unsigned i = 0;
i < 2;
i++)
44183 for (
unsigned i = 0;
i < 2;
i++)
44194 for (
unsigned i = 0;
i < 2;
i++)
44211 throw OomphLibError(
"Have seven-noded element that's not a "
44212 "TBubbleEnrichedElement<2,3>",
44219 for (
unsigned j = 0;
j < 6;
j++)
44221 for (
unsigned i = 0;
i < 2;
i++)
44245 <<
"-noded element yet.\n"
44246 <<
"Please implement this yourself.\n";
44253 for (
unsigned j = 0;
j < 6;
j++)
CGAL-based SamplePointContainer.
NonRefineableBinArray class.
const Vector< double > & diff() const
Vector of diffusion coefficients.
Algebraic meshes contain AlgebraicElements and AlgebraicNodes. They implement the node update functio...
Algebraic nodes are nodes with an algebraic positional update function.
A class that contains the information required by Nodes that are located on Mesh boundaries....
Helper object for dealing with the parameters used for the CGALSamplePointContainer objects.
A class that represents a collection of data; each Data object may contain many different individual ...
Information for documentation of results: Directory and file number to enable output in the form RESL...
A general Finite Element class.
Integral *const & integral_pt() const
Return the pointer to the integration scheme (const version)
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....
virtual Node * construct_node(const unsigned &n)
Construct the local node n and return a pointer to the newly created node object.
virtual double interpolated_x(const Vector< double > &s, const unsigned &i) const
Return FE interpolated coordinate x[i] at local coordinate s.
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.
Node ** Node_pt
Storage for pointers to the nodes in the element.
virtual Node * construct_boundary_node(const unsigned &n)
Construct the local node n as a boundary node; that is a node that MAY be placed on a mesh boundary a...
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
virtual unsigned nnode_1d() const
Return the number of nodes along one edge of the element Default is to return zero — must be overload...
A Generalised Element class.
bool is_halo() const
Is this element a halo?
int non_halo_proc_ID()
ID of processor ID that holds non-halo counterpart of halo element; negative if not a halo.
bool must_be_kept_as_halo() const
Test whether the element must be kept as a halo element.
Generalised timestepper that can serve a variety of purposes in continuation, bifurcation detection a...
A geometric object is an object that provides a parametrised description of its shape via the functio...
unsigned ndim() const
Access function to # of Eulerian coordinates.
TimeStepper *& time_stepper_pt()
Access function for pointer to time stepper: Null if object is not time-dependent.
virtual double knot(const unsigned &i, const unsigned &j) const =0
Return local coordinate s[j] of i-th integration point.
virtual unsigned nweight() const =0
Return the number of integration points of the scheme.
MacroElementNodeUpdateMeshes contain MacroElementNodeUpdateNodes which have their own node update fun...
MacroElementNodeUpdate nodes are nodes with a positional update function, based on their element's Ma...
This class provides a GeomObject representation of a given finite element mesh. The Lagrangian coordi...
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
virtual bool is_on_boundary() const
Test whether the Node lies on a boundary. The "bulk" Node cannot lie on a boundary,...
void set_obsolete()
Mark node as obsolete.
void set_non_obsolete()
Mark node as non-obsolete.
virtual void set_coordinates_on_boundary(const unsigned &b, const unsigned &k, const Vector< double > &boundary_zeta)
Set the vector of the k-th generalised boundary coordinates on mesh boundary b. Broken virtual interf...
double & x(const unsigned &i)
Return the i-th nodal coordinate.
virtual void get_coordinates_on_boundary(const unsigned &b, const unsigned &k, Vector< double > &boundary_zeta)
Return the vector of the k-th generalised boundary coordinates on mesh boundary b....
void resize(const unsigned &n_value)
Resize the number of equations.
Helper object for dealing with the parameters used for the NonRefineableBinArray objects.
An oomph-lib wrapper to the MPI_Comm communicator object. Just contains an MPI_Comm object (which is ...
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....
Unstructured refineable Triangle Mesh.
void construct_new_halo_node_helper(Node *&new_nod_pt, Vector< Node * > &new_nodes_on_domain, Vector< Vector< Vector< std::map< unsigned, Node * > > > > &other_proc_shd_bnd_node_pt, unsigned &iproc, unsigned &node_index, FiniteElement *const &new_el_pt, Vector< Vector< Vector< unsigned > > > &global_node_names, std::map< Vector< unsigned >, unsigned > &node_name_to_global_index, Vector< Node * > &global_shared_node_pt)
Helper function which constructs a new halo node (on an element) with the information sent from the h...
void add_received_node_load_balance_helper(Node *&new_nod_pt, Vector< Vector< FiniteElement * > > &f_haloed_ele_pt, Vector< Vector< std::map< unsigned, FiniteElement * > > > &received_old_haloed_element_pt, Vector< Node * > &new_nodes_on_domain, Vector< Vector< Vector< std::map< unsigned, Node * > > > > &other_proc_shd_bnd_node_pt, unsigned &iproc, unsigned &node_index, FiniteElement *const &new_el_pt, Vector< Vector< Vector< unsigned > > > &global_node_names, std::map< Vector< unsigned >, unsigned > &node_name_to_global_index, Vector< Node * > &global_shared_node_pt)
Helper function to add a new node from load balance.
bool update_shared_curve_using_elements_area(Vector< TriangleMeshPolyLine * > &vector_polyline_pt, const Vector< double > &target_areas)
Updates the polylines using the elements area as constraint for the number of points along the bounda...
bool get_connected_vertex_number_on_dst_boundary(Vector< double > &vertex_coordinates, const unsigned &dst_b_id, unsigned &vertex_number)
Computes the associated vertex number on the destination boundary.
void send_boundary_node_info_of_shared_nodes(Vector< Vector< Vector< unsigned > > > &global_node_names, std::map< Vector< unsigned >, unsigned > &node_name_to_global_index, Vector< Node * > &global_shared_node_pt)
Get the original boundaries to which is associated each shared node, and send the info....
void update_shared_curve_after_restart(Vector< TriangleMeshPolyLine * > &vector_polyline_pt)
Updates the shared polylines representation after restart.
void send_and_receive_elements_nodes_info(int &send_proc, int &recv_proc)
Helper function to send back halo and haloed information.
void add_halo_node_helper(Node *&new_nod_pt, Vector< Node * > &new_nodes_on_domain, Vector< Vector< Vector< std::map< unsigned, Node * > > > > &other_proc_shd_bnd_node_pt, unsigned &iproc, unsigned &node_index, FiniteElement *const &new_el_pt, Vector< Vector< Vector< unsigned > > > &global_node_names, std::map< Vector< unsigned >, unsigned > &node_name_to_global_index, Vector< Node * > &global_shared_node_pt)
Helper function to add halo node.
void snap_nodes_onto_boundary(RefineableTriangleMesh< ELEMENT > *&new_mesh_pt, const unsigned &b)
Snap the boundary nodes onto any curvilinear boundaries.
void reset_shared_boundary_elements_and_nodes(const bool flush_elements=true, const bool update_elements=true, const bool flush_nodes=true, const bool update_nodes=true)
Re-establish the shared boundary elements after the adaptation process (the updating of shared nodes ...
bool unrefine_shared_boundary_constrained_by_target_area(const unsigned &b, const unsigned &c, Vector< Vector< double > > &vector_bnd_vertices, Vector< double > &area_constraint)
Helper function that performs the unrefinement process on the specified boundary by using the provide...
void get_boundary_segment_nodes_helper(const unsigned &b, Vector< Vector< Node * > > &tmp_segment_nodes)
Get the nodes on the boundary (b), these are stored in the segment they belong (also used by the load...
bool unrefine_boundary(const unsigned &b, const unsigned &c, Vector< Vector< double > > &vector_bnd_vertices, double &unrefinement_tolerance, const bool &check_only=false)
Helper function that performs the unrefinement process.
void get_face_mesh_representation(TriangleMeshPolygon *polygon_pt, Vector< Mesh * > &face_mesh_pt)
Helper function to construct face mesh representation of all polylines, possibly with segments re-dis...
void add_non_delete_vertices_from_boundary_helper(Vector< Vector< Node * > > src_bound_segment_node_pt, Vector< Vector< Node * > > dst_bound_segment_node_pt, const unsigned &dst_bnd_id, const unsigned &dst_bnd_chunk)
Adds the vertices from the sources boundary that are repeated in the destination boundary to the list...
void add_node_load_balance_helper(unsigned &iproc, Vector< Vector< FiniteElement * > > &f_halo_ele_pt, Vector< Node * > &new_nodes_on_domain, Node *nod_pt)
Helper function to add haloed node.
void compute_shared_node_degree_helper(Vector< Vector< FiniteElement * > > &unsorted_face_ele_pt, std::map< Node *, unsigned > &global_node_degree)
Computes the degree of the nodes on the shared boundaries, the degree of the node is computed from th...
void resume_boundary_connections(Vector< TriangleMeshPolyLine * > &resume_initial_connection_polyline_pt, Vector< TriangleMeshPolyLine * > &resume_final_connection_polyline_pt)
Resume the boundary connections that may have been suspended because the destination boundary is no p...
void get_required_elemental_information_load_balance_helper(unsigned &iproc, Vector< Vector< FiniteElement * > > &f_haloed_ele_pt, FiniteElement *ele_pt)
Helper function to get the required elemental information from the element to be sent....
void sort_nodes_on_shared_boundaries()
Sort the nodes on shared boundaries so that the processors that share a boundary agree with the order...
bool update_open_curve_using_elements_area(TriangleMeshOpenCurve *&open_curve_pt, const Vector< double > &target_area)
Updates the open curve but using the elements area instead of the default refinement and unrefinement...
void construct_new_node_load_balance_helper(Node *&new_nod_pt, Vector< Vector< FiniteElement * > > &f_haloed_ele_pt, Vector< Vector< std::map< unsigned, FiniteElement * > > > &received_old_haloed_element_pt, Vector< Node * > &new_nodes_on_domain, Vector< Vector< Vector< std::map< unsigned, Node * > > > > &other_proc_shd_bnd_node_pt, unsigned &iproc, unsigned &node_index, FiniteElement *const &new_el_pt, Vector< Vector< Vector< unsigned > > > &global_node_names, std::map< Vector< unsigned >, unsigned > &node_name_to_global_index, Vector< Node * > &global_shared_node_pt)
Helper function which constructs a new node (on an element) with the information sent from the load b...
void create_halo_element(unsigned &iproc, Vector< Node * > &new_nodes_on_domain, Vector< Vector< Vector< std::map< unsigned, Node * > > > > &other_proc_shd_bnd_node_pt, Vector< Vector< Vector< unsigned > > > &global_node_names, std::map< Vector< unsigned >, unsigned > &node_name_to_global_index, Vector< Node * > &global_shared_node_pt)
Helper function to create (halo) elements on the loop process based on the info received in send_and_...
void get_shared_boundary_elements_and_face_indexes(const Vector< FiniteElement * > &first_element_pt, const Vector< FiniteElement * > &second_element_pt, Vector< FiniteElement * > &first_shared_boundary_element_pt, Vector< unsigned > &first_shared_boundary_element_face_index, Vector< FiniteElement * > &second_shared_boundary_element_pt, Vector< unsigned > &second_shared_boundary_element_face_index)
Use the first and second group of elements to find the intersection between them to get the shared bo...
void create_sorted_face_mesh_representation(const unsigned &boundary_id, Mesh *face_mesh_pt, std::map< FiniteElement *, bool > &is_inverted, bool &inverted_face_mesh)
Helper function Creates a sorted face mesh representation of the specified PolyLine It means that the...
void update_open_curve_after_restart(TriangleMeshOpenCurve *&open_curve_pt)
Updates the open curve representation after restart.
void reset_halo_haloed_scheme()
In charge of. re-establish the halo(ed) scheme on all processors. Sends info. to create halo elements...
bool refine_boundary(Mesh *face_mesh_pt, Vector< Vector< double > > &vector_bnd_vertices, double &refinement_tolerance, const bool &check_only=false)
Helper function that performs the refinement process on the specified boundary by using the provided ...
void create_element_load_balance_helper(unsigned &iproc, Vector< Vector< FiniteElement * > > &f_haloed_ele_pt, Vector< Vector< std::map< unsigned, FiniteElement * > > > &received_old_haloed_element_pt, Vector< FiniteElement * > &new_elements_on_domain, Vector< Node * > &new_nodes_on_domain, Vector< Vector< Vector< std::map< unsigned, Node * > > > > &other_proc_shd_bnd_node_pt, Vector< Vector< Vector< unsigned > > > &global_node_names, std::map< Vector< unsigned >, unsigned > &node_name_to_global_index, Vector< Node * > &global_shared_node_pt)
Helper function to create elements on the loop process based on the info received in send_and_receive...
void create_new_shared_boundaries(std::set< FiniteElement * > &element_in_processor_pt, Vector< Vector< FiniteElement * > > &new_shared_boundary_element_pt, Vector< Vector< unsigned > > &new_shared_boundary_element_face_index)
Creates the new shared boundaries, this method is also in charge of computing the shared boundaries i...
void get_shared_boundary_segment_nodes_helper(const unsigned &shd_bnd_id, Vector< Vector< Node * > > &tmp_segment_nodes)
Get the nodes on the shared boundary (b), these are stored in the segment they belong.
void refine_triangulateio(TriangulateIO &triangulate_io, const Vector< double > &target_area, TriangulateIO &triangle_refine)
Build a new TriangulateIO object from previous TriangulateIO based on target area for each element.
void load_balance(const Vector< unsigned > &input_target_domain_for_local_non_halo_element)
Performs the load balancing for unstructured meshes, the load balancing strategy is based on mesh mig...
void create_unsorted_face_mesh_representation(const unsigned &boundary_id, Mesh *face_mesh_pt)
Helper function Creates an unsorted face mesh representation from the specified boundary id....
void add_element_load_balance_helper(const unsigned &iproc, Vector< Vector< std::map< unsigned, FiniteElement * > > > &received_old_haloed_element_pt, FiniteElement *ele_pt)
Helper function to create elements on the loop process based on the info received in send_and_receive...
void restore_boundary_connections(Vector< TriangleMeshPolyLine * > &resume_initial_connection_polyline_pt, Vector< TriangleMeshPolyLine * > &resume_final_connection_polyline_pt)
After unrefinement and refinement has taken place compute the new vertices numbers of the boundaries ...
bool update_open_curve_using_face_mesh(TriangleMeshOpenCurve *open_polyline_pt, const bool &check_only=false)
Helper function that updates the input open curve by using end-points of elements from FaceMesh(es) t...
bool apply_max_length_constraint(Mesh *face_mesh_pt, Vector< Vector< double > > &vector_bnd_vertices, double &max_length_constraint)
bool refine_boundary_constrained_by_target_area(MeshAsGeomObject *mesh_geom_obj_pt, Vector< Vector< double > > &vector_bnd_vertices, double &refinement_tolerance, Vector< double > &area_constraint)
Helper function that performs the refinement process on the specified boundary by using the provided ...
void create_temporary_boundary_connections(Vector< TriangleMeshPolygon * > &tmp_outer_polygons_pt, Vector< TriangleMeshOpenCurve * > &tmp_open_curves_pt)
After unrefinement and refinement has taken place compute the new vertices numbers of the temporary r...
void add_haloed_node_helper(unsigned &iproc, Node *nod_pt)
Helper function to add haloed node.
void get_required_nodal_information_helper(unsigned &iproc, Node *nod_pt)
Helper function to get the required nodal information from a haloed node so that a fully-functional h...
void compute_global_node_names_and_shared_nodes(Vector< Vector< Vector< std::map< unsigned, Node * > > > > &other_proc_shd_bnd_node_pt, Vector< Vector< Vector< unsigned > > > &global_node_names, std::map< Vector< unsigned >, unsigned > &node_name_to_global_index, Vector< Node * > &global_shared_node_pt)
Compute the names of the nodes on shared boundaries in this (my_rank) processor with other processors...
void reset_halo_haloed_scheme_helper(Vector< Vector< Vector< std::map< unsigned, Node * > > > > &other_proc_shd_bnd_node_pt, Vector< Vector< Node * > > &iproc_currently_created_nodes_pt, Vector< Vector< Vector< unsigned > > > &global_node_names, std::map< Vector< unsigned >, unsigned > &node_name_to_global_index, Vector< Node * > &global_shared_node_pt)
In charge of creating additional halo(ed) elements on those processors that have no shared boundaries...
void get_required_nodal_information_load_balance_helper(Vector< Vector< FiniteElement * > > &f_halo_ele_pt, unsigned &iproc, Node *nod_pt)
Helper function to get the required nodal information from an haloed node so that a fully-functional ...
bool unrefine_boundary_constrained_by_target_area(const unsigned &b, const unsigned &c, Vector< Vector< double > > &vector_bnd_vertices, double &unrefinement_tolerance, Vector< double > &area_constraint)
Helper function that performs the unrefinement process on the specified boundary by using the provide...
void add_halo_element_helper(unsigned &iproc, FiniteElement *ele_pt)
Helper function to create (halo) elements on the loop process based on the info received in send_and_...
void update_other_proc_shd_bnd_node_helper(Node *&new_nod_pt, Vector< Vector< Vector< std::map< unsigned, Node * > > > > &other_proc_shd_bnd_node_pt, Vector< unsigned > &other_processor_1, Vector< unsigned > &other_processor_2, Vector< unsigned > &other_shared_boundaries, Vector< unsigned > &other_indexes, Vector< Vector< Vector< unsigned > > > &global_node_names, std::map< Vector< unsigned >, unsigned > &node_name_to_global_index, Vector< Node * > &global_shared_node_pt)
Helper function that assigns/updates the references to the node so that it can be found with any othe...
void create_adjacency_matrix_new_shared_edges_helper(Vector< Vector< FiniteElement * > > &unsorted_face_ele_pt, Vector< Vector< Node * > > &tmp_sorted_shared_node_pt, std::map< Node *, Vector< Vector< unsigned > > > &node_alias, Vector< Vector< Vector< unsigned > > > &adjacency_matrix)
Sort the nodes on the new shared boundaries (after load balancing), computes the alias of the nodes a...
void fill_boundary_elements_and_nodes_for_internal_boundaries()
bool refine_shared_boundary_constrained_by_target_area(Vector< Vector< double > > &vector_bnd_vertices, Vector< double > &area_constraint)
Helper function that performs the refinement process on the specified boundary by using the provided ...
bool update_polygon_using_face_mesh(TriangleMeshPolygon *polygon_pt, const bool &check_only=false)
Helper function that updates the input polygon's PSLG by using the end-points of elements from FaceMe...
void update_polygon_after_restart(TriangleMeshPolygon *&polygon_pt)
Updates the polylines representation after restart.
void add_vertices_for_non_deletion()
Mark the vertices that are not allowed for deletion by the unrefienment/refinement polyline methods....
void create_polylines_from_polyfiles(const std::string &node_file_name, const std::string &poly_file_name)
Helper function to create polylines and fill associate data.
bool update_polygon_using_elements_area(TriangleMeshPolygon *&polygon_pt, const Vector< double > &target_area)
Updates the polylines using the elements area as constraint for the number of points along the bounda...
void restore_polyline_connections_helper(TriangleMeshPolyLine *polyline_pt, Vector< TriangleMeshPolyLine * > &resume_initial_connection_polyline_pt, Vector< TriangleMeshPolyLine * > &resume_final_connection_polyline_pt)
Restore the connections of the specific polyline The vertices numbering on the destination boundaries...
void adapt(const Vector< double > &elem_error)
Adapt mesh, based on elemental error provided.
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...
TAdvectionDiffusionReactionElement()
Constructor: Call constructors for TElement and AdvectionDiffusionReaction equations.
Base class for time-stepping schemes. Timestepper provides an approximation of the temporal derivativ...
unsigned ntstorage() const
Return the number of doubles required to represent history (one for steady)
Class to keep track of discrete/continous time. It is essential to have a single Time object when usi...
Base class for defining a triangle mesh boundary, this class has the methods that allow to connect th...
void suspend_final_vertex_connected()
Set the final vertex connection as suspended, it will be resumed when the method to resume the connec...
unsigned initial_vertex_connected_n_vertex() const
Gets the vertex number to which the initial end is connected.
unsigned final_vertex_connected_n_chunk() const
Gets the boundary chunk to which the final end is connected.
unsigned final_vertex_connected_n_vertex() const
Sets the vertex number to which the final end is connected.
bool is_final_vertex_connected() const
Test whether final vertex is connected or not.
unsigned initial_vertex_connected_bnd_id() const
Gets the id to which the initial end is connected.
bool is_initial_vertex_connected() const
Test whether initial vertex is connected or not.
void set_initial_vertex_connected()
Sets the initial vertex as connected.
void set_final_vertex_connected()
Sets the final vertex as connected.
void suspend_initial_vertex_connected()
Set the initial vertex connection as suspended, it will be resumed when the method to resume the conn...
unsigned initial_vertex_connected_n_chunk() const
Gets the boundary chunk to which the initial end is connected.
unsigned final_vertex_connected_bnd_id() const
Gets the id to which the final end is connected.
Base class defining an open curve for the Triangle mesh generation Basically used to define internal ...
Helper object for dealing with the parameters used for the TriangleMesh objects.
Class defining a polyline for use in Triangle Mesh generation.
Vector< double > vertex_coordinate(const unsigned &i) const
Coordinate vector of i-th vertex (const version)
unsigned nvertex() const
Number of vertices.
unsigned boundary_id() const
Boundary id.
Class defining a closed polygon for the Triangle mesh generation.
const int check_connections_of_polyline_nodes(std::set< FiniteElement * > &element_in_processor_pt, const int &root_edge_bnd_id, std::map< std::pair< Node *, Node * >, bool > &overlapped_face, std::map< unsigned, std::map< Node *, bool > > &node_on_bnd_not_overlapped_by_shd_bnd, std::list< Node * > ¤t_polyline_nodes, std::map< unsigned, std::list< Node * > > &shared_bnd_id_to_sorted_list_node_pt, const unsigned &node_degree, Node *&new_node_pt, const bool called_from_load_balance=false)
Check for any possible connections that the array of sorted nodes have with any previous boundaries o...
void compute_boundary_segments_connectivity_and_initial_zeta_values(const unsigned &b)
Compute the boundary segments connectivity for those boundaries that were splited during the distribu...
void break_loops_on_shared_polyline_helper(const unsigned &initial_shd_bnd_id, std::list< Node * > &input_nodes, Vector< FiniteElement * > &input_boundary_element_pt, Vector< int > &input_face_index_element, const int &input_connect_to_the_left, const int &input_connect_to_the_right, Vector< std::list< Node * > > &output_sorted_nodes_pt, Vector< Vector< FiniteElement * > > &output_boundary_element_pt, Vector< Vector< int > > &output_face_index_element, Vector< int > &output_connect_to_the_left, Vector< int > &output_connect_to_the_right)
Break any possible loop created by the sorted list of nodes that is used to create a new shared polyl...
void build_triangulateio(const std::string &poly_file_name, TriangulateIO &triangulate_io, bool &use_attributes)
Helper function to create TriangulateIO object (return in triangulate_io) from the ....
void create_shared_boundaries(OomphCommunicator *comm_pt, const Vector< unsigned > &element_domain, const Vector< GeneralisedElement * > &backed_up_el_pt, const Vector< FiniteElement * > &backed_up_f_el_pt, std::map< Data *, std::set< unsigned > > &processors_associated_with_data, const bool &overrule_keep_as_halo_element_status)
Creates the shared boundaries.
void create_shared_polylines_connections()
Establish the connections of the polylines previously marked as having connections....
void break_loops_on_shared_polyline_load_balance_helper(const unsigned &initial_shd_bnd_id, std::list< Node * > &input_nodes, Vector< FiniteElement * > &input_boundary_element_pt, Vector< FiniteElement * > &input_boundary_face_element_pt, Vector< int > &input_face_index_element, const int &input_connect_to_the_left, const int &input_connect_to_the_right, Vector< std::list< Node * > > &output_sorted_nodes_pt, Vector< Vector< FiniteElement * > > &output_boundary_element_pt, Vector< Vector< FiniteElement * > > &output_boundary_face_element_pt, Vector< Vector< int > > &output_face_index_element, Vector< int > &output_connect_to_the_left, Vector< int > &output_connect_to_the_right)
Break any possible loop created by the sorted list of nodes that is used to create a new shared polyl...
void synchronize_boundary_coordinates(const unsigned &b)
In charge of sinchronize the boundary coordinates for internal boundaries that were split as part of ...
void compute_holes_left_by_halo_elements_helper(Vector< Vector< double > > &output_holes_coordinates)
Compute the holes left by the halo elements, those adjacent to the shared boundaries.
void identify_boundary_segments_and_assign_initial_zeta_values(const unsigned &b, Vector< FiniteElement * > &input_face_ele_pt, const bool &is_internal_boundary, std::map< FiniteElement *, FiniteElement * > &face_to_bulk_element_pt)
Identify the segments from the old mesh (original mesh) in the new mesh (this) and assign initial and...
virtual void reset_boundary_element_info(Vector< unsigned > &ntmp_boundary_elements, Vector< Vector< unsigned > > &ntmp_boundary_elements_in_region, Vector< FiniteElement * > &deleted_elements)
Virtual function to perform the reset boundary elements info routines. Generally used after load bala...
void re_scale_re_assigned_initial_zeta_values_for_internal_boundary(const unsigned &b)
Re-scale the re-assigned zeta values for the boundary nodes, apply only for internal boundaries.
void create_shared_polyline(const unsigned &my_rank, const unsigned &shd_bnd_id, const unsigned &iproc, const unsigned &jproc, std::list< Node * > &sorted_nodes, const int &root_edge_bnd_id, Vector< FiniteElement * > &bulk_bnd_ele_pt, Vector< int > &face_index_ele, Vector< Vector< TriangleMeshPolyLine * > > &unsorted_polylines_pt, const int &connect_to_the_left_flag, const int &connect_to_the_right_flag)
Create the shared polyline and fill the data structured that keep all the information associated with...
void update_holes_information_helper(Vector< TriangleMeshPolygon * > &polygons_pt, Vector< Vector< double > > &output_holes_coordinates)
Keeps those vertices that define a hole, those that are inside closed internal boundaries in the new ...
void create_distributed_domain_representation(Vector< TriangleMeshPolygon * > &polygons_pt, Vector< TriangleMeshOpenCurve * > &open_curves_pt)
Creates the distributed domain representation. Joins the original boundaires, shared boundaries and c...
void build_from_scaffold(TimeStepper *time_stepper_pt, const bool &use_attributes)
Build mesh from scaffold.
void sort_polylines_helper(Vector< TriangleMeshPolyLine * > &unsorted_polylines_pt, Vector< Vector< TriangleMeshPolyLine * > > &sorted_polylines_pt)
Sorts the polylines so they be continuous and then we can create a closed or open curve from them.
void create_tmp_open_curves_helper(Vector< Vector< TriangleMeshPolyLine * > > &sorted_open_curves_pt, Vector< TriangleMeshPolyLine * > &unsorted_shared_to_internal_poly_pt, Vector< TriangleMeshOpenCurve * > &open_curves_pt)
Take the polylines from the original open curves and created new temporaly representations of open cu...
void get_halo_elements_on_all_procs(const unsigned &nproc, const Vector< unsigned > &element_domain, const Vector< GeneralisedElement * > &backed_up_el_pt, std::map< Data *, std::set< unsigned > > &processors_associated_with_data, const bool &overrule_keep_as_halo_element_status, std::map< GeneralisedElement *, unsigned > &element_to_global_index, Vector< Vector< Vector< GeneralisedElement * > > > &output_halo_elements_pt)
Creates the halo elements on all processors Gets the halo elements on all processors,...
void dump_distributed_info_for_restart(std::ostream &dump_file)
Used to dump info. related with distributed triangle meshes.
void re_assign_initial_zeta_values_for_internal_boundary(const unsigned &b, Vector< std::list< FiniteElement * > > &old_segment_sorted_ele_pt, std::map< FiniteElement *, bool > &old_is_inverted)
Re-assign the boundary segments initial zeta (arclength) value for those internal boundaries that wer...
void read_distributed_info_for_restart(std::istream &restart_file)
Used to read info. related with distributed triangle meshes.
void select_boundary_face_elements(Vector< FiniteElement * > &face_el_pt, const unsigned &b, bool &is_internal_boundary, std::map< FiniteElement *, FiniteElement * > &face_to_bulk_element_pt)
Select face element from boundary using the criteria to decide which of the two face elements should ...
void create_polylines_from_halo_elements_helper(const Vector< unsigned > &element_domain, std::map< GeneralisedElement *, unsigned > &element_to_global_index, std::set< FiniteElement * > &element_in_processor_pt, Vector< Vector< Vector< GeneralisedElement * > > > &input_halo_elements, std::map< std::pair< Node *, Node * >, unsigned > &elements_edges_on_boundary, Vector< Vector< Vector< TriangleMeshPolyLine * > > > &output_polylines_pt)
Creates polylines from the intersection of halo elements on all processors. The new polylines define ...
void output_boundary_coordinates(const unsigned &b, std::ostream &outfile)
Output the nodes on the boundary and their respective boundary coordinates(into separate tecplot zone...
void create_tmp_polygons_helper(Vector< Vector< TriangleMeshPolyLine * > > &polylines_pt, Vector< TriangleMeshPolygon * > &polygons_pt)
Take the polylines from the shared boundaries and create temporary polygon representations of the dom...
void get_element_edges_on_boundary(std::map< std::pair< Node *, Node * >, unsigned > &element_edges_on_boundary)
Get the element edges (pair of nodes, edges) that lie on a boundary (used to mark shared boundaries t...
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...
bool Doc_timings
Boolean to indicate whether to doc timings or not.
bool Doc_stats
Boolean to indicate whether to output basic info during setup_multi_domain_interaction() routines.
bool Doc_full_stats
Boolean to indicate whether to output further info during setup_multi_domain_interaction() routines.
double timer()
returns the time in seconds after some point in past
double Tolerable_error
Acceptable discrepancy for mismatch in vertex coordinates. In paranoid mode, the code will die if the...
void initialise_triangulateio(TriangulateIO &triangle_io)
Initialise TriangulateIO structure.
void clear_triangulateio(TriangulateIO &triangulate_io, const bool &clear_hole_data)
Clear TriangulateIO structure.
TriangulateIO deep_copy_of_triangulateio_representation(TriangulateIO &triangle_io, const bool &quiet)
Make (partial) deep copy of TriangulateIO object. We only copy those items we need within oomph-lib's...
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).
struct oomph::classcomp Bottom_left_sorter
OomphInfo oomph_info
Single (global) instantiation of the OomphInfo object – this is used throughout the library as a "rep...
The Triangle data structure, modified from the triangle.h header supplied with triangle 1....
bool operator()(const std::pair< double, double > &lhs, const std::pair< double, double > &rhs) const