36#ifdef OOMPH_HAS_TRIANGLE_LIB
41 namespace TriangleHelper
166 "Point attributes are not currently copied across",
167 "TriangleHelper::deep_copy_of_triangulateio_representation",
188 triangle_out.numberoftriangleattributes *
sizeof(
double));
213 "Triangle areas are not currently copied across",
214 "TriangleHelper::deep_copy_of_triangulateio_representation",
221 "Triangle neighbours are not currently copied across",
222 "TriangleHelper::deep_copy_of_triangulateio_representation",
280 "Edges are not currently copied across",
281 "TriangleHelper::deep_copy_of_triangulateio_representation",
288 "Edge markers are not currently copied across",
289 "TriangleHelper::deep_copy_of_triangulateio_representation",
296 "Normals are not currently copied across",
297 "TriangleHelper::deep_copy_of_triangulateio_representation",
377 for (
int h = 0; h <
triangle_io.numberofholes; ++h)
384 poly_file <<
"#Assignment of attributes to regions\n";
391 for (
unsigned i = 0;
i < 4;
i++)
420 std::string
error_msg(
"Failed to open element file: ");
429 static_cast<unsigned>(
triangle_io.numberoftriangles);
434 static_cast<unsigned>(
triangle_io.numberofcorners);
439 static_cast<unsigned>(
triangle_io.numberoftriangleattributes);
450 triangle_io.numberoftriangleattributes *
sizeof(
double));
485 std::string
error_msg(
"Failed to open node file: ");
511 static_cast<unsigned>(
triangle_io.numberofpointattributes);
522 triangle_io.numberofpointattributes *
sizeof(
double));
563 std::string
error_msg(
"Failed to open poly file: ");
693 std::ostringstream error_message;
695 <<
"Please use another region id different from zero.\n"
696 <<
"It is internally used as the default region number.\n";
713 <<
" # number of elements in TriangulateIO" << std::endl;
716 <<
" # number of nodes in each triangle" << std::endl;
719 <<
" # number of triangle attributes" << std::endl;
729 dump_file <<
e <<
" # element number " << std::endl;
747 <<
" # number of points in TriangulateIO" << std::endl;
749 <<
" # number of point attributes" << std::endl;
766 dump_file <<
n <<
" # point number " << std::endl;
767 for (
int i = 0;
i < 2; ++
i)
790 <<
" # Number of segments in TriangulateIO " << std::endl;
806 dump_file <<
n <<
" # segment number " << std::endl;
807 for (
int i = 0;
i < 2; ++
i)
826 for (
int h = 0; h <
n_hole; ++h)
828 dump_file << h <<
" # hole number " << std::endl;
842 dump_file <<
r <<
" # region number " << std::endl;
843 for (
unsigned i = 0;
i < 4;
i++)
897 triangle_io.numberoftriangleattributes *
sizeof(
double));
947 triangle_io.numberofpointattributes *
sizeof(
double));
965 for (
int i = 0;
i < 2; ++
i)
1020 for (
int i = 0;
i < 2; ++
i)
1047 for (
int h = 0; h <
n_hole; ++h)
1074 for (
unsigned i = 0;
i < 4;
i++)
1095 namespace ToleranceForVertexMismatchInPolygons
1122 const unsigned& vertex_number,
1131 error_stream <<
"The vertex number you provided (" << vertex_number
1132 <<
") is greater\n than the number of vertices ("
1133 <<
n_vertices <<
"in the specified TriangleMeshPolyLine.\n"
1134 <<
"Remember that the vertex index starts at 0" << std::endl
1136 <<
") wants to connect "
1137 <<
"to destination boundary (" << polyline_pt->
boundary_id()
1138 <<
")" << std::endl;
1157 error_stream <<
"The associated vertices for the connection"
1158 <<
"\nare not close enough. Their respective values are:\n"
1159 <<
"Source boundary id:(" << this->
boundary_id() <<
")\n"
1160 <<
"Source vertex x:(" << v_src[0] <<
") y:(" <<
v_src[1]
1162 <<
"Destination boundary id:(" << polyline_pt->
boundary_id()
1164 <<
"\nAssociated vertex x:(" <<
v_dst[0] <<
") y:("
1166 <<
"\nThe corresponding distance is: (" <<
error
1169 <<
")" << std::endl;
1191 const unsigned& vertex_number,
1200 error_stream <<
"The vertex number you provided (" << vertex_number
1201 <<
") is greater\n than the number of vertices ("
1202 <<
n_vertices <<
"in the specified TriangleMeshPolyLine.\n"
1203 <<
"Remember that the vertex index starts at 0" << std::endl
1205 <<
") wants to connect "
1206 <<
"to destination boundary (" << polyline_pt->
boundary_id()
1207 <<
")" << std::endl;
1226 error_stream <<
"The associated vertices for the connection"
1227 <<
"\nare not close enough. Their respective values are:\n"
1228 <<
"Source boundary id:(" << this->
boundary_id() <<
")\n"
1229 <<
"Source vertex x:(" << v_src[0] <<
") y:(" <<
v_src[1]
1231 <<
"Destination boundary id:(" << polyline_pt->
boundary_id()
1233 <<
"\nAssociated vertex x:(" <<
v_dst[0] <<
") y:("
1235 <<
"\nThe corresponding distance is: (" <<
error
1238 <<
")" << std::endl;
1273 <<
") is out\nof the limits of the specified "
1274 <<
"TriangleMeshCurviLine.\nThe limits are [" <<
z_initial
1275 <<
", " <<
z_final <<
"]" << std::endl
1277 <<
") wants to connect "
1278 <<
"to destination boundary (" <<
curviline_pt->boundary_id()
1279 <<
")" << std::endl;
1299 <<
"The associated vertex for the provided connection s value\n"
1300 <<
"are not close enough. Their respective values are:\n"
1301 <<
"Source boundary id:(" << this->
boundary_id() <<
")\n"
1302 <<
"Source vertex x:(" << v_src[0] <<
") y:(" <<
v_src[1] <<
")\n"
1303 <<
"Destination boundary id:(" <<
curviline_pt->boundary_id() <<
")"
1304 <<
"\nDestination s value (" <<
s_value <<
")\n"
1305 <<
"Associated vertex x:(" <<
v_dst[0] <<
") y:(" <<
v_dst[1] <<
")"
1306 <<
"\nThe corresponding distance is: (" <<
error <<
") but the "
1352 <<
") is out\nof the limits of the specified "
1353 <<
"TriangleMeshCurviLine.\nThe limits are [" <<
z_initial
1354 <<
", " <<
z_final <<
"]" << std::endl
1356 <<
") wants to connect "
1357 <<
"to destination boundary (" <<
curviline_pt->boundary_id()
1358 <<
")" << std::endl;
1380 <<
"The associated vertex for the provided connection s value\n"
1381 <<
"are not close enough. Their respective values are:\n"
1382 <<
"Source boundary id:(" << this->
boundary_id() <<
")\n"
1383 <<
"Source vertex x:(" << v_src[0] <<
") y:(" <<
v_src[1] <<
")\n"
1384 <<
"Destination boundary id:(" <<
curviline_pt->boundary_id() <<
")"
1385 <<
"\nDestination s value (" <<
s_value <<
")\n"
1386 <<
"Associated vertex x:(" <<
v_dst[0] <<
") y:(" <<
v_dst[1] <<
")"
1387 <<
"\nThe corresponding distance is: (" <<
error <<
") but the "
1423 const bool& is_internal_point_fixed)
1426 Is_internal_point_fixed(is_internal_point_fixed)
1439 error_stream <<
"Sorry -- I'm afraid we insist that a closed curve is\n"
1440 <<
"specified by at least two separate CurveSections.\n"
1470 <<
"The start and end points of curve section boundary parts\n"
1471 <<
i <<
" and " <<
i + 1
1472 <<
" don't match when judged with the tolerance of "
1474 <<
" which\nis specified in the namespace variable\n"
1475 <<
"ToleranceForVertexMismatchInPolygons::Tolerable_error.\n\n"
1476 <<
"These are the vertices coordinates:\n"
1477 <<
"Curve section (" <<
i <<
") final vertex: (" <<
v1[0] <<
", "
1479 <<
"Curve section (" <<
i + 1 <<
") initial vertex: (" <<
v2[0]
1480 <<
", " <<
v2[1] <<
")\n"
1481 <<
"The distance between the vertices is (" <<
error <<
")\n"
1482 <<
"Feel free to adjust this or to recompile the code without\n"
1483 <<
"paranoia if you think this is OK...\n"
1526 <<
"The start and end points of the first and last curve segment\n"
1527 <<
"boundary parts don't match when judged \nwith the tolerance of "
1529 <<
" which is specified in the namespace \nvariable "
1530 <<
"ToleranceForVertexMismatchInPolygons::Tolerable_error.\n\n"
1531 <<
"Feel free to adjust this or to recompile the code without\n"
1532 <<
"paranoia if you think this is OK...\n"
1580 const bool& is_internal_point_fixed)
1584 Enable_redistribution_of_segments_between_polylines(
false),
1585 Can_update_configuration(
false),
1586 Polygon_fixed(
false)
1589 const unsigned n_bound = boundary_polyline_pt.
size();
1600 error_stream <<
"The (" <<
p <<
") TriangleMeshCurveSection is not a "
1601 <<
"TriangleMeshPolyLine.\nThe TriangleMeshPolygon object"
1602 <<
"is constituent of only TriangleMeshPolyLine objects.\n"
1603 <<
"Verify that all the constituent elements of the "
1604 <<
"TriangleMeshPolygon\nare instantiated as "
1605 <<
"TriangleMeshPolyLines." << std::endl;
1620 <<
"Sorry -- I'm afraid we insist that a closed curve is\n"
1621 <<
"specified by at least two separate TriangleMeshPolyLines.\n"
1622 <<
"You've only specified (" <<
n_bound <<
")" << std::endl;
1624 "TriangleMeshPolygon::TriangleMeshPolygon()",
1683 <<
"The polylines specified \n"
1684 <<
"should define a closed geometry, i.e. the first/last vertex of\n"
1685 <<
"adjacent polylines should match.\n\n"
1687 <<
" has no contiguous neighbour, when judged \nwith the tolerance of "
1689 <<
" which is specified in the namespace \nvariable "
1690 <<
"ToleranceForVertexMismatchInPolygons::Tolerable_error.\n\n"
1691 <<
"Feel free to adjust this or to recompile the code without\n"
1692 <<
"paranoia if you think this is OK...\n"
1695 "TriangleMeshPolygon::TriangleMeshPolygon()",
1709 unsigned nvertex = 0;
1720 unsigned nvert = boundary_polyline_pt[
i]->nvertex();
1721 for (
unsigned j = 0;
j <
nvert;
j++)
1724 if ((
i > 1) && (
j == 0))
1733 <<
"The start and end points of polylines " <<
i <<
" and "
1734 <<
i + 1 <<
" don't match when judged\n"
1735 <<
"with the tolerance ("
1737 <<
") which is specified in the namespace \nvariable "
1738 <<
"ToleranceForVertexMismatchInPolygons::"
1739 <<
"Tolerable_error.\n\n"
1740 <<
"Feel free to adjust this or to recompile the "
1742 <<
"paranoia if you think this is OK...\n"
1745 "TriangleMeshPolygon::TriangleMeshPolygon()",
1770 for (
unsigned i = 1;
i <= nvertex;
i++)
1784 (p2[0] - p1[0]) / (p2[1] - p1[1]) +
1804 <<
" isn't in the polygon that describes the internal closed "
1805 <<
"curve!\nPolygon vertices are at: \n";
1806 for (
unsigned i = 0;
i < nvertex;
i++)
1812 <<
"This may be because the internal point is defined by a\n"
1813 <<
"GeomObject that has deformed so much that it's \n"
1814 <<
"swept over the (initial) internal point.\n"
1815 <<
"If so, you should update the position of the internal point. \n"
1816 <<
"This could be done automatically by generating \n"
1817 <<
"an internal mesh inside the polygon and using one\n"
1818 <<
"of its internal nodes as the internal point. Actually not \n"
1819 <<
"why triangle doesn't do that automatically....\n";
1821 "TriangleMeshPolygon::TriangleMeshPolygon()",
1867 <<
"The start and end points of curve section boundary parts " <<
i
1869 <<
" don't match when judged \nwith the tolerance of "
1871 <<
" which is specified in the namespace \nvariable "
1872 <<
"ToleranceForVertexMismatchInPolygons::Tolerable_error.\n\n"
1873 <<
"Feel free to adjust this or to recompile the code without\n"
1874 <<
"paranoia if you think this is OK...\n"
1898#ifdef OOMPH_HAS_TRIANGLE_LIB
1969 std::map<unsigned, std::map<unsigned, Vector<vertex_connection_info>>>
1990 std::map<unsigned, std::map<unsigned, Vector<base_vertex_info>>>
2243 std::map<unsigned, std::map<unsigned, Vector<int>>>
2249 for (std::map<
unsigned, std::map<unsigned, unsigned>>::iterator
it =
2255 const unsigned b = (*it).first;
2258 for (std::map<unsigned, unsigned>::iterator
itt = (*it).second.begin();
2259 itt != (*it).second.end();
2263 const unsigned c = (*itt).first;
2321 std::ostringstream error_message;
2323 "UnstructuredTwoDMeshGeometryBase::build_triangulateio()";
2325 <<
"The initial vertex of the current polyline has no base\n"
2326 <<
"vertex assigned\n"
2327 <<
"Outer polygon number: (" <<
i <<
")\n\n"
2328 <<
"Polyline number: (" <<
p <<
")\n"
2329 <<
"Boundary id: (" <<
bound_id <<
")\n"
2330 <<
"Boundary chunk: (" <<
bnd_chunk <<
")\n";
2429 std::ostringstream error_message;
2431 "UnstructuredTwoDMeshGeometryBase::build_triangulateio()";
2433 <<
"The final vertex of the current polyline has no base\n"
2434 <<
"vertex assigned\n"
2435 <<
"Outer polygon number: (" <<
i <<
")\n\n"
2436 <<
"Polyline number: (" <<
p <<
")\n"
2437 <<
"Boundary id: (" <<
bound_id <<
")\n"
2438 <<
"Boundary chunk: (" <<
bnd_chunk <<
")\n";
2531 std::ostringstream error_message;
2533 "UnstructuredTwoDMeshGeometryBase::build_triangulateio()";
2535 <<
"The initial vertex of the current polyline has no base\n"
2536 <<
"vertex assigned\n"
2537 <<
"Internal polygon number: (" <<
i <<
")\n\n"
2538 <<
"Polyline number: (" <<
p <<
")\n"
2539 <<
"Boundary id: (" <<
bound_id <<
")\n"
2540 <<
"Boundary chunk: (" <<
bnd_chunk <<
")\n";
2639 std::ostringstream error_message;
2641 "UnstructuredTwoDMeshGeometryBase::build_triangulateio()";
2643 <<
"The final vertex of the current polyline has no base\n"
2644 <<
"vertex assigned\n"
2645 <<
"Internal polygon number: (" <<
i <<
")\n\n"
2646 <<
"Polyline number: (" <<
p <<
")\n"
2647 <<
"Boundary id: (" <<
bound_id <<
")\n"
2648 <<
"Boundary chunk: (" <<
bnd_chunk <<
")\n";
2741 std::ostringstream error_message;
2743 "UnstructuredTwoDMeshGeometryBase::build_triangulateio()";
2745 <<
"The initial vertex of the current polyline has no base\n"
2746 <<
"vertex assigned\n"
2747 <<
"Open curve number: (" <<
i <<
")\n\n"
2748 <<
"Polyline number: (" <<
p <<
")\n"
2749 <<
"Boundary id: (" <<
bound_id <<
")\n"
2750 <<
"Boundary chunk: (" <<
bnd_chunk <<
")\n";
2849 std::ostringstream error_message;
2851 "UnstructuredTwoDMeshGeometryBase::build_triangulateio()";
2853 <<
"The final vertex of the current polyline has no base\n"
2854 <<
"vertex assigned\n"
2855 <<
"Open curve number: (" <<
i <<
")\n\n"
2856 <<
"Polyline number: (" <<
p <<
")\n"
2857 <<
"Boundary id: (" <<
bound_id <<
")\n"
2858 <<
"Boundary chunk: (" <<
bnd_chunk <<
")\n";
2938 "UnstructuredTwoDMeshGeometryBase::build_triangulateio()";
2940 <<
"The number of added vertices to the global vertices container\n"
2941 <<
"is different from the pre-computed number of vertices\n"
2955 "UnstructuredTwoDMeshGeometryBase::build_triangulateio()";
2957 <<
"The counter for the global number of vertices is different from\n"
2958 <<
"the pre-computed number of vertices\n"
3022 std::ostringstream error_message;
3024 "UnstructuredTwoDMeshGeometryBase::build_triangulateio()";
3026 <<
"The global vertex number for the current vertex has not\n"
3027 <<
"been assigned\n."
3028 <<
"Outer polygon number: (" <<
i <<
")\n\n"
3029 <<
"Polyline number: (" <<
p <<
")\n"
3030 <<
"Boundary id: (" <<
bound_id <<
")\n"
3031 <<
"Boundary chunk: (" <<
bnd_chunk <<
")\n"
3049 std::ostringstream error_message;
3051 "UnstructuredTwoDMeshGeometryBase::build_triangulateio()";
3053 <<
"The global vertex number for the current vertex has not\n"
3054 <<
"been assigned\n."
3055 <<
"Outer polygon number: (" <<
i <<
")\n\n"
3056 <<
"Polyline number: (" <<
p <<
")\n"
3057 <<
"Boundary id: (" <<
bound_id <<
")\n"
3058 <<
"Boundary chunk: (" <<
bnd_chunk <<
")\n"
3116 std::ostringstream error_message;
3118 "UnstructuredTwoDMeshGeometryBase::build_triangulateio()";
3120 <<
"The global vertex number for the current vertex has not\n"
3121 <<
"been assigned\n."
3122 <<
"Internal polygon number: (" <<
i <<
")\n\n"
3123 <<
"Polyline number: (" <<
p <<
")\n"
3124 <<
"Boundary id: (" <<
bound_id <<
")\n"
3125 <<
"Boundary chunk: (" <<
bnd_chunk <<
")\n"
3143 std::ostringstream error_message;
3145 "UnstructuredTwoDMeshGeometryBase::build_triangulateio()";
3147 <<
"The global vertex number for the current vertex has not\n"
3148 <<
"been assigned\n."
3149 <<
"Internal polygon number: (" <<
i <<
")\n\n"
3150 <<
"Polyline number: (" <<
p <<
")\n"
3151 <<
"Boundary id: (" <<
bound_id <<
")\n"
3152 <<
"Boundary chunk: (" <<
bnd_chunk <<
")\n"
3210 std::ostringstream error_message;
3212 "UnstructuredTwoDMeshGeometryBase::build_triangulateio()";
3214 <<
"The global vertex number for the current vertex has not\n"
3215 <<
"been assigned\n."
3216 <<
"Open curve number: (" <<
i <<
")\n\n"
3217 <<
"Polyline number: (" <<
p <<
")\n"
3218 <<
"Boundary id: (" <<
bound_id <<
")\n"
3219 <<
"Boundary chunk: (" <<
bnd_chunk <<
")\n"
3237 std::ostringstream error_message;
3239 "UnstructuredTwoDMeshGeometryBase::build_triangulateio()";
3241 <<
"The global vertex number for the current vertex has not\n"
3242 <<
"been assigned\n."
3243 <<
"Open curve number: (" <<
i <<
")\n\n"
3244 <<
"Polyline number: (" <<
p <<
")\n"
3245 <<
"Boundary id: (" <<
bound_id <<
")\n"
3246 <<
"Boundary chunk: (" <<
bnd_chunk <<
")\n"
3333 regions_coordinates.begin();
3338 unsigned region_id = (*it_regions).first;
3392 ->internal_point()[0];
3395 ->internal_point()[1];
3399 for (
unsigned i_eh = 0;
3405 extra_holes_coordinates[
i_eh][1];
3598 std::map<Vector<unsigned>,
bool>
done;
4024 for (
unsigned b = 0; b <
n_bound; b++)
4030 if (geom_object_pt != 0)
4045 1 +
nod_pt->position_time_stepper_pt()->nprev_values();
4052 for (
unsigned i = 0;
i < 2;
i++)
4084 if (
point[1] > std::min(p1[1], p2[1]))
4086 if (
point[1] <= std::max(p1[1], p2[1]))
4088 if (
point[0] <= std::max(p1[0], p2[0]))
4093 (
point[1] - p1[1]) * (p2[0] - p1[0]) / (p2[1] - p1[1]) + p1[0];
4124 unsigned& vertex_number)
4166#ifdef OOMPH_HAS_TRIANGLE_LIB
4711 bool UnstructuredTwoDMeshGeometryBase::
4712 Suppress_warning_about_regions_and_boundaries =
true;
void position(const Vector< double > &zeta, Vector< double > &r) const
Return the parametrised position of the FiniteElement in its incarnation as a GeomObject,...
double size() const
Calculate the size of the element (length, area, volume,...) in Eulerian computational coordinates....
A geometric object is an object that provides a parametrised description of its shape via the functio...
virtual void position(const Vector< double > &zeta, Vector< double > &r) const =0
Parametrised position on object at current time: r(zeta).
unsigned long nboundary_node(const unsigned &ibound) const
Return number of nodes on a particular boundary.
unsigned nboundary() const
Return number of boundaries.
Node *& boundary_node_pt(const unsigned &b, const unsigned &n)
Return pointer to node n on boundary b.
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
An OomphLibError object which should be thrown when an run-time error is encountered....
An OomphLibWarning object which should be created as a temporary object to issue a warning....
TAdvectionDiffusionReactionElement<NREAGENT,DIM,NNODE_1D> elements are isoparametric triangular DIM-d...
Base class defining a closed curve for the Triangle mesh generation.
TriangleMeshClosedCurve(const Vector< TriangleMeshCurveSection * > &curve_section_pt, const Vector< double > &internal_point_pt=Vector< double >(0), const bool &is_internal_point_fixed=false)
Constructor prototype.
Vector< double > Internal_point_pt
Vector of vertex coordinates.
Base class for defining a triangle mesh boundary, this class has the methods that allow to connect th...
bool Initial_vertex_connected_to_curviline
States if the initial vertex is connected to a curviline.
virtual void initial_vertex_coordinate(Vector< double > &vertex)=0
Get first vertex coordinates.
bool Final_vertex_connected
Used for stating if the final end is connected to another boundary.
unsigned Final_vertex_connected_n_vertex
Stores the vertex number used for connection with the final end.
bool Final_vertex_connected_to_curviline
States if the final vertex is connected to a curviline.
double Initial_s_connection_value
Stores the s value used for connecting the initial end with a curviline.
virtual unsigned boundary_id() const =0
Boundary id.
void connect_initial_vertex_to_polyline(TriangleMeshPolyLine *polyline_pt, const unsigned &vertex_number, const double &tolerance_for_connection=1.0e-14)
Connects the initial vertex of the curve section to a desired target polyline by specifying the verte...
double Final_s_connection_value
Stores the s value used for connecting the final end with a curviline.
unsigned Final_vertex_connected_bnd_id
Stores the id to which the initial end is connected.
unsigned Initial_vertex_connected_n_chunk
Stores the chunk number of the boundary to which is connected th initial end.
unsigned initial_vertex_connected_n_vertex() const
Gets the vertex number to which the initial end is connected.
void connect_final_vertex_to_polyline(TriangleMeshPolyLine *polyline_pt, const unsigned &vertex_number, const double &tolerance_for_connection=1.0e-14)
Connects the final vertex of the curve section to a desired target polyline by specifying the vertex ...
unsigned final_vertex_connected_n_chunk() const
Gets the boundary chunk to which the final end is connected.
bool Initial_vertex_connected
Used for stating if the initial end is connected to another boundary.
unsigned final_vertex_connected_n_vertex() const
Sets the vertex number to which the final end is connected.
unsigned Initial_vertex_connected_n_vertex
Stores the vertex number used for connection with the initial end.
bool is_final_vertex_connected() const
Test whether final vertex is connected or not.
double Tolerance_for_s_connection
Tolerance used for connecting the ends to a curviline.
unsigned initial_vertex_connected_bnd_id() const
Gets the id to which the initial end is connected.
virtual void final_vertex_coordinate(Vector< double > &vertex)=0
Get last vertex coordinates.
bool is_initial_vertex_connected() const
Test whether initial vertex is connected or not.
unsigned Final_vertex_connected_n_chunk
Stores the chunk number of the boundary to which is connected th initial end.
void connect_initial_vertex_to_curviline(TriangleMeshCurviLine *curviline_pt, const double &s_value, const double &tolerance_for_connection=1.0e-14)
Connects the initial vertex of the curve section to a desired target curviline by specifying the s va...
unsigned initial_vertex_connected_n_chunk() const
Gets the boundary chunk to which the initial end is connected.
void connect_final_vertex_to_curviline(TriangleMeshCurviLine *curviline_pt, const double &s_value, const double &tolerance_for_connection=1.0e-14)
Connects the final vertex of the curve section to a desired target curviline by specifying the s valu...
unsigned final_vertex_connected_bnd_id() const
Gets the id to which the final end is connected.
unsigned Initial_vertex_connected_bnd_id
Stores the id to which the initial end is connected.
closed curves and open curves. All TriangleMeshCurves are composed of a Vector of TriangleMeshCurveSe...
virtual TriangleMeshCurveSection * curve_section_pt(const unsigned &i) const
Pointer to i-th constituent curve section.
Vector< TriangleMeshCurveSection * > Curve_section_pt
Vector of curve sections.
Class definining a curvilinear triangle mesh boundary in terms of a GeomObject. Curvlinear equivalent...
TriangleMeshOpenCurve(const Vector< TriangleMeshCurveSection * > &curve_section_pt)
Constructor.
Class defining a polyline for use in Triangle Mesh generation.
Vector< double > vertex_coordinate(const unsigned &i) const
Coordinate vector of i-th vertex (const version)
unsigned boundary_chunk() const
Boundary chunk (Used when a boundary is represented by more than one polyline.
unsigned nvertex() const
Number of vertices.
unsigned boundary_id() const
Boundary id.
unsigned npolyline() const
Number of constituent polylines.
TriangleMeshPolyLine * polyline_pt(const unsigned &i) const
Pointer to i-th constituent polyline.
TriangleMeshPolygon(const Vector< TriangleMeshCurveSection * > &boundary_polyline_pt, const Vector< double > &internal_point_pt=Vector< double >(0), const bool &is_internal_point_fixed=false)
Constructor: Specify vector of pointers to TriangleMeshCurveSection that define the boundary of the s...
const bool get_connected_vertex_number_on_destination_polyline(TriangleMeshPolyLine *dst_polyline_pt, Vector< double > &vertex_coordinates, unsigned &vertex_number)
Gets the vertex number on the destination polyline (used to create the connections among shared bound...
void snap_nodes_onto_geometric_objects()
Snap the boundary nodes onto any curvilinear boundaries defined by geometric objects.
unsigned get_associated_vertex_to_svalue(double &target_s_value, unsigned &bnd_id)
Get the associated vertex to the given s value by looking to the list of s values created when changi...
void copy_connection_information_to_sub_polylines(TriangleMeshCurveSection *input_curve_pt, TriangleMeshCurveSection *output_curve_pt)
Helper function to copy the connection information from the input curve(polyline or curviline) to the...
void copy_connection_information(TriangleMeshCurveSection *input_curve_pt, TriangleMeshCurveSection *output_curve_pt)
Helper function to copy the connection information from the input curve(polyline or curviline) to the...
void build_triangulateio(Vector< TriangleMeshPolygon * > &outer_polygons_pt, Vector< TriangleMeshPolygon * > &internal_polygons_pt, Vector< TriangleMeshOpenCurve * > &open_curves_pt, Vector< Vector< double > > &extra_holes_coordinates, std::map< unsigned, Vector< double > > ®ions_coordinates, std::map< unsigned, double > ®ions_areas, TriangulateIO &triangulate_io)
Create TriangulateIO object from outer boundaries, internal boundaries, and open curves....
bool is_point_inside_polygon_helper(Vector< Vector< double > > polygon_vertices, Vector< double > point)
Helper function that checks if a given point is inside a polygon (a set of sorted vertices that conne...
void add_connection_matrix_info_helper(TriangleMeshPolyLine *polyline_pt, std::map< unsigned, std::map< unsigned, Vector< vertex_connection_info > > > &connection_matrix, TriangleMeshPolyLine *next_polyline_pt=0)
Helps to add information to the connection matrix of the given polyline.
void initialise_base_vertex(TriangleMeshPolyLine *polyline_pt, std::map< unsigned, std::map< unsigned, Vector< base_vertex_info > > > &base_vertices)
Initialise the base vertex structure, set every vertex to no visited and not being a base vertex.
std::map< unsigned, GeomObject * > & boundary_geom_object_pt()
Return direct access to the geometric object storage.
void add_base_vertex_info_helper(TriangleMeshPolyLine *polyline_pt, std::map< unsigned, std::map< unsigned, Vector< base_vertex_info > > > &base_vertices, std::map< unsigned, std::map< unsigned, Vector< vertex_connection_info > > > &connection_matrix, std::map< unsigned, std::map< unsigned, unsigned > > &boundary_chunk_nvertices)
Helps to identify the base vertex of the given polyline.
A slight extension to the standard template vector class so that we can include "graceful" array rang...
double Tolerable_error
Acceptable discrepancy for mismatch in vertex coordinates. In paranoid mode, the code will die if the...
void create_triangulateio_from_polyfiles(const std::string &node_file_name, const std::string &element_file_name, const std::string &poly_file_name, TriangulateIO &triangle_io, bool &use_attributes)
Create a triangulateio data file from ele node and poly files. This is used if the mesh is generated ...
void dump_triangulateio(TriangulateIO &triangle_io, std::ostream &dump_file)
Write all the triangulateio data to disk in a dump file that can then be used to restart simulations.
void initialise_triangulateio(TriangulateIO &triangle_io)
Initialise TriangulateIO structure.
void read_triangulateio(std::istream &restart_file, TriangulateIO &triangle_io)
Read the triangulateio data from a dump file on disk, which can then be used to restart simulations.
void write_triangulateio_to_polyfile(TriangulateIO &triangle_io, std::ostream &poly_file)
Write the triangulateio data to disk as a poly file, mainly used for debugging.
void clear_triangulateio(TriangulateIO &triangulate_io, const bool &clear_hole_data)
Clear TriangulateIO structure.
TriangulateIO deep_copy_of_triangulateio_representation(TriangulateIO &triangle_io, const bool &quiet)
Make (partial) deep copy of TriangulateIO object. We only copy those items we need within oomph-lib's...
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).
The Triangle data structure, modified from the triangle.h header supplied with triangle 1....
Data structure to store the base vertex info, initial or final vertex in the polylines have an associ...
Data structure filled when the connection matrix is created, for each polyline, there are two vertex_...