26#ifndef OOMPH_TRIANGLE_MESH_HEADER
27#define OOMPH_TRIANGLE_MESH_HEADER
30#include <oomph-lib-config.h>
39#ifdef OOMPH_HAS_FPUCONTROLH
40#include <fpu_control.h>
51#include "../generic/problem.h"
52#include "../generic/triangle_scaffold_mesh.h"
53#include "../generic/triangle_mesh.h"
54#include "../generic/refineable_mesh.h"
55#include "../rigid_body/immersed_rigid_body_elements.h"
59#ifdef OOMPH_HAS_TRIANGLE_LIB
221 <<
"Please use another region id different from zero.\n"
222 <<
"It is internally used as the default region number.\n";
229 std::map<unsigned, Vector<double>>::iterator
it;
236 error_message <<
"The region id (" <<
i <<
") that you are using for"
238 <<
"your region is already in use. Use another\n"
239 <<
"region id and verify that you are not re-using\n"
240 <<
" previously defined regions ids\n"
422 template<
class ELEMENT>
429#ifdef OOMPH_HAS_TRIANGLE_LIB
434 this->Allow_automatic_creation_of_vertices_on_boundaries =
true;
444 MeshChecker::assert_geometric_element<TElementGeometricBase, ELEMENT>(2);
456 MeshChecker::assert_geometric_element<TElementGeometricBase, ELEMENT>(2);
459 this->Allow_automatic_creation_of_vertices_on_boundaries =
475#ifdef OOMPH_HAS_TRIANGLE_LIB
477 TriangleHelper::create_triangulateio_from_polyfiles(
504 for (
unsigned b = 0;
b <
nb;
b++)
511#ifdef OOMPH_HAS_TRIANGLE_LIB
523 MeshChecker::assert_geometric_element<TElementGeometricBase, ELEMENT>(2);
526 this->Allow_automatic_creation_of_vertices_on_boundaries =
528 .is_automatic_creation_of_vertices_on_boundaries_allowed();
559 if (outer_boundary_pt.size() == 0)
563 <<
"There are no outer boundaries defined.\n"
564 <<
"Verify that you have specified the outer boundaries in the\n"
565 <<
"Triangle_mesh_parameter object\n\n";
652 outer_boundary_pt[
i]);
661 internal_closed_curve_pt[
i]);
686 std::map<unsigned, Vector<double>>
regions =
692 const bool refine_boundary =
702 <<
"You have specified that Triangle may refine the outer boundary, "
704 <<
"not internal boundaries. Triangle does not support this "
706 <<
"If you do not want Triangle to refine internal boundaries, it "
708 <<
"refine outer boundaries either!\n"
709 <<
"Please either disable all boundary refinement\n"
710 <<
"(call TriangleMeshParameters::disable_boundary_refinement()\n"
711 <<
"or enable internal boundary refinement (the default)\n";
719 outer_boundary_polygon_pt,
723 extra_holes_coordinates,
744 for (
unsigned b = 0;
b <
nb;
b++)
757 const double& element_area,
762 MeshChecker::assert_geometric_element<TElementGeometricBase, ELEMENT>(2);
765 this->Allow_automatic_creation_of_vertices_on_boundaries =
776 "This constructor hasn't been tested since last cleanup.\n";
817#ifdef OOMPH_HAS_FPUCONTROLH
839 for (
unsigned b = 0;
b <
nb;
b++)
856#ifdef OOMPH_HAS_TRIANGLE_LIB
862 std::set<TriangleMeshCurveSection*>::iterator
it_polyline;
867 delete (*it_polyline);
870 std::set<TriangleMeshPolygon*>::iterator
it_polygon;
875 delete (*it_polygon);
883 delete (*it_open_polyline);
975#ifdef OOMPH_HAS_TRIANGLE_LIB
1049 error_stream <<
"Empty default reestablish disributed info method "
1051 error_stream <<
"This should be overloaded in a specific "
1052 <<
"RefineableTriangleMesh\n";
1095 if (this->is_mesh_distributed())
1128 if (!this->is_mesh_distributed())
1156 if (!this->is_mesh_distributed())
1194#ifdef OOMPH_HAS_TRIANGLE_LIB
1209 const double& element_area,
1215 const bool& refine_boundary,
1219 MeshChecker::assert_geometric_element<TElementGeometricBase, ELEMENT>(2);
1222 if (element_area < 10
e-14)
1226 <<
"The current elements area was stated to (" << element_area
1227 <<
").\nThe current precision to generate the input to triangle "
1228 <<
"is fixed to 14 digits\n\n";
1242 Outer_boundary_pt = outer_boundary_pt;
1251 Extra_holes_coordinates = extra_holes_coordinates;
1254 Regions_coordinates = regions_coordinates;
1264 UnstructuredTwoDMeshGeometryBase::build_triangulateio(
1268 extra_holes_coordinates,
1269 regions_coordinates,
1292 if (!this->is_automatic_creation_of_vertices_on_boundaries_allowed())
1298 if (refine_boundary ==
false)
1315#ifdef OOMPH_HAS_FPUCONTROLH
1325 if (!regions_coordinates.empty())
1386 const unsigned n_proc = this->communicator_pt()->nproc();
1388 const unsigned my_rank = this->communicator_pt()->my_rank();
1417 std::set<unsigned>::iterator
it =
1421 std::stringstream
error;
1422 error <<
"The current shared boundary (" <<
bnd_id <<
") was\n"
1423 <<
"already added by other pair of processors\n."
1424 <<
"This means that there are repeated shared boundaries "
1444 const unsigned&
q)
const
1470 const unsigned&
q)
const
1483 const unsigned&
i)
const
1494 const unsigned&
c)
const
1500 const unsigned&
p,
const unsigned&
c)
1507 const unsigned&
i)
const
1520 std::map<unsigned, Vector<FiniteElement*>>::iterator
it =
1530 <<
") does not exist!!!\n\n";
1544 std::map<unsigned, Vector<FiniteElement*>>::iterator
it =
1554 <<
") does not exist!!!\n\n";
1569 std::map<unsigned, Vector<FiniteElement*>>::iterator
it =
1579 <<
") does not exist!!!\n\n";
1598 std::map<unsigned, Vector<int>>::iterator
it =
1608 <<
") does not exist!!!\n\n";
1617 std::map<unsigned, Vector<Node*>>::iterator
it =
1627 <<
") does not exist!!!\n\n";
1671 std::map<unsigned, Vector<Node*>>::iterator
it =
1681 <<
") does not exist!!!\n\n";
1691 std::map<unsigned, Vector<Node*>>::iterator
it =
1714 <<
") does not exist!!!\n\n";
1728 std::map<unsigned, Vector<unsigned>>::iterator
it =
1735 <<
"The boundary (" <<
b
1736 <<
") seems not to be shared by any processors,\n"
1737 <<
"it is possible that the boundary was created by the user an not\n"
1738 <<
"automatically by the common interfaces between "
1739 "processors-domains\n";
1745 return (*it).second;
1759 std::map<unsigned, unsigned>::iterator
it =
1773 std::map<unsigned, unsigned>::iterator
it =
1780 <<
") does not lie on an internal "
1782 <<
"Make sure to call this method just for shared "
1783 "boundaries that lie "
1784 <<
"on an internal boundary.\n\n";
1790 return (*it).second;
1802 std::map<unsigned, unsigned>::iterator
it =
1820 <<
" The internal boundary (" <<
internal_bnd_id <<
") has no shared "
1821 <<
"boundaries overlapping it\n"
1822 <<
"Make sure to call this method just for internal boundaries that "
1823 <<
"are marked to as being\noverlaped by shared boundaries\n";
1842 std::map<unsigned, bool>::iterator
it;
1850 return (*it).second;
1858 std::map<unsigned, Vector<TriangleMeshPolyLine*>>::iterator
it;
1865 <<
"The boundary (" <<
b
1866 <<
") was marked as been splitted but there\n"
1867 <<
"are not registered polylines to represent the boundary.\n"
1868 <<
"The new polylines were not set up when the boundary was found "
1870 <<
"be splitted or the polylines have been explicitly deleted "
1878 return (*it).second.size();
1886 std::map<unsigned, Vector<TriangleMeshPolyLine*>>::iterator
it;
1892 <<
"The boundary (" <<
b
1893 <<
") was marked as been splitted but there\n"
1894 <<
"are not registered polylines to represent the boundary.\n"
1895 <<
"The new polylines were not set up when the boundary was found "
1897 <<
"be splitted or the polylines have been explicitly deleted "
1904 return (*it).second;
1911 const unsigned&
isub)
1913 std::map<unsigned, std::vector<bool>>::iterator
it;
1922 return (*it).second[
isub];
2043 std::map<
unsigned, std::map<Node*, bool>>&
2046 std::map<
unsigned, std::list<Node*>>&
2070 const unsigned&
nproc,
2136 const unsigned&
iproc,
2137 const unsigned&
jproc,
2152 error_stream <<
"Empty default load balancing function called.\n";
2153 error_stream <<
"This should be overloaded in a specific "
2154 <<
"RefineableTriangleMesh\n";
2191 return x <
p.x || (x ==
p.x && y <
p.y);
2201 return (A.
x -
O.x) * (
B.y -
O.y) - (A.
y -
O.y) * (
B.x -
O.x);
2209 int n =
P.size(),
k = 0;
2210 std::vector<Point> H(2 *
n);
2213 std::sort(
P.begin(),
P.end());
2216 for (
int i = 0;
i <
n; ++
i)
2218 while (
k >= 2 &&
cross(H[
k - 2], H[
k - 1],
P[
i]) <= 0)
k--;
2223 for (
int i =
n - 2,
t =
k + 1;
i >= 0;
i--)
2225 while (
k >=
t &&
cross(H[
k - 2], H[
k - 1],
P[
i]) <= 0)
k--;
2246 template<
class ELEMENT>
2248 public virtual RefineableMeshBase
2263 typedef void (*InternalHolePointUpdateFctPt)(
const unsigned&
ihole,
2266#ifdef OOMPH_HAS_TRIANGLE_LIB
2276 initialise_adaptation_data();
2279 initialise_boundary_refinement_data();
2303 initialise_adaptation_data();
2306 initialise_boundary_refinement_data();
2310#ifdef OOMPH_HAS_TRIANGLE_LIB
2325 initialise_adaptation_data();
2328 initialise_boundary_refinement_data();
2337 TriangleHelper::initialise_triangulateio(this->
Triangulateio);
2340 this->Triangulateio_exists =
true;
2356 this->Allow_automatic_creation_of_vertices_on_boundaries =
2369#ifdef OOMPH_HAS_FPUCONTROLH
2382 delete this->Tmp_mesh_pt;
2383 this->Tmp_mesh_pt = 0;
2395 this->set_communicator_pt(
comm_pt);
2401 for (
unsigned b = 0;
b <
nb;
b++)
2417 Print_timings_transfering_target_areas =
true;
2424 Print_timings_transfering_target_areas =
false;
2430 Disable_projection =
false;
2436 Disable_projection =
true;
2442 Print_timings_projection =
true;
2448 Print_timings_projection =
false;
2456 return Nbin_x_for_area_transfer;
2464 return Nbin_y_for_area_transfer;
2473 return Max_sample_points_for_limited_locate_zeta_during_target_area_transfer;
2479 return Max_element_size;
2485 return Min_element_size;
2491 return Min_permitted_angle;
2498 return Use_iterative_solver_for_projection;
2505 Use_iterative_solver_for_projection =
true;
2512 Use_iterative_solver_for_projection =
false;
2524 Print_timings_level_adaptation = 0;
2545 set_print_level_timings_load_balance(
print_level);
2551 Print_timings_level_load_balance = 0;
2573 outfile <<
"Targets for mesh adaptation: " << std::endl;
2574 outfile <<
"---------------------------- " << std::endl;
2577 outfile <<
"Target min angle: " << Min_permitted_angle << std::endl;
2578 outfile <<
"Min. allowed element size: " << Min_element_size << std::endl;
2579 outfile <<
"Max. allowed element size: " << Max_element_size << std::endl;
2581 <<
" elements need unrefinement." << std::endl;
2593 double backup = Min_element_size;
2606 Min_element_size =
backup;
2614 throw OomphLibError(
"unrefine_uniformly() not implemented yet",
2630 return Mesh_update_fct_pt;
2638 return Internal_hole_point_update_fct_pt;
2645 std::map<unsigned, Vector<Node*>>::iterator
it =
2646 Sorted_shared_boundary_node_pt.find(
b);
2647 if (
it == Sorted_shared_boundary_node_pt.end())
2650 error_message <<
"The boundary (" <<
b <<
") is not marked as shared\n";
2655 return (*it).second.size();
2660 Sorted_shared_boundary_node_pt.clear();
2665 std::map<unsigned, Vector<Node*>>::iterator
it =
2666 Sorted_shared_boundary_node_pt.find(
b);
2667 if (
it == Sorted_shared_boundary_node_pt.end())
2670 error_message <<
"The boundary (" <<
b <<
") is not marked as shared\n";
2675 return (*it).second[
i];
2681 std::map<unsigned, Vector<Node*>>::iterator
it =
2682 Sorted_shared_boundary_node_pt.find(
b);
2683 if (
it == Sorted_shared_boundary_node_pt.end())
2686 error_message <<
"The boundary (" <<
b <<
") is not marked as shared\n";
2691 return (*it).second;
2698 void create_polylines_from_polyfiles(
const std::string&
node_file_name,
2704 void fill_boundary_elements_and_nodes_for_internal_boundaries();
2710 void fill_boundary_elements_and_nodes_for_internal_boundaries(
2719 if (this->is_mesh_distributed())
2723 this->fill_boundary_elements_and_nodes_for_internal_boundaries();
2727 this->reset_shared_boundary_elements_and_nodes(
comm_pt);
2731 this->sort_nodes_on_shared_boundaries();
2734 this->reset_halo_haloed_scheme();
2738 this->initial_shared_boundary_id();
2748 this->identify_boundary_segments_and_assign_initial_zeta_values(
b,
2773 if (this->is_mesh_distributed())
2775 my_rank = this->communicator_pt()->my_rank();
2785 this->update_polygon_after_restart(
2790 const unsigned nouter = this->Outer_boundary_pt.size();
2793 this->update_polygon_after_restart(this->Outer_boundary_pt[
i_outer]);
2799 if (this->is_mesh_distributed())
2805 this->update_shared_curve_after_restart(
2806 this->Shared_boundary_polyline_pt[
my_rank][
nc]
2830 void get_shared_boundary_elements_and_face_indexes(
2841 void create_new_shared_boundaries(
2849 void compute_shared_node_degree_helper(
2857 void create_adjacency_matrix_new_shared_edges_helper(
2865 void get_shared_boundary_segment_nodes_helper(
2874 void get_boundary_segment_nodes_helper(
2881 Do_boundary_unrefinement_constrained_by_target_areas =
true;
2886 Do_boundary_unrefinement_constrained_by_target_areas =
false;
2891 Do_boundary_refinement_constrained_by_target_areas =
true;
2896 Do_boundary_refinement_constrained_by_target_areas =
false;
2903 Do_shared_boundary_unrefinement_constrained_by_target_areas =
true;
2908 Do_shared_boundary_unrefinement_constrained_by_target_areas =
false;
2913 Do_shared_boundary_refinement_constrained_by_target_areas =
true;
2918 Do_shared_boundary_refinement_constrained_by_target_areas =
false;
2937 std::map<unsigned, std::set<Vector<double>>>::iterator
it =
2938 Boundary_connections_pt.find(
b);
2940 if (
it != Boundary_connections_pt.end())
2955 const void synchronize_shared_boundary_connections();
2960 void add_vertices_for_non_deletion();
2965 void add_non_delete_vertices_from_boundary_helper(
2974 void create_temporary_boundary_connections(
2983 void restore_boundary_connections(
2993 void restore_polyline_connections_helper(
3004 void resume_boundary_connections(
3010 bool get_connected_vertex_number_on_dst_boundary(
3021 bool unrefine_boundary(
const unsigned&
b,
3042 bool apply_max_length_constraint(
3052 bool unrefine_boundary_constrained_by_target_area(
3064 bool refine_boundary_constrained_by_target_area(
3075 bool unrefine_shared_boundary_constrained_by_target_area(
3086 bool refine_shared_boundary_constrained_by_target_area(
3107 Do_boundary_unrefinement_constrained_by_target_areas =
true;
3108 Do_boundary_refinement_constrained_by_target_areas =
true;
3109 Do_shared_boundary_unrefinement_constrained_by_target_areas =
true;
3110 Do_shared_boundary_refinement_constrained_by_target_areas =
true;
3123 void sort_nodes_on_shared_boundaries();
3128 void reset_shared_boundary_elements_and_nodes(
3138 void reset_halo_haloed_scheme();
3147 void compute_global_node_names_and_shared_nodes(
3158 void send_boundary_node_info_of_shared_nodes(
3166 void reset_halo_haloed_scheme_helper(
3227 void get_required_elemental_information_load_balance_helper(
3272 void add_node_load_balance_helper(
3286 void get_required_nodal_information_load_balance_helper(
3294 void create_element_load_balance_helper(
3312 void add_element_load_balance_helper(
3313 const unsigned&
iproc,
3319 void add_received_node_load_balance_helper(
3337 void construct_new_node_load_balance_helper(
3375#ifdef ANNOTATE_REFINEABLE_TRIANGLE_MESH_COMMUNICATION
3465 void get_required_elemental_information_helper(
unsigned&
iproc,
3471 void get_required_nodal_information_helper(
unsigned&
iproc,
Node*
nod_pt);
3481 void create_halo_element(
3497 void add_halo_node_helper(
3511 void construct_new_halo_node_helper(
3527 void update_other_proc_shd_bnd_node_helper(
3562 bool update_open_curve_using_face_mesh(
3570 virtual bool surface_remesh_for_inner_hole_boundaries(
3582 void create_unsorted_face_mesh_representation(
const unsigned&
boundary_id,
3589 void create_sorted_face_mesh_representation(
3619 bool update_open_curve_using_elements_area(
3625 bool update_shared_curve_using_elements_area(
3630 void update_shared_curve_after_restart(
3641 this->Nbin_x_for_area_transfer = 100;
3646 this->Nbin_y_for_area_transfer = 100;
3650 Max_sample_points_for_limited_locate_zeta_during_target_area_transfer = 5;
3653 this->Max_element_size = 1.0;
3654 this->Min_element_size = 0.001;
3655 this->Min_permitted_angle = 15.0;
3658 this->Disable_projection =
false;
3661 this->Use_iterative_solver_for_projection =
true;
3664 this->Print_timings_level_adaptation = 0;
3667 this->Print_timings_level_load_balance = 0;
3671 this->Print_timings_transfering_target_areas =
false;
3674 this->Print_timings_projection =
false;
3680 Mesh_update_fct_pt = 0;
3684 Internal_hole_point_update_fct_pt = 0;
3687#ifdef OOMPH_HAS_TRIANGLE_LIB
3709 for (std::map<unsigned, double>::iterator
it =
3710 this->Regions_areas.begin();
3711 it != this->Regions_areas.end();
3714 unsigned r = (*it).first;
3716 for (
unsigned e = 0;
e <
nel;
e++)
3723 for (
unsigned e = 0;
e <
nel;
e++)
3733 double ax =
el_pt->node_pt(0)->x(0);
3734 double ay =
el_pt->node_pt(0)->x(1);
3736 double bx =
el_pt->node_pt(1)->x(0);
3737 double by =
el_pt->node_pt(1)->x(1);
3739 double cx =
el_pt->node_pt(2)->x(0);
3740 double cy =
el_pt->node_pt(2)->x(1);
3747 180.0 / MathematicalConstants::Pi;
3754 180.0 / MathematicalConstants::Pi;
3802 std::map<FiniteElement*, double>::iterator
it =
3820 <<
"overruled \nbecause the target area would have "
3821 <<
"been below \nthe minimum permitted area of " << Min_element_size
3822 <<
".\nYou can change the minimum permitted area with the\n"
3823 <<
"function RefineableTriangleMesh::min_element_size().\n\n";
3893 template<
class ELEMENT>
3895 public virtual SolidMesh
3898#ifdef OOMPH_HAS_TRIANGLE_LIB
3939#ifdef OOMPH_HAS_TRIANGLE_LIB
3944 template<
class ELEMENT>
3947 public virtual SolidMesh
////////////////////////////////////////////////////////////////// //////////////////////////////////...
///////////////////////////////////////////////////////////////////// ///////////////////////////////...
RefineableSolidTriangleMesh(TriangleMeshParameters &triangle_mesh_parameters, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Build mesh, based on the specifications on TriangleMeshParameter.
virtual ~RefineableSolidTriangleMesh()
Empty Destructor.
RefineableSolidTriangleMesh(const Vector< double > &target_area, TriangulateIO &triangulate_io, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper, const bool &use_attributes=false, const bool &allow_automatic_creation_of_vertices_on_boundaries=true, OomphCommunicator *comm_pt=0)
Build mesh from specified triangulation and associated target areas for elements in it.
/////////////////////////////////////////////////////////////////// /////////////////////////////////...
void disable_iterative_solver_for_projection()
Enables the use of an iterative solver for the projection problem.
std::map< unsigned, std::set< Vector< double > > > Boundary_connections_pt
A map that stores the vertices that receive connections, they are identified by the boundary number t...
unsigned Print_timings_level_adaptation
The printing level for adaptation.
unsigned try_to_add_haloed_node_pt(const unsigned &p, Node *&nod_pt)
Check if necessary to add the node as haloed or if it has been previously added to the haloed scheme.
double compute_area_target(const Vector< double > &elem_error, Vector< double > &target_area)
Compute target area based on the element's error and the error target; return minimum angle (in degre...
void enable_timings_tranfering_target_areas()
Enables info. and timings for tranferring of target areas.
Vector< unsigned > Flat_packed_unsigneds
Vector of flat-packed unsigneds to be communicated with other processors.
virtual ~RefineableTriangleMesh()
Empty Destructor.
void set_print_level_timings_load_balance(const unsigned &print_level)
Sets the printing level of timings for load balance.
void disable_boundary_unrefinement_constrained_by_target_areas()
void initialise_adaptation_data()
Helper function to initialise data associated with adaptation.
void enable_print_timings_load_balance(const unsigned &print_level=1)
Enables printing of timings for load balance.
void update_polyline_representation_from_restart()
Method used to update the polylines representation after restart.
void initialise_boundary_refinement_data()
Set all the flags to true (the default values)
void enable_boundary_unrefinement_constrained_by_target_areas()
Enable/disable unrefinement/refinement methods for original boundaries.
void enable_timings_projection()
Enables info. and timings for projection.
bool Do_shared_boundary_unrefinement_constrained_by_target_areas
Flag that enables or disables boundary unrefinement (true by default)
double Max_element_size
Max permitted element size.
double & max_element_size()
Max element size allowed during adaptation.
void set_print_level_timings_adaptation(const unsigned &print_level)
Sets the printing level of timings for adaptation.
void disable_print_timings_load_balance()
Disables printing of timings for load balance.
unsigned try_to_add_node_pt_load_balance(Vector< Node * > &new_nodes_on_domain, Node *&node_pt)
Check if necessary to add the node to the new domain or if it has been already added.
unsigned Nbin_x_for_area_transfer
Number of bins in the x-direction when transferring target areas by bin method. Only used if we don't...
void enable_shared_boundary_unrefinement_constrained_by_target_areas()
Enable/disable unrefinement/refinement methods for shared boundaries.
void reestablish_distribution_info_for_restart(OomphCommunicator *comm_pt, std::istream &restart_file)
Used to re-establish any additional info. related with the distribution after a re-starting for trian...
unsigned try_to_add_root_haloed_element_pt(const unsigned &p, GeneralisedElement *&el_pt)
Check if necessary to add the element as haloed or if it has been previously added to the haloed sche...
unsigned & nbin_y_for_area_transfer()
Read/write access to number of bins in the y-direction when transferring target areas by bin method....
void disable_timings_projection()
Disables info. and timings for projection.
const bool boundary_connections(const unsigned &b, const unsigned &c, std::set< Vector< double > > &vertices)
Verifies if the given boundary receives a connection, and if that is the case then returns the list o...
void refine_uniformly(DocInfo &doc_info)
Refine mesh uniformly and doc process.
RefineableTriangleMesh(const Vector< double > &target_area, TriangulateIO &triangulate_io, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper, const bool &use_attributes=false, const bool &allow_automatic_creation_of_vertices_on_boundaries=true, OomphCommunicator *comm_pt=0)
Build mesh from specified triangulation and associated target areas for elements in it NOTE: This is ...
MeshUpdateFctPt Mesh_update_fct_pt
Function pointer to function that updates the mesh following the snapping of boundary nodes to the bo...
void enable_print_timings_adaptation(const unsigned &print_level=1)
Enables printing of timings for adaptation.
void disable_boundary_refinement_constrained_by_target_areas()
unsigned Counter_for_flat_packed_unsigneds
Counter used when processing vector of flat-packed unsigneds.
unsigned Counter_for_flat_packed_doubles
Counter used when processing vector of flat-packed doubles.
InternalHolePointUpdateFctPt Internal_hole_point_update_fct_pt
Function pointer to function that can be set to update the position of the central point in internal ...
void disable_projection()
Disables the solution projection step during adaptation.
unsigned try_to_add_element_pt_load_balance(Vector< FiniteElement * > &new_elements_on_domain, FiniteElement *&ele_pt)
Check if necessary to add the element to the new domain or if it has been previously added.
void enable_boundary_refinement_constrained_by_target_areas()
bool Use_iterative_solver_for_projection
Flag to indicate whether to use or not an iterative solver (CG with diagonal preconditioned) for the ...
unsigned max_sample_points_for_limited_locate_zeta_during_target_area_transfer()
Read/write access to number of sample points from which we try to locate zeta by Newton method when t...
void disable_shared_boundary_unrefinement_constrained_by_target_areas()
RefineableTriangleMesh(const std::string &node_file_name, const std::string &element_file_name, const std::string &poly_file_name, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper, const bool &allow_automatic_creation_of_vertices_on_boundaries=true)
Build mesh, based on the polyfiles.
double & min_element_size()
Min element size allowed during adaptation.
bool Disable_projection
Enable/disable solution projection during adaptation.
double Min_permitted_angle
Min angle before remesh gets triggered.
void disable_shared_boundary_refinement_constrained_by_target_areas()
RefineableTriangleMesh(TriangleMeshParameters &triangle_mesh_parameters, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Build mesh, based on the specifications on TriangleMeshParameters.
bool Do_boundary_unrefinement_constrained_by_target_areas
Flag that enables or disables boundary unrefinement (true by default)
InternalHolePointUpdateFctPt & internal_hole_point_update_fct_pt()
Access to function pointer to can be used to generate the internal point for the ihole-th hole.
void doc_adaptivity_targets(std::ostream &outfile)
Doc the targets for mesh adaptation.
unsigned Max_sample_points_for_limited_locate_zeta_during_target_area_transfer
Default value for max. number of sample points used for locate_zeta when transferring target areas us...
Node * sorted_shared_boundary_node_pt(unsigned &b, unsigned &i)
void enable_projection()
Enables the solution projection step during adaptation.
void enable_iterative_solver_for_projection()
Enables the use of an iterative solver for the projection problem.
void disable_print_timings_adaptation()
Disables printing of timings for adaptation.
bool Do_boundary_refinement_constrained_by_target_areas
Flag that enables or disables boundary refinement (true by default)
std::map< unsigned, Vector< Node * > > Sorted_shared_boundary_node_pt
Stores the nodes in the boundaries in the same order in all the processors Sorted_shared_boundary_nod...
double Min_element_size
Min permitted element size.
bool Do_shared_boundary_refinement_constrained_by_target_areas
Flag that enables or disables boundary unrefinement (true by default)
MeshUpdateFctPt & mesh_update_fct_pt()
Access to function pointer to function that updates the mesh following the snapping of boundary nodes...
bool Print_timings_projection
Enable/disable printing timings for projection.
void disable_timings_tranfering_target_areas()
Disables info. and timings for tranferring of target areas.
double & min_permitted_angle()
Min angle before remesh gets triggered.
Vector< Node * > sorted_shared_boundary_node_pt(unsigned &b)
bool Print_timings_transfering_target_areas
Enable/disable printing timings for transfering target areas.
void flush_sorted_shared_boundary_node()
unsigned Print_timings_level_load_balance
The printing level for load balance.
unsigned nsorted_shared_boundary_node(unsigned &b)
unsigned & nbin_x_for_area_transfer()
Read/write access to number of bins in the x-direction when transferring target areas by bin method....
void enable_shared_boundary_refinement_constrained_by_target_areas()
bool use_iterative_solver_for_projection()
unsigned unrefine_uniformly()
Unrefine mesh uniformly: Return 0 for success, 1 for failure (if unrefinement has reached the coarses...
unsigned Nbin_y_for_area_transfer
Number of bins in the y-direction when transferring target areas by bin method. Only used if we don't...
Vector< double > Flat_packed_doubles
Vector of flat-packed doubles to be communicated with other processors.
Vector< std::string > Flat_packed_unsigneds_string
Temporary vector of strings to enable full annotation of RefineableTriangleMesh comms.
////////////////////////////////////////////////////////////////// //////////////////////////////////...
SolidTriangleMesh(TriangleMeshParameters &triangle_mesh_parameters, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Build mesh, based on closed curve that specifies the outer boundary of the domain and any number of i...
SolidTriangleMesh(const std::string &node_file_name, const std::string &element_file_name, const std::string &poly_file_name, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper, const bool &allow_automatic_creation_of_vertices_on_boundaries=true)
virtual ~SolidTriangleMesh()
Empty Destructor.
///////////////////////////////////////////////////////////////////// ///////////////////////////////...
TriangleMeshClosedCurve * outer_boundary_pt(const unsigned &i) const
Helper function for getting the i-th outer boundary.
bool Boundary_refinement
Do not allow refinement of nodes on the boundary.
bool is_automatic_creation_of_vertices_on_boundaries_allowed()
Returns the status of the variable Allow_automatic_creation_of_vertices_on_boundaries.
Vector< TriangleMeshClosedCurve * > outer_boundary_pt() const
Helper function for getting the outer boundary.
TriangleMeshParameters(Vector< TriangleMeshClosedCurve * > &outer_boundary_pt)
Constructor: Only takes the outer boundary, all the other parameters are stated with the specific par...
Vector< Vector< double > > & extra_holes_coordinates()
Helper function for getting access to the extra holes.
Vector< TriangleMeshClosedCurve * > & internal_closed_curve_pt()
Helper function for getting access to the internal closed boundaries.
virtual ~TriangleMeshParameters()
Empty destructor.
void set_target_area_for_region(const unsigned &i, const double &area)
Helper function to specify target area for region.
bool is_mesh_distributed() const
Boolean to indicate if Mesh has been distributed.
bool is_use_attributes() const
Helper function for getting the status of use_attributes variable.
void enable_use_attributes()
Helper function for enabling the use of attributes.
void disable_use_attributes()
Helper function for disabling the use of attributes.
double element_area() const
Helper function for getting the element area.
void disable_automatic_creation_of_vertices_on_boundaries()
Disables the creation of points (by Triangle) on the outer and internal boundaries.
bool Internal_boundary_refinement
Do not allow refinement of nodes on the internal boundary.
void enable_automatic_creation_of_vertices_on_boundaries()
Enables the creation of points (by Triangle) on the outer and internal boundaries.
void disable_internal_boundary_refinement()
Helper function for disabling the use of boundary refinement.
TriangleMeshParameters(TriangleMeshClosedCurve *outer_boundary_pt)
Constructor: Only takes the outer boundary, all the other parameters are stated with the specific par...
std::map< unsigned, double > & target_area_for_region()
Helper function for getting access to the region's target areas.
std::map< unsigned, Vector< double > > Regions_coordinates
Store the coordinates for defining extra regions The key on the map is the region id.
OomphCommunicator * communicator_pt() const
Read-only access fct to communicator (Null if mesh is not distributed)
void add_region_coordinates(const unsigned &i, Vector< double > ®ion_coordinates)
Helper function for getting the extra regions.
std::map< unsigned, Vector< double > > & regions_coordinates()
Helper function for getting access to the regions coordinates.
Vector< TriangleMeshClosedCurve * > internal_closed_curve_pt() const
Helper function for getting the internal closed boundaries.
TriangleMeshParameters()
Constructor: Takes nothing and initializes the other parameters to the default ones.
Vector< TriangleMeshOpenCurve * > & internal_open_curves_pt()
Helper function for getting access to the internal open boundaries.
Vector< Vector< double > > extra_holes_coordinates() const
Helper function for getting the extra holes.
Vector< TriangleMeshClosedCurve * > Internal_closed_curve_pt
Internal closed boundaries.
void set_communicator_pt(OomphCommunicator *comm_pt)
Function to set communicator (mesh is then assumed to be distributed)
Vector< Vector< double > > Extra_holes_coordinates
Store the coordinates for defining extra holes.
Vector< TriangleMeshClosedCurve * > & outer_boundary_pt()
Helper function for getting access to the outer boundary.
double & element_area()
Helper function for getting access to the element area.
Vector< TriangleMeshClosedCurve * > Outer_boundary_pt
The outer boundary.
bool Allow_automatic_creation_of_vertices_on_boundaries
Allows automatic creation of vertices along boundaries by Triangle.
TriangleMeshClosedCurve *& outer_boundary_pt(const unsigned &i)
Helper function for getting access to the i-th outer boundary.
std::map< unsigned, double > Regions_areas
Target areas for regions; defaults to 0.0 which (luckily) implies "no specific target area" for trian...
bool Use_attributes
Define the use of attributes (regions)
OomphCommunicator * Comm_pt
Pointer to communicator – set to NULL if mesh is not distributed Required to pass it to new distribut...
void enable_internal_boundary_refinement()
Helper function for enabling the use of boundary refinement.
void disable_boundary_refinement()
Helper function for disabling the use of boundary refinement.
bool is_boundary_refinement_allowed() const
Helper function for getting the status of boundary refinement.
void enable_boundary_refinement()
Helper function for enabling the use of boundary refinement.
bool is_internal_boundary_refinement_allowed() const
Helper function for getting the status of boundary refinement.
Vector< TriangleMeshOpenCurve * > internal_open_curves_pt() const
Helper function for getting the internal open boundaries.
Vector< TriangleMeshOpenCurve * > Internal_open_curves_pt
Internal boundaries.
double Element_area
The element are when calling triangulate external routine.
///////////////////////////////////////////////////////////////////// ///////////////////////////////...
void flush_shared_boundary_element()
TimeStepper * Time_stepper_pt
Timestepper used to build elements.
const unsigned nshared_boundary_element(const unsigned &b)
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...
std::map< unsigned, Vector< unsigned > > & shared_boundary_from_processors()
Return the association of the shared boundaries with the processors.
Vector< Vector< Vector< unsigned > > > Shared_boundaries_ids
Stores the boundaries ids created by the interaction of two processors Shared_boundaries_ids[iproc][j...
TriangleScaffoldMesh * Tmp_mesh_pt
Temporary scaffold mesh.
Vector< Vector< Vector< unsigned > > > & shared_boundaries_ids()
bool is_node_on_shared_boundary(const unsigned &b, Node *const &node_pt)
Is the node on the shared boundary.
bool Use_attributes
Boolean flag to indicate whether to use attributes or not (required for multidomain meshes)
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...
std::map< unsigned, unsigned > Shared_boundary_overlaps_internal_boundary
Stores information about those shared boundaries that lie over or over a segment of an internal bound...
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 ....
virtual ~TriangleMesh()
Destructor.
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.
const bool boundary_was_splitted(const unsigned &b)
Helper function to verify if a given boundary was splitted in the distribution process.
Vector< unsigned > oomph_vertex_nodes_id()
Return the vector that contains the oomph-lib node number for all vertex nodes in the TriangulateIO r...
void flush_shared_boundary_node(const unsigned &b)
Flush the boundary nodes associated to the shared boundary b.
void create_shared_polylines_connections()
Establish the connections of the polylines previously marked as having connections....
std::map< unsigned, double > Regions_areas
Target areas for regions; defaults to 0.0 which (luckily) implies "no specific target area" for trian...
void update_triangulateio()
Update the triangulateio object to the current nodal positions.
const unsigned initial_shared_boundary_id()
The initial boundary id for shared boundaries.
Vector< Vector< unsigned > > & shared_boundaries_ids(const unsigned &p)
unsigned Initial_shared_boundary_id
The initial boundary id for shared boundaries.
FiniteElement * shared_boundary_element_pt(const unsigned &b, const unsigned &e)
const unsigned shared_boundaries_ids(const unsigned &p, const unsigned &q, const unsigned &i) const
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 shared_boundaries_in_this_processor(Vector< unsigned > &shared_boundaries_in_this_processor)
Get the shared boundaries ids living in the current processor.
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...
std::map< unsigned, Vector< int > > Face_index_at_shared_boundary
For the e-th finite element on shared boundary b, this is the index of the face that lies along that ...
std::map< unsigned, Vector< unsigned > > Shared_boundary_from_processors
Stores the processors involved in the generation of a shared boundary, in 2D two processors give rise...
const bool shared_boundary_overlaps_internal_boundary(const unsigned &shd_bnd_id)
Checks if the shared boundary overlaps an internal boundary.
const unsigned nshared_boundary_node(const unsigned &b)
std::map< unsigned, Vector< TriangleMeshPolyLine * > > Boundary_subpolylines
The polylines that will temporary represent the boundary that was splitted in the distribution proces...
const unsigned nshared_boundary_overlaps_internal_boundary()
Get the number of shared boundaries overlaping internal boundaries.
Vector< Vector< Node * > > & boundary_segment_node_pt(const unsigned &b)
Return direct access to nodes associated with a boundary but sorted in segments.
void flush_shared_boundary_element(const unsigned &b)
const unsigned nshared_boundary_polyline(const unsigned &p, const unsigned &c) const
void add_shared_boundary_node(const unsigned &b, Node *node_pt)
Add the node the shared boundary.
const unsigned nshared_boundary_curves(const unsigned &p) const
Vector< unsigned > & shared_boundary_from_processors(const unsigned &b)
std::map< unsigned, bool > Boundary_was_splitted
Flag to indicate if a polyline has been splitted during the distribution process, the boundary id of ...
const unsigned read_unsigned_line_helper(std::istream &read_file)
bool Triangulateio_exists
Boolean defining if Triangulateio object has been built or not.
Vector< Vector< Vector< unsigned > > > shared_boundaries_ids() const
std::map< unsigned, unsigned > & shared_boundary_overlaps_internal_boundary()
Gets the storage that indicates if a shared boundary is part of an internal boundary.
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...
const unsigned nshared_boundaries(const unsigned &p, const unsigned &q) const
Access functions to boundaries shared with processors.
Vector< Vector< double > > Original_extra_holes_coordinates
Backup the original extra holes coordinates.
virtual void load_balance(const Vector< unsigned > &target_domain_for_local_non_halo_element)
Virtual function to perform the load balance routines.
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 ...
std::map< unsigned, Vector< Node * > > Shared_boundary_node_pt
Stores the boundary nodes adjacent to the shared boundaries, these nodes are a subset of the halo and...
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...
Node * shared_boundary_node_pt(const unsigned &b, const unsigned &n)
void add_shared_boundary_element(const unsigned &b, FiniteElement *ele_pt)
void build_from_scaffold(TimeStepper *time_stepper_pt, const bool &use_attributes)
Build mesh from scaffold.
coord2_t cross(const Point &O, const Point &A, const Point &B)
2D cross product of OA and OB vectors, i.e. z-component of their 3D cross product....
void operator=(const TriangleMesh &)=delete
Broken assignment operator.
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.
Vector< Vector< Vector< TriangleMeshPolyLine * > > > Shared_boundary_polyline_pt
Stores the polyline representation of the shared boundaries Shared_boundary_polyline_pt[iproc][ncurve...
Vector< Vector< unsigned > > shared_boundaries_ids(const unsigned &p) const
TriangleMesh(TriangleMeshParameters &triangle_mesh_parameters, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Build mesh, based on the specifications on TriangleMeshParameters.
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...
const unsigned nshared_boundaries() const
void remesh_from_internal_triangulateio()
Completely regenerate the mesh from the trianglateio structure.
Node *& boundary_segment_node_pt(const unsigned &b, const unsigned &s, const unsigned &n)
Return pointer to node n on boundary b.
std::vector< Point > convex_hull(std::vector< Point > P)
Returns a list of points on the convex hull in counter-clockwise order. Note: the last point in the r...
Vector< unsigned > Oomph_vertex_nodes_id
Vector storing oomph-lib node number for all vertex nodes in the TriangulateIO representation of the ...
TriangleMesh(const std::string &poly_file_name, const double &element_area, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper, const bool &allow_automatic_creation_of_vertices_on_boundaries=true)
Build mesh from poly file, with specified target area for all elements.
const unsigned final_shared_boundary_id()
The final boundary id for shared boundaries.
Vector< TriangleMeshPolyLine * > & shared_boundary_polyline_pt(const unsigned &p, const unsigned &c)
virtual void reestablish_distribution_info_for_restart(OomphCommunicator *comm_pt, std::istream &restart_file)
Virtual function used to re-establish any additional info. related with the distribution after a re-s...
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,...
const unsigned nboundary_subpolylines(const unsigned &b)
Gets the number of subpolylines that create the boundarya (useful only when the boundary is marked as...
const unsigned shared_boundary_overlapping_internal_boundary(const unsigned &shd_bnd_id)
Gets the boundary id of the internal boundary that the shared boundary lies on.
void generic_constructor(Vector< TriangleMeshPolygon * > &outer_boundary_pt, Vector< TriangleMeshPolygon * > &internal_polygon_pt, Vector< TriangleMeshOpenCurve * > &open_polylines_pt, const double &element_area, Vector< Vector< double > > &extra_holes_coordinates, std::map< unsigned, Vector< double > > ®ions_coordinates, std::map< unsigned, double > ®ions_areas, TimeStepper *time_stepper_pt, const bool &use_attributes, const bool &refine_boundary, const bool &refine_internal_boundary)
A general-purpose construction function that builds the mesh once the different specific constructors...
TriangleMesh(const TriangleMesh &dummy)=delete
Broken copy constructor.
bool First_time_compute_holes_left_by_halo_elements
Flag to know if it is the first time we are going to compute the holes left by the halo elements.
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...
const bool boundary_marked_as_shared_boundary(const unsigned &b, const unsigned &isub)
Returns the value that indicates if a subpolyline of a given boundary continues been used as internal...
Vector< unsigned > shared_boundaries_ids(const unsigned &p, const unsigned &q) const
void set_mesh_level_time_stepper(TimeStepper *const &time_stepper_pt, const bool &preserve_existing_data)
Overload set_mesh_level_time_stepper so that the stored time stepper now corresponds to the new times...
unsigned Final_shared_boundary_id
The final boundary id for shared boundaries.
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...
TriangleMesh(const std::string &node_file_name, const std::string &element_file_name, const std::string &poly_file_name, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper, const bool &allow_automatic_creation_of_vertices_on_boundaries=true)
Constructor with the input files.
std::map< unsigned, std::vector< bool > > Boundary_marked_as_shared_boundary
Flag to indicate if an internal boundary will be used as shared boundary because there is overlapping...
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 flush_face_index_at_shared_boundary()
void add_face_index_at_shared_boundary(const unsigned &b, const unsigned &i)
void flush_shared_boundary_polyline_pt()
int face_index_at_shared_boundary(const unsigned &b, const unsigned &e)
void flush_shared_boundary_node()
Flush ALL the shared boundary nodes.
void get_shared_boundaries_overlapping_internal_boundary(const unsigned &internal_bnd_id, Vector< unsigned > &shd_bnd_ids)
Gets the shared boundaries ids that overlap the given internal boundary.
bool triangulateio_exists()
Boolean defining if Triangulateio object has been built or not.
void update_triangulateio(Vector< Vector< double > > &internal_point)
Update the TriangulateIO object to the current nodal position and the centre hole coordinates.
Vector< TriangleMeshPolyLine * > & boundary_subpolylines(const unsigned &b)
Gets the vector of auxiliar polylines that will represent the given boundary (useful only when the bo...
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...
TriangleMesh()
Empty constructor.
Vector< Node * > & boundary_segment_node_pt(const unsigned &b, const unsigned &s)
Return direct access to nodes associated with a segment of a given boundary.
Vector< unsigned > & shared_boundaries_ids(const unsigned &p, const unsigned &q)
std::map< unsigned, Vector< FiniteElement * > > Shared_boundary_element_pt
Stores the boundary elements adjacent to the shared boundaries, these elements are a subset of the ha...
TriangleMeshPolyLine * shared_boundary_polyline_pt(const unsigned &p, const unsigned &c, const unsigned &i) const
////////////////////////////////////////////////////////////////////// //////////////////////////////...
void triangulate(char *triswitches, struct oomph::TriangulateIO *in, struct oomph::TriangulateIO *out, struct oomph::TriangulateIO *vorout)
bool operator<(const Point &p) const