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.
35#include "generic/map_matrix.h"
36#include "generic/multi_domain.h"
37#include "generic/projection.h"
38#include "generic/face_element_as_geometric_object.h"
46 template<
class ELEMENT>
51 MeshChecker::assert_geometric_element<TElementGeometricBase, ELEMENT>(2);
120 for (
unsigned e = 0;
e <
nelem;
e++)
248 for (
unsigned e = 0;
e <
nelem;
e++)
269 for (
unsigned i = 0;
i <
dim;
i++)
283 for (
unsigned j = 0;
j < 3;
j++)
319 for (
unsigned i = 0;
i <
dim;
i++)
363 static_cast<unsigned>(
Tmp_mesh_pt->element_attribute(
e));
370 .push_back((
j + 2) % 3);
388 template<
class ELEMENT>
448 if (this->is_mesh_distributed() &&
bulk_elem_pt->is_halo())
469 std::pair<Node*, Node*>
tmp_pair = std::make_pair(
531 for (
unsigned e = 0;
e <
nele;
e++)
538 if (this->is_mesh_distributed() &&
bulk_elem_pt->is_halo())
558 std::pair<Node*, Node*>
tmp_pair = std::make_pair(
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()",
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;
733 <<
"Could not find an initial face element for the current segment\n";
735 "TriangleMesh::identify_boundary_segments_and_"
736 "assign_initial_zeta_values()",
861 <<
"The number of segments is zero, but the number of nonhalo\n"
864 "TriangleMesh::identify_boundary_segments_and_assign_"
865 "initial_zeta_values()",
880 "TriangleMesh::identify_boundary_segments_and_"
881 "assign_initial_zeta_values()",
933 for (std::list<FiniteElement*>::iterator
it =
951 for (
unsigned j = 1;
j <
nnod;
j++)
1001 <<
") and the number of "
1003 <<
") representing\n"
1004 <<
"the\nsegments is different!!!\n\n";
1044 <<
"The number of segments that present initial coordinates "
1046 <<
"the\nnumber of segments that present final coordinates "
1059 <<
").\n The number of initial and "
1061 <<
") is different from\n"
1062 <<
"the number of found segments (" <<
nsegments
1086 for (
unsigned k = 0;
k < 2;
k++)
1166 for (
unsigned i = 0;
i < 2;
i++)
1196 if (
dist < ToleranceForVertexMismatchInPolygons::Tolerable_error)
1208 if (
dist < ToleranceForVertexMismatchInPolygons::Tolerable_error)
1265 ToleranceForVertexMismatchInPolygons::Tolerable_error)
1279 ToleranceForVertexMismatchInPolygons::Tolerable_error)
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";
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) <<
", "
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: ("
1573 if (std::fabs(
zeta[0] - 1.0) < 1.0e-14)
1577 else if (std::fabs(
zeta[0]) < 1.0e-14)
1621 if (std::fabs(
zeta[0] - 1.0) < 1.0e-14)
1625 else if (std::fabs(
zeta[0]) < 1.0e-14)
1668 if (std::fabs(
zeta[0] - 1.0) < 1.0e-14)
1672 else if (std::fabs(
zeta[0]) < 1.0e-14)
1715 if (std::fabs(
zeta[0] - 1.0) < 1.0e-14)
1719 else if (std::fabs(
zeta[0]) < 1.0e-14)
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)
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)
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) <<
", "
1825 for (
unsigned i = 0;
i <
nele;
i++)
1838 template<
class ELEMENT>
1869 select_boundary_face_elements(
1923 std::map<FiniteElement*, bool>
done_el;
1972 <<
"Could not find an initial face element for the current segment\n";
2086 <<
"The number of segments is zero, but the number of nonhalo\n"
2175 for (std::list<FiniteElement*>::iterator
it =
2194 for (
unsigned j = 1;
j <
nnod;
j++)
2278 for (std::list<FiniteElement*>::iterator
it_seg =
2439 <<
"The current bulk element (left) is marked as halo but "
2440 <<
"the processor holding\nthe non-halo counterpart is "
2481 <<
"The current bulk element (left) marked as halo was "
2482 <<
"not found in the vector of halo\nelements associated "
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";
2545 <<
"The current bulk element (left) marked as haloed was "
2546 <<
"not found in the vector of haloed\nelements associated "
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()",
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()",
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()",
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()",
2745 const unsigned spu = 7;
2835 const unsigned spd = 1;
3045 std::map<std::pair<unsigned, unsigned>,
bool>
done_segment;
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()",
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()",
3388 <<
"boundary (" <<
b
3389 <<
")\nis different from the total number of "
3391 <<
") in all\nprocessors.\n\n";
3414 for (std::list<std::pair<unsigned, unsigned>>::iterator
it_list =
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;
3539 const unsigned rspd = 1;
3705 <<
")-th segment is halo\n";
3707 "TriangleMesh::compute_boundary_segments_"
3708 "connectivity_and_initial_zeta_values()",
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++)
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++)
3934 for (
unsigned i = 0;
i < 2;
i++)
3990 for (
unsigned i = 0;
i < 2;
i++)
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>
4164 std::pair<Node*, Node*>
tmp_pair = std::make_pair(
4223 for (
unsigned e = 0;
e <
nele;
e++)
4247 std::pair<Node*, Node*>
tmp_pair = std::make_pair(
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;
4372 <<
"Could not find an initial face element for the current segment\n";
4375 "TriangleMesh::re_assign_initial_zeta_values_for_internal_boundary()",
4481 <<
"The number of segments is zero, but the number of nonhalo\n"
4525 "TriangleMesh::re_assign_initial_zeta_values_for_internal_boundary()",
4588 for (std::list<FiniteElement*>::iterator
it =
4606 for (
unsigned j = 1;
j <
nnod;
j++)
4702 for (
unsigned i = 0;
i < 2;
i++)
4849 for (
unsigned i = 0;
i < 2;
i++)
4867 for (
unsigned i = 0;
i < 2;
i++)
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()",
5171 for (
unsigned i = 0;
i < 2;
i++)
5189 for (
unsigned i = 0;
i < 2;
i++)
5254 <<
").\nThe number of re-assigned "
5256 <<
") is different from the number\nof segments ("
5260 "TriangleMesh::re_assign_initial_zeta_values_for_internal_boundary()",
5266 for (
unsigned i = 0;
i <
nele;
i++)
5282 template<
class ELEMENT>
5393 std::map<FiniteElement*, bool>
done_face;
5611 template<
class ELEMENT>
5722 std::map<FiniteElement*, bool>
done_face;
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()",
6004 <<
"The node was marked to be halo but the processor in "
6005 <<
"charge was found to be -1\n\n";
6008 "TriangleMesh::synchronize_boundary_coordinates()",
6044 <<
"The halo id of the current node: (" <<
face_node_pt->x(0)
6046 <<
") was not found!!!\n\n";
6049 "TriangleMesh::synchronize_boundary_coordinates()",
6125 <<
") is different from the number of\nfound halo face ids ("
6129 "TriangleMesh::synchronize_boundary_coordinates()",
6280 <<
"number\nof double received data ("
6284 "TriangleMesh::synchronize_boundary_coordinates()",
6510 <<
"number\nof double received data ("
6514 "TriangleMesh::synchronize_boundary_coordinates()",
6560 re_scale_re_assigned_initial_zeta_values_for_internal_boundary(
b);
6570 template<
class ELEMENT>
6643 std::pair<Node*, Node*>
tmp_pair = std::make_pair(
6702 for (
unsigned e = 0;
e <
nele;
e++)
6727 std::pair<Node*, Node*>
tmp_pair = std::make_pair(
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;
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()",
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()",
6990 "TriangleMesh::re_scale_re_assigned_initial_zeta_"
6991 "values_for_internal_boundary()",
7043 for (std::list<FiniteElement*>::iterator
it =
7061 for (
unsigned j = 1;
j <
nnod;
j++)
7160 for (
unsigned i = 0;
i < 2;
i++)
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;
7436#ifdef OOMPH_HAS_TRIANGLE_LIB
7442 template<
class ELEMENT>
7447 if (this->is_mesh_distributed())
7450 const unsigned nboundary = this->nboundary();
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;
7548 dump_file <<
"1 # assigned boundary coordinates initial zeta values"
7562 <<
" # initial coordinates for the current boundary"
7567 <<
" # final coordinates for the current boundary"
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";
7586 "TriangleMesh::dump_distributed_info_for_restart()",
7596 <<
" # initial zeta value for the current boundary"
7600 <<
" # final zeta value for the current boundary"
7607 <<
" # of segments for the current boundary" << std::endl;
7621 <<
" # initial segment coordinates for the current boundary"
7626 <<
" # final segment coordinates for the current boundary"
7640 <<
" # initial segment zeta value for the current boundary"
7645 <<
" # final segment zeta value for the current boundary"
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())
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())
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()
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";
7919 "TriangleMesh::read_distributed_info_for_restart()",
8019 template<
class ELEMENT>
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))
8200 <<
") was marked to be splitted but\n"
8202 <<
") polylines to represent it.\n";
8219 <<
"The current chunk (" <<
isub <<
") of the polyline with\n"
8220 <<
"boundary id (" <<
bound_id <<
") has no vertices\n";
8273 if (!boundary_was_splitted(
bound_id))
8288 <<
") was marked to be splitted but\n"
8290 <<
") polylines to represent it.\n";
8308 <<
"The current chunk (" <<
isub <<
") of the polyline with\n"
8309 <<
"boundary id (" <<
bound_id <<
") has no vertices\n";
8364 if (!boundary_was_splitted(
bound_id))
8368 if (!boundary_marked_as_shared_boundary(
bound_id, 0))
8384 <<
") was marked to be splitted but\n"
8386 <<
") polylines to represent it.\n";
8398 if (!boundary_marked_as_shared_boundary(
bound_id,
isub))
8409 <<
"The current chunk (" <<
isub <<
") of the polyline with\n"
8410 <<
"boundary id (" <<
bound_id <<
") has no vertices\n";
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();
8582 if (First_time_compute_holes_left_by_halo_elements)
8585 const unsigned n_extra_holes = Extra_holes_coordinates.size();
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()",
8727 if (
diff < ToleranceForVertexMismatchInPolygons::Tolerable_error)
8801 if (
diff < ToleranceForVertexMismatchInPolygons::Tolerable_error)
8827 if (
diff < ToleranceForVertexMismatchInPolygons::Tolerable_error)
8867 if (
diff < ToleranceForVertexMismatchInPolygons::Tolerable_error)
8890 if (
diff < ToleranceForVertexMismatchInPolygons::Tolerable_error)
8931 if (
diff < ToleranceForVertexMismatchInPolygons::Tolerable_error)
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";
8965 <<
"-----------------------------------\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 =
9255 std::set<FiniteElement*>::iterator
it =
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();
9377 const unsigned n_nodes = (*it).second.size();
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()",
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(
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()",
9895 <<
"marked to be splitted but\n"
9896 <<
"there are only (" <<
nsub_poly <<
") polylines to "
9897 <<
"represent it.\n";
9900 "TriangleMesh::create_shared_polylines_connections()",
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(
10069 if (!boundary_marked_as_shared_boundary(
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()",
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(
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()",
10521 <<
"marked to be splitted but\n"
10522 <<
"there are only (" <<
nsub_poly <<
") polylines to "
10523 <<
"represent it.\n";
10526 "TriangleMesh::create_shared_polylines_connections()",
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(
10696 if (!boundary_marked_as_shared_boundary(
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>
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++)
11655 (
el_pt->must_be_kept_as_halo()))
11682 std::set<unsigned>::iterator
it =
11710 template<
class ELEMENT>
11720 std::map<std::pair<Node*, Node*>,
bool>
edge_done;
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++)
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;
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"
12507 "TriangleMesh::create_polylines_from_halo_elements_helper()",
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"
12528 "TriangleMesh::create_polylines_from_halo_elements_helper()",
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"
12548 "TriangleMesh::create_polylines_from_halo_elements_helper()",
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: ("
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>>
12638 for (std::map<std::pair<Node*, Node*>,
unsigned>::iterator
it_map =
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;
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";
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,
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>
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";
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";
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";
13438 "TriangleMesh::break_loops_on_shared_polyline_helper()",
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";
13880 "TriangleMesh::break_loops_on_shared_polyline_helper()",
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";
13933 "TriangleMesh::break_loops_on_shared_polyline_helper()",
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";
14153 "TriangleMesh::break_loops_on_shared_polyline_helper()",
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"
14167 "TriangleMesh::break_loops_on_shared_polyline_helper()",
14194 template<
class ELEMENT>
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";
14316 "TriangleMesh::break_loops_on_shared_polyline_load_balance_helper()",
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";
14353 "TriangleMesh::break_loops_on_shared_polyline_load_balance_helper()",
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";
14379 "TriangleMesh::break_loops_on_shared_polyline_load_balance_helper()",
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";
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] =
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()",
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()",
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()",
14838 polyline_pt->initial_vertex_connected_n_chunk() = 0;
14854 polyline_pt->final_vertex_connected_n_chunk() = 0;
14865 template<
class ELEMENT>
15054#ifdef OOMPH_HAS_TRIANGLE_LIB
15059 template<
class ELEMENT>
15151 std::stringstream
err;
15153 <<
" doesn't match\n"
15154 <<
"size of target area vector (" <<
target_area.size() <<
")\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 =
15345 for (
unsigned ii = 0;
ii < 2;
ii++)
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);
15384 for (std::map<std::pair<double, double>,
Node*>::iterator
it_map =
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);
15463 this->add_face_index_at_shared_boundary(
b,
face_index);
15485 template<
class ELEMENT>
15489 unsigned nproc = this->communicator_pt()->nproc();
15491 unsigned my_rank = this->communicator_pt()->my_rank();
15496 if (Global_timings::Doc_comprehensive_timings)
15498 tt_start = TimingHelpers::timer();
15554 if (Print_timings_level_adaptation > 1)
15560 oomph_info <<
"CPU for computing global node names and shared nodes "
15561 <<
"[n_ele=" <<
n_ele
15581 TimingHelpers::timer();
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++)
15723 TimingHelpers::timer();
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());
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)
15957 TimingHelpers::timer() -
15960 oomph_info <<
"CPU for re-generating halo(ed) elements/nodes "
15961 <<
"(first stage) [n_ele=" <<
n_ele <<
"]: "
15980 TimingHelpers::timer();
15990 if (Print_timings_level_adaptation > 1)
15994 TimingHelpers::timer() -
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)
16019 tt_end = TimingHelpers::timer();
16020 oomph_info <<
"CPU for resetting halo-haloed scheme (without "
16021 "classification of halo and haloed nodes): "
16037 if (Print_timings_level_adaptation > 1)
16039 tt_end = TimingHelpers::timer();
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;
16199 <<
"These are the node coordinates\n"
16487 std::map<Vector<unsigned>,
bool>
done_name;
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"
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();
17103 std::map<Vector<unsigned>,
unsigned>::iterator
it =
17109 if (
i != (*it).second)
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"
17131 <<
"The node name is not registerd as living in this processor.\n"
17135 <<
"shd_bnd_id:" <<
node_name[2] <<
"\n"
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";
17175 std::map<Vector<unsigned>,
unsigned>::iterator
it =
17181 if (
i != (*it).second)
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"
17203 <<
"The node name is not registerd as living in this processor.\n"
17207 <<
"shd_bnd_id:" <<
node_name[2] <<
"\n"
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 =
17312 <<
"We could not find the global shared node index associated\n"
17313 <<
"with the node pointer with vertices coordinates:\n"
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
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();
17790 for (std::set<GeneralisedElement*>::iterator
it =
iproc_ele_pt.begin();
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>
17997 const unsigned nbound = this->initial_shared_boundary_id();
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());
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());
18516 <<
"The node coordinates are (" <<
nod_pt->x(0) <<
","
18517 <<
nod_pt->x(1) <<
").\n";
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());
18704 <<
"), shared by other processors\nwas not found.\n"
18705 <<
"The node coordinates are (" <<
nod_pt->x(0) <<
","
18706 <<
nod_pt->x(1) <<
").\n";
18709 "RefineableTriangleMesh::get_required_nodal_information_helper()",
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: ("
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");
18800 AlgebraicMesh*
alg_mesh_pt =
dynamic_cast<AlgebraicMesh*
>(
this);
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>
19019#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
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";
19062#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
19066 << Flat_packed_unsigneds_string[
i] <<
": "
19067 << Flat_packed_unsigneds[
i] << std::endl;
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]
19238 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
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]
19294 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
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]
19346 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
19348 this->add_shared_boundary_element(
bnd,
ele_pt);
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++];
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"
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)
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";
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++];
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 ("
19690 "RefineableTriangleMesh::construct_new_halo_node_helper()",
19700 if (is_node_on_shared_boundary == 1)
19800 std::map<unsigned, Node*>::iterator
it =
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)
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)
20005 AlgebraicMesh*
alg_mesh_pt =
dynamic_cast<AlgebraicMesh*
>(
this);
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++];
20114 dynamic_cast<MacroElementNodeUpdateMesh*
>(
this);
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>
20334 std::map<Vector<unsigned>,
unsigned>::iterator
it =
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)
20513 error_message <<
"The number of non halo elements in the current mesh ("
20515 <<
"of target areas for the local non halo elements ("
20517 <<
") is different\n\n";
20536 if (Print_timings_level_load_balance > 1)
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)
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]: "
20888 << TimingHelpers::timer() -
20907 if (Print_timings_level_load_balance > 1)
20917 std::map<Data*, std::set<unsigned>>
20928 if (!(
ele_pt->is_halo()))
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)
21080 if (!(
ele_pt->is_halo()))
21097 std::set<unsigned>::iterator
it =
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]: "
21335 << TimingHelpers::timer() -
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;
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;
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++];
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++];
21806 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
21830 if (Print_timings_level_load_balance > 1)
21832 oomph_info <<
"CPU for sending elements to their new processors (load "
21834 << TimingHelpers::timer() -
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]: "
21926 << TimingHelpers::timer() -
21947 if (Print_timings_level_load_balance > 1)
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)
22197 if (!(
ele_pt->is_halo()))
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)
22315 if (!(
ele_pt->is_halo()))
22327 ele_pt->node_pt(
j)->set_non_obsolete();
22372 ele_pt->node_pt(
j)->set_non_obsolete();
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();
22459 this->reset_halo_haloed_scheme();
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)
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]: "
22895 << TimingHelpers::timer() -
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>>
23203 for (std::map<std::pair<Node*, Node*>,
unsigned>::iterator
it_map =
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]: "
23235 << TimingHelpers::timer() -
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)
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 <<
"): ("
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] =
24601 std::map<unsigned, unsigned>::iterator
it =
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 =
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: ("
24710 polyline_pt->initial_vertex_connected_n_chunk() = 0;
24728 polyline_pt->final_vertex_connected_n_chunk() = 0;
24772 if (Print_timings_level_load_balance > 2)
24774 oomph_info <<
"CPU for creating new shared boundaries representations "
24775 "(load balance) [9.7]: "
24776 << TimingHelpers::timer() -
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;
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()",
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 =
25932 for (std::map<std::pair<double, double>,
Node*>::iterator
it =
26030 template<
class ELEMENT>
26104 <<
") is not the double\nof the number of unsorted nonhalo shared "
26106 <<
")\n for the current boundary (" <<
shd_bnd_id <<
")\n\n";
26109 "RefineableTriangleMesh::get_shared_boundary_segment_nodes_helper()",
26120 <<
") is not the double\nof the number of unsorted halo shared "
26122 <<
")\n for the current boundary (" <<
shd_bnd_id <<
")\n\n";
26125 "RefineableTriangleMesh::get_shared_boundary_segment_nodes_helper()",
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";
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();
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());
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());
26999 <<
"The node coordinates are (" <<
nod_pt->x(0) <<
","
27000 <<
nod_pt->x(1) <<
").\n";
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());
27187 <<
"), shared by other processors\nwas not found.\n"
27188 <<
"The node coordinates are (" <<
nod_pt->x(0) <<
","
27189 <<
nod_pt->x(1) <<
").\n";
27192 "RefineableTriangleMesh::get_required_nodal_information_helper()",
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: ("
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());
27396 AlgebraicMesh*
alg_mesh_pt =
dynamic_cast<AlgebraicMesh*
>(
this);
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]
27639 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
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]
27699 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
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"
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]
27775 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
27777 this->add_shared_boundary_element(
bnd,
ele_pt);
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"
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++];
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"
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)
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";
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++];
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 ("
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++];
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)
28325 "RefineableTriangleMesh::construct_new_node_load_balance_helper()",
28359 std::map<unsigned, FiniteElement*>::iterator
it_map =
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)
28407 "RefineableTriangleMesh::construct_new_node_"
28408 "load_balance_helper()",
28439 if (is_node_on_shared_boundary == 1 ||
28534 std::map<unsigned, Node*>::iterator
it =
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";
28577 "RefineableTriangleMesh::construct_new_halo_node_helper()",
28589 if (is_node_on_shared_boundary == 1)
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";
28611 "RefineableTriangleMesh::construct_new_halo_node_helper()",
28633 if (is_node_on_shared_boundary != 1 &&
28746 AlgebraicMesh*
alg_mesh_pt =
dynamic_cast<AlgebraicMesh*
>(
this);
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++];
28862 dynamic_cast<MacroElementNodeUpdateMesh*
>(
this);
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>
29126#ifdef OOMPH_HAS_MPI
29128 if (this->is_mesh_distributed() &&
bulk_elem_pt->is_halo())
29150 std::pair<Node*, Node*>
tmp_pair = std::make_pair(
29216 for (
unsigned e = 0;
e <
nel;
e++)
29221#ifdef OOMPH_HAS_MPI
29223 if (this->is_mesh_distributed() &&
bulk_elem_pt->is_halo())
29243 std::pair<Node*, Node*>
tmp_pair = std::make_pair(
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 ("
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
29399 error_message <<
"Could not find an initial face element for the "
29400 "current segment\n";
29403 "RefineableTriangleMesh::get_boundary_segment_nodes_helper()",
29505 <<
"The number of segments is zero, but the number of nonhalo\n"
29509 "RefineableTriangleMesh::get_boundary_segment_nodes_helper()",
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++)
29726 const unsigned nouter = this->Outer_boundary_pt.size();
29728 if (this->is_automatic_creation_of_vertices_on_boundaries_allowed())
29760 this->update_open_curve_using_face_mesh(
29775#ifdef OOMPH_HAS_MPI
29781 if (this->is_mesh_distributed())
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: "
29835 oomph_info <<
"Mesh regeneration triggered by min angle criterion;\n"
29836 <<
"setting Nrefined to number of elements.\n";
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())
29900 this->update_polygon_using_face_mesh(
29901 this->Outer_boundary_pt[
i_outer]);
29909 this->update_open_curve_using_face_mesh(
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],
29995 TimingHelpers::timer();
30000#ifdef OOMPH_HAS_MPI
30003 if (this->is_mesh_distributed())
30018#ifdef OOMPH_HAS_MPI
30019 if (this->is_mesh_distributed())
30025 this->compute_boundary_segments_connectivity_and_initial_zeta_values(
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())
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())
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();
30376 TimingHelpers::timer();
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;
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";
30546 << TimingHelpers::timer() -
t0_bin_diff << std::endl;
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;
30604 const unsigned n_ele_bin = (*it).second.size();
30611 double t_map = TimingHelpers::timer();
30656#ifdef OOMPH_HAS_MPI
30678 double t_iter = TimingHelpers::timer();
30696 for (
unsigned e = 0;
e <
nelem;
e++)
30700 unsigned nint =
el_pt->integral_pt()->nweight();
30705 for (
unsigned i = 0;
i < 2;
i++)
30711 el_pt->interpolated_x(
s, x);
30719 Max_sample_points_for_limited_locate_zeta_during_target_area_transfer;
30727 error_message <<
"Limited locate zeta failed for zeta = [ "
30728 << x[0] <<
" " << x[1] <<
" ]. Makes no sense!\n";
30742 "limited locate zeta failed for zeta = [ "
30743 << x[0] <<
" " << x[1] <<
" ]. Makes no sense!\n";
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()",
30829 oomph_info <<
"Time for loop over integration points in new mesh: "
30864 if (Print_timings_level_adaptation > 2)
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)
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();
31101 TimingHelpers::timer();
31112#ifdef OOMPH_HAS_MPI
31113 if (this->is_mesh_distributed())
31118 ->identify_boundary_segments_and_assign_initial_zeta_values(
b,
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())
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): "
31279 << TimingHelpers::timer() -
t_iter << std::endl;
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)
31314 Multi_domain_functions::Doc_timings =
true;
31315 Multi_domain_functions::Doc_stats =
true;
31316 Multi_domain_functions::Doc_full_stats =
true;
31319 double t_proj = TimingHelpers::timer();
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)
31392 Multi_domain_functions::Doc_timings =
false;
31393 Multi_domain_functions::Doc_stats =
false;
31394 Multi_domain_functions::Doc_full_stats =
false;
31401 if (Print_timings_level_adaptation > 1)
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: "
31475 << TimingHelpers::timer() -
t_proj << std::endl;
31483 oomph_info <<
"Projection disabled! The new mesh will contain zeros"
31491 double t_rest = TimingHelpers::timer();
31495 for (
unsigned j =
nnod;
j > 0;
j--)
31501 for (
unsigned e =
nel;
e > 0;
e--)
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())
31555 for (
unsigned e = 0;
e <
nel;
e++)
31563 for (
unsigned j = 0;
j <
nnod;
j++)
31633#ifdef OOMPH_HAS_MPI
31634 if (this->is_mesh_distributed())
31639 if (this->is_mesh_distributed())
31656 this->reset_shared_boundary_elements_and_nodes();
31667 this->shared_boundaries_in_this_processor(
31698 this->sort_nodes_on_shared_boundaries();
31701 this->reset_halo_haloed_scheme();
31730 this->Oomph_vertex_nodes_id =
new_mesh_pt->oomph_vertex_nodes_id();
31736 TriangleHelper::deep_copy_of_triangulateio_representation(
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]: "
31788 << TimingHelpers::timer() -
t_rest << std::endl;
31792 oomph_info <<
"Not enough benefit in adaptation.\n";
31804#ifdef OOMPH_HAS_MPI
31805 if (this->is_mesh_distributed())
31811 if (Print_timings_level_adaptation > 1 &&
n_proc > 1)
31848 oomph_info <<
"CPU for adaptation (AVERAGE): "
31868 template<
class ELEMENT>
31873 Boundary_connections_pt.clear();
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(
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>
32670 const unsigned nproc = this->communicator_pt()->nproc();
32672 const unsigned my_rank = this->communicator_pt()->my_rank();
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(
33268 restore_polyline_connections_helper(
33286 template<
class ELEMENT>
33312#ifdef OOMPH_HAS_MPI
33313 if (this->is_mesh_distributed())
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 "
33351 "RefineableTriangleMesh::restore_polyline_connections_helper()",
33380#ifdef OOMPH_HAS_MPI
33381 if (this->is_mesh_distributed())
33478#ifdef OOMPH_HAS_MPI
33495 <<
"marked to be splitted but\n"
33496 <<
"there are only (" <<
nsub_poly <<
") polylines to "
33497 <<
"represent it.\n";
33500 "RefineableTriangleMesh::restore_polyline_connections_helper()",
33593#ifdef OOMPH_HAS_MPI
33594 if (this->is_mesh_distributed())
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";
33643 "RefineableTriangleMesh::restore_polyline_connections_helper()",
33653 polyline_pt->initial_vertex_connected_n_vertex() =
33681#ifdef OOMPH_HAS_MPI
33682 if (this->is_mesh_distributed())
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";
33719 "RefineableTriangleMesh::restore_polyline_connections_helper()",
33748#ifdef OOMPH_HAS_MPI
33749 if (this->is_mesh_distributed())
33845#ifdef OOMPH_HAS_MPI
33862 <<
"marked to be splitted but\n"
33863 <<
"there are only (" <<
nsub_poly <<
") polylines to "
33864 <<
"represent it.\n";
33867 "RefineableTriangleMesh::restore_polyline_connections_helper()",
33960#ifdef OOMPH_HAS_MPI
33961 if (this->is_mesh_distributed())
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";
34010 "RefineableTriangleMesh::restore_polyline_connections_helper()",
34038 template<
class ELEMENT>
34081 template<
class ELEMENT>
34108 if (
error < ToleranceForVertexMismatchInPolygons::Tolerable_error)
34128 template<
class ELEMENT>
34138 if (this->is_mesh_distributed() && !
check_only)
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
34196 if (this->is_mesh_distributed() &&
el_pt->is_halo())
34211 for (
unsigned i = 0;
i < 2;
i++)
34225 for (
unsigned i = 0;
i < 2;
i++)
34235 unsigned count = 0;
34253 polygon_pt->polyline_pt(
p)->unrefinement_tolerance();
34291 polygon_pt->polyline_pt(
p)->refinement_tolerance();
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++)
34390 if (
error > ToleranceForVertexMismatchInPolygons::Tolerable_error)
34395 for (
unsigned i = 0;
i < 2;
i++)
34404 ToleranceForVertexMismatchInPolygons::Tolerable_error)
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++)
34435 ToleranceForVertexMismatchInPolygons::Tolerable_error)
34440 for (
unsigned i = 0;
i < 2;
i++)
34451 ToleranceForVertexMismatchInPolygons::Tolerable_error)
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 "
34462 << ToleranceForVertexMismatchInPolygons::Tolerable_error
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 "
34505 << ToleranceForVertexMismatchInPolygons::Tolerable_error
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 "
34555 std::set<TriangleMeshCurveSection*>::iterator
it =
34613 template<
class ELEMENT>
34623 if (this->is_mesh_distributed() && !
check_only)
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;
34840#ifdef OOMPH_HAS_MPI
34844 if (!this->is_mesh_distributed())
34865 double error = 0.0;
34866 for (
unsigned i = 0;
i < 2;
i++)
34876 if (
error > ToleranceForVertexMismatchInPolygons::Tolerable_error)
34881 for (
unsigned i = 0;
i < 2;
i++)
34889 if (
error > ToleranceForVertexMismatchInPolygons::Tolerable_error)
34907 for (
unsigned i = 0;
i < 2;
i++)
34918 ToleranceForVertexMismatchInPolygons::Tolerable_error)
34923 for (
unsigned i = 0;
i < 2;
i++)
34932 ToleranceForVertexMismatchInPolygons::Tolerable_error)
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 "
34942 << ToleranceForVertexMismatchInPolygons::Tolerable_error
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 "
34983 << ToleranceForVertexMismatchInPolygons::Tolerable_error
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 "
35033 std::set<TriangleMeshCurveSection*>::iterator
it =
35097 template<
class ELEMENT>
35146 bool do_it =
false;
35147 if (std::fabs(
g) < 1.0e-14)
35194 const double x = (*it)[0];
35195 const double y = (*it)[1];
35199 if (
error < ToleranceForVertexMismatchInPolygons::Tolerable_error)
35276 bool do_it =
false;
35277 if (std::fabs(
g) < 1.0e-14)
35324 const double x = (*it)[0];
35325 const double y = (*it)[1];
35329 if (
error < ToleranceForVertexMismatchInPolygons::Tolerable_error)
35392 template<
class ELEMENT>
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>
35689 template<
class ELEMENT>
35699 create_unsorted_face_mesh_representation(
boundary_id,
35724 std::map<FiniteElement*, bool>
done_el;
35808 <<
"boundary " <<
boundary_id <<
" only managed to order \n"
35810 <<
" face elements.\n"
35820 for (std::list<FiniteElement*>::iterator
it =
sorted_el_pt.begin();
35865 if (
error < ToleranceForVertexMismatchInPolygons::Tolerable_error)
35880 template<
class ELEMENT>
35912 if (!
polygon_pt->is_redistribution_of_segments_between_polylines_enabled())
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;
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;
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++)
36337 for (std::map<
Node*, std::map<unsigned, unsigned>>::iterator
it =
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: ");
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";
36852 <<
"The number of boundaries on the mesh (" << this->nboundary()
36853 <<
") is different from the number of\nboundaries read from the "
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;
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 =
37104 error_message <<
"Was not possible to found the root polyline to "
37105 "create polygons\n\n";
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 =
37242 for (std::list<TriangleMeshCurveSection*>::iterator
it_list =
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);
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";
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";
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";
37598 std::map<unsigned, Vector<double>> regions_coordinates;
37614 regions_coordinates[
region_id].resize(2);
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>
37698#ifdef OOMPH_HAS_MPI
37741#ifdef OOMPH_HAS_MPI
37743 if (this->is_mesh_distributed() &&
ele_face_pt->is_halo())
37762#ifdef OOMPH_HAS_MPI
37777 unsigned iface = 0;
37797 error_message <<
"Could not find an initial face element for the "
37798 "current segment\n";
37802 "RefineableTriangleMesh::update_polygon_using_elements_area()",
37835 for (
unsigned i = 0;
i < 2;
i++)
37848 for (
unsigned i = 0;
i < 2;
i++)
37903 <<
")-th face element "
37904 <<
"on\nthe (" <<
bound
37905 <<
")-th boundary was not found!!!";
37908 "RefineableTriangleMesh::update_polygon_using_elements_area()",
37970 for (
unsigned i = 0;
i < 2;
i++)
37982 for (
unsigned i = 0;
i < 2;
i++)
38031 <<
")-th face element "
38032 <<
"on\nthe (" <<
bound
38033 <<
")-th boundary was not found!!!";
38035 "RefineableTriangleMesh::update_polygon_"
38036 "using_elements_area()",
38064 std::set<Vector<double>>::iterator
it_vertex;
38081 std::set<Vector<double>>::iterator
it_area;
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";
38120 polygon_pt->polyline_pt(
p)->unrefinement_tolerance();
38124 unrefine_boundary_constrained_by_target_area(
38133 polygon_pt->polyline_pt(
p)->refinement_tolerance();
38163#ifdef OOMPH_HAS_MPI
38164 if (this->is_mesh_distributed())
38181 unsigned count = 0;
38193#ifdef OOMPH_HAS_MPI
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;
38225 std::set<Vector<double>>::iterator
subit;
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++)
38324 if (
error > ToleranceForVertexMismatchInPolygons::Tolerable_error)
38329 for (
unsigned i = 0;
i < 2;
i++)
38338 ToleranceForVertexMismatchInPolygons::Tolerable_error)
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++)
38369 ToleranceForVertexMismatchInPolygons::Tolerable_error)
38374 for (
unsigned i = 0;
i < 2;
i++)
38385 ToleranceForVertexMismatchInPolygons::Tolerable_error)
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 "
38396 << ToleranceForVertexMismatchInPolygons::Tolerable_error
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 "
38439 << ToleranceForVertexMismatchInPolygons::Tolerable_error
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";
38488 polygon_pt->polyline_pt(
p)->unrefinement_tolerance();
38492 polygon_pt->polyline_pt(
p)->refinement_tolerance();
38502#ifdef OOMPH_HAS_MPI
38505 if (this->is_mesh_distributed())
38529 std::set<TriangleMeshCurveSection*>::iterator
it =
38551#ifdef OOMPH_HAS_MPI
38560 this->Boundary_subpolylines[
bound].clear();
38606 template<
class ELEMENT>
38650 const unsigned chunk =
38680#ifdef OOMPH_HAS_MPI
38681 if (this->is_mesh_distributed())
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"
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
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++)
38982 <<
")-th face element "
38983 <<
"on\nthe (" <<
bound
38984 <<
")-th boundary was not found!!!";
38992 const unsigned 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 =
39180 <<
")-th face element "
39181 <<
"on\nthe (" <<
bound
39182 <<
")-th boundary was not found!!!";
39190 const unsigned rlef =
39219 <<
")-th face element "
39220 <<
"on\nthe (" <<
bound
39221 <<
")-th boundary was not found "
39222 <<
"(repeated face element)!!!";
39257 std::set<Vector<double>>::iterator
it_vertex;
39274 std::set<Vector<double>>::iterator
it_area;
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 "
39339 unrefine_boundary_constrained_by_target_area(
39378#ifdef OOMPH_HAS_MPI
39379 if (this->is_mesh_distributed())
39409 unsigned count = 0;
39421#ifdef OOMPH_HAS_MPI
39433 <<
"The number of found sub-boundaries and the number of marked "
39434 <<
"internal\nboundaries are different\n"
39436 <<
"Number of marked internal boundaries: ("
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;
39476 std::set<Vector<double>>::iterator
subit;
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++)
39573 if (
error > ToleranceForVertexMismatchInPolygons::Tolerable_error)
39578 for (
unsigned i = 0;
i < 2;
i++)
39587 ToleranceForVertexMismatchInPolygons::Tolerable_error)
39606 double error = 0.0;
39607 for (
unsigned i = 0;
i < 2;
i++)
39618 ToleranceForVertexMismatchInPolygons::Tolerable_error)
39623 for (
unsigned i = 0;
i < 2;
i++)
39633 ToleranceForVertexMismatchInPolygons::Tolerable_error)
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 "
39644 << ToleranceForVertexMismatchInPolygons::Tolerable_error
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 "
39686 << ToleranceForVertexMismatchInPolygons::Tolerable_error
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";
39748#ifdef OOMPH_HAS_MPI
39751 if (this->is_mesh_distributed())
39775 std::set<TriangleMeshCurveSection*>::iterator
it =
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] =
39877#ifdef OOMPH_HAS_MPI
39882 template<
class ELEMENT>
39975 <<
") is not the double\nof the number of unsorted NONHALO shared "
39977 <<
"for the current boundary (" <<
shd_bnd_id <<
")\n\n";
39990 <<
") is not the double\nof the number of unsorted HALO shared "
39992 <<
"for the current boundary (" <<
shd_bnd_id <<
")\n\n";
40111 <<
") is not the double\nof the number of unsorted shared bulk "
40113 <<
"for the current boundary (" <<
shd_bnd_id <<
")\n\n";
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;
40338 for (
unsigned e = 0;
e <
nele;
e++)
40381 <<
") is different from the "
40382 <<
"total number\nof target areas ("
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"
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(
40511 std::set<TriangleMeshCurveSection*>::iterator
it =
40546 template<
class ELEMENT>
40567 if (!Do_boundary_unrefinement_constrained_by_target_areas)
40648 bool do_it =
false;
40649 if (std::fabs(
g) < 1.0e-14)
40690 const double x = (*it)[0];
40691 const double y = (*it)[1];
40696 ToleranceForVertexMismatchInPolygons::Tolerable_error)
40802 template<
class ELEMENT>
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];
41044 ToleranceForVertexMismatchInPolygons::Tolerable_error)
41153 template<
class ELEMENT>
41164 if (!Do_shared_boundary_refinement_constrained_by_target_areas)
41217 for (
unsigned i = 1;
i <
nseg;
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;
41402 error_message <<
"Could not find an initial face element for the "
41403 "current segment\n";
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++)
41559 std::set<Vector<double>>::iterator
it_vertex;
41593#ifdef OOMPH_HAS_MPI
41594 if (this->is_mesh_distributed())
41609 unsigned count = 0;
41610 std::set<Vector<double>>::iterator
it;
41620#ifdef OOMPH_HAS_MPI
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";
41635 "RefineableTriangleMesh::update_polygon_after_restart()",
41644 this->Boundary_was_splitted[
bound] =
true;
41653 std::set<Vector<double>>::iterator
subit;
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++)
41752 if (
error > ToleranceForVertexMismatchInPolygons::Tolerable_error)
41757 for (
unsigned i = 0;
i < 2;
i++)
41766 ToleranceForVertexMismatchInPolygons::Tolerable_error)
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++)
41797 ToleranceForVertexMismatchInPolygons::Tolerable_error)
41802 for (
unsigned i = 0;
i < 2;
i++)
41813 ToleranceForVertexMismatchInPolygons::Tolerable_error)
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 "
41824 << ToleranceForVertexMismatchInPolygons::Tolerable_error
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 "
41867 << ToleranceForVertexMismatchInPolygons::Tolerable_error
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()",
41923 polygon_pt->polyline_pt(
p)->unrefinement_tolerance();
41927 polygon_pt->polyline_pt(
p)->refinement_tolerance();
41950 std::set<TriangleMeshCurveSection*>::iterator
it =
41973#ifdef OOMPH_HAS_MPI
41981 this->Boundary_subpolylines[
bound].clear();
42028 template<
class ELEMENT>
42089#ifdef OOMPH_HAS_MPI
42090 if (this->is_mesh_distributed())
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"
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
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++)
42463 std::set<Vector<double>>::iterator
it_vertex;
42517#ifdef OOMPH_HAS_MPI
42518 if (this->is_mesh_distributed())
42548 unsigned count = 0;
42549 std::set<Vector<double>>::iterator
it;
42559#ifdef OOMPH_HAS_MPI
42571 <<
"The number of found sub-boundaries and the number of marked "
42572 <<
"internal\nboundaries are different\n"
42574 <<
"Number of marked internal boundaries: ("
42578 "RefineableTriangleMesh::update_open_curve_after_restart()",
42589 <<
"The number of found sub-boundaries and the number of counted\n"
42590 <<
"sub-boundaries are different:\n"
42596 "RefineableTriangleMesh::update_open_curve_after_restart()",
42605 this->Boundary_was_splitted[
bound] =
true;
42614 std::set<Vector<double>>::iterator
subit;
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++)
42712 if (
error > ToleranceForVertexMismatchInPolygons::Tolerable_error)
42717 for (
unsigned i = 0;
i < 2;
i++)
42726 ToleranceForVertexMismatchInPolygons::Tolerable_error)
42745 double error = 0.0;
42746 for (
unsigned i = 0;
i < 2;
i++)
42757 ToleranceForVertexMismatchInPolygons::Tolerable_error)
42762 for (
unsigned i = 0;
i < 2;
i++)
42772 ToleranceForVertexMismatchInPolygons::Tolerable_error)
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 "
42783 << ToleranceForVertexMismatchInPolygons::Tolerable_error
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 "
42826 << ToleranceForVertexMismatchInPolygons::Tolerable_error
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()",
42906 std::set<TriangleMeshCurveSection*>::iterator
it =
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] =
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;
43211 <<
") is not the double\nof the number of unsorted edges ("
43215 "RefineableTriangleMesh::update_shared_curve_after_restart()",
43389 std::set<TriangleMeshCurveSection*>::iterator
it =
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;
43459 outfile <<
"Number of elements and nodes associated to each "
43460 <<
"boundary before\nfilling elements and nodes\n\n";
43463 outfile <<
"Boundary (" <<
i <<
") Elements ("
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";
43620 outfile <<
"Number of elements and nodes associated to each "
43621 <<
"boundary after\nfilling elements and nodes\n\n";
43624 outfile <<
"Boundary (" <<
i <<
") Elements ("
43651 template<
class ELEMENT>
43679#ifdef OOMPH_HAS_MPI
43703#ifdef OOMPH_HAS_MPI
43715#ifdef OOMPH_HAS_MPI
43717 if (!this->is_mesh_distributed())
43721#ifdef OOMPH_HAS_MPI
43773#ifdef OOMPH_HAS_MPI
43782#ifdef OOMPH_HAS_MPI
43787 if (this->is_mesh_distributed())
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);
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>",
44122 if (
el_pt->node_pt(3)->is_on_boundary(
b))
44126 if (!
el_pt->node_pt(5)->is_on_boundary())
44129 for (
unsigned i = 0;
i < 2;
i++)
44131 el_pt->node_pt(5)->x(
i) =
44132 0.5 * (
el_pt->node_pt(0)->x(
i) +
el_pt->node_pt(2)->x(
i));
44137 if (!
el_pt->node_pt(4)->is_on_boundary())
44140 for (
unsigned i = 0;
i < 2;
i++)
44142 el_pt->node_pt(4)->x(
i) =
44143 0.5 * (
el_pt->node_pt(1)->x(
i) +
el_pt->node_pt(2)->x(
i));
44149 if (
el_pt->node_pt(4)->is_on_boundary(
b))
44153 if (!
el_pt->node_pt(5)->is_on_boundary())
44156 for (
unsigned i = 0;
i < 2;
i++)
44158 el_pt->node_pt(5)->x(
i) =
44159 0.5 * (
el_pt->node_pt(0)->x(
i) +
el_pt->node_pt(2)->x(
i));
44164 if (!
el_pt->node_pt(3)->is_on_boundary())
44167 for (
unsigned i = 0;
i < 2;
i++)
44169 el_pt->node_pt(3)->x(
i) =
44170 0.5 * (
el_pt->node_pt(0)->x(
i) +
el_pt->node_pt(1)->x(
i));
44176 if (
el_pt->node_pt(5)->is_on_boundary(
b))
44180 if (!
el_pt->node_pt(4)->is_on_boundary())
44183 for (
unsigned i = 0;
i < 2;
i++)
44185 el_pt->node_pt(4)->x(
i) =
44186 0.5 * (
el_pt->node_pt(1)->x(
i) +
el_pt->node_pt(2)->x(
i));
44191 if (!
el_pt->node_pt(3)->is_on_boundary())
44194 for (
unsigned i = 0;
i < 2;
i++)
44196 el_pt->node_pt(3)->x(
i) =
44197 0.5 * (
el_pt->node_pt(0)->x(
i) +
el_pt->node_pt(1)->x(
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++)
Quadrilateral mesh generator; Uses input from Geompack++. See: http://members.shaw....
GeompackQuadScaffoldMesh * Tmp_mesh_pt
Temporary scaffold mesh.
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.
Helper object for dealing with the parameters used for the TriangleMesh objects.
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...
struct oomph::classcomp Bottom_left_sorter
bool operator()(const std::pair< double, double > &lhs, const std::pair< double, double > &rhs) const