35#ifndef OOMPH_UNSTRUCTURED_TWO_D_MESH_GEOMETRY_BASE_HEADER
36#define OOMPH_UNSTRUCTURED_TWO_D_MESH_GEOMETRY_BASE_HEADER
48#ifdef OOMPH_HAS_TRIANGLE_LIB
102 namespace TriangleHelper
154 class TriangleMeshPolyLine;
155 class TriangleMeshCurviLine;
315 const unsigned& vertex_number,
325 const unsigned& vertex_number,
752 outfile <<
r[0] <<
" " <<
r[1] << std::endl;
801 const double&
tol = 1.0e-12)
883 for (
unsigned i = 0;
i <
nvert;
i++)
888 error_stream <<
"TriangleMeshPolyLine should only be used in 2D!\n"
889 <<
"Your Vector of coordinates, contains data for "
891 <<
"-dimensional coordinates." << std::endl;
956 <<
"\"" << std::endl;
958 for (
unsigned i = 0;
i <
nvert;
i++)
1114 namespace ToleranceForVertexMismatchInPolygons
1163 if (boundary_id > max)
1305 const unsigned&
n_sample = 50) = 0;
1390 for (
unsigned i = 0;
i <
nb;
i++)
1397 outfile <<
"ZONE T=\"Internal point\"\n";
1497 <<
"The (" <<
i <<
") TriangleMeshCurveSection is not a "
1498 <<
"TriangleMeshPolyLine\nThe TriangleMeshPolygon object"
1499 <<
"is constituent of only TriangleMeshPolyLine objects.\n"
1500 <<
"The problem could be generated when changing the constituent "
1501 <<
"objects of the TriangleMeshPolygon.\nCheck where you got "
1502 <<
"access to this objects and review that you are not introducing "
1503 <<
"any other objects than TriangleMeshPolyLines" << std::endl;
1521 <<
"The (" <<
i <<
") TriangleMeshCurveSection is not a "
1522 <<
"TriangleMeshPolyLine\nThe TriangleMeshPolygon object"
1523 <<
"is constituent of only TriangleMeshPolyLine objects.\n"
1524 <<
"The problem could be generated when changing the constituent "
1525 <<
"objects of the TriangleMeshPolygon.\nCheck where you got "
1526 <<
"access to this objects and review that you are not introducing "
1527 <<
"any other objects than TriangleMeshPolyLines" << std::endl;
1583 <<
"Broken Default Called\n"
1584 <<
"This function should be overloaded if Can_update_configuration = "
1586 <<
"\nwhich indicates that the curve in it polylines parts can update "
1588 <<
"own position (i.e. it\n"
1589 <<
"may be a rigid body. Otherwise the update will be via a FaceMesh \n"
1590 <<
"representation of the boundary which is appropriate for \n"
1591 <<
"general deforming surfaces\n";
1682 for (
unsigned i = 0;
i <
nb;
i++)
1698 <<
")-th TriangleMeshCurveSection is not a "
1699 <<
"TriangleMeshPolyLine.\nPlease make sure that when you"
1700 <<
"first created this object the (" <<
i <<
")-th\n"
1701 <<
"TriangleCurveSection is a TriangleMeshPolyLine."
1720 <<
")-th TriangleMeshCurveSection is not a "
1721 <<
"TriangleMeshPolyLine.\nPlease make sure that when you"
1722 <<
"first created this object the (" <<
i <<
")-th\n"
1723 <<
"TriangleCurveSection is a TriangleMeshPolyLine."
1766 std::map<unsigned, Vector<FiniteElement*>>::iterator
it;
1774 return (
it->second).
size();
1786 std::map<unsigned, Vector<FiniteElement*>>::iterator
it;
1795 return (
it->second)[
e];
1800 std::stringstream error_message;
1803 error_message <<
"There are no regions associated with "
1804 <<
"region ID " <<
i <<
".";
1829 std::map<unsigned, GeomObject*>::iterator
it;
1837 return (*it).second;
1858 std::map<unsigned, Vector<double>>::iterator
it;
1863 "No coordinate limits associated with this boundary\n",
1869 return (*it).second;
1875 const unsigned&
r)
const
1879 std::map<unsigned, Vector<FiniteElement*>>::const_iterator
it =
1883 return (
it->second).
size();
1895 const unsigned&
e)
const
1898 std::map<unsigned, Vector<FiniteElement*>>::const_iterator
it =
1902 return (
it->second)[
e];
1913 const unsigned&
e)
const
1916 std::map<unsigned, Vector<int>>::const_iterator
it =
1920 return (
it->second)[
e];
1924 std::ostringstream error_message;
1925 error_message <<
"Face indices not set up for boundary " << b
1926 <<
" in region " <<
r <<
"\n";
1927 error_message <<
"This probably means that the boundary is not "
1928 "adjacent to region\n";
1939 std::map<unsigned, TriangleMeshCurveSection*>::iterator
it =
1963 unsigned& vertex_number);
2030 for (
unsigned is = 0;
is < nsegments;
is++)
2154 std::map<unsigned, Vector<double>>::iterator
it =
2161 std::stringstream error_message;
2162 error_message <<
"The boundary (" << b
2163 <<
") has no segments associated with it!!\n\n";
2171 return (*it).second;
2178 std::map<unsigned, Vector<double>>::iterator
it =
2185 std::stringstream error_message;
2186 error_message <<
"The boundary (" << b
2187 <<
") has no segments associated with it!!\n\n";
2195 return (*it).second;
2201 std::map<unsigned, Vector<double>>::iterator
it =
2208 std::stringstream error_message;
2209 error_message <<
"The boundary (" << b
2210 <<
") has not established initial coordinates\n";
2217 return (*it).second;
2223 std::map<unsigned, Vector<double>>::iterator
it =
2230 std::stringstream error_message;
2231 error_message <<
"The boundary (" << b
2232 <<
") has not established final coordinates\n";
2240 return (*it).second;
2247 std::map<unsigned, Vector<unsigned>>::const_iterator
it =
2254 std::stringstream error_message;
2255 error_message <<
"The boundary (" << b
2256 <<
") has not established inv. segments info\n";
2264 return (*it).second;
2271 std::map<unsigned, Vector<unsigned>>::iterator
it =
2278 std::stringstream error_message;
2279 error_message <<
"The boundary (" << b
2280 <<
") has not established inv. segments info\n";
2288 return (*it).second;
2294 std::map<unsigned, Vector<double>>::iterator
it =
2301 std::stringstream error_message;
2302 error_message <<
"The boundary (" << b
2303 <<
") has not established initial zeta "
2312 return (*it).second;
2318 std::map<unsigned, Vector<double>>::iterator
it =
2325 std::stringstream error_message;
2326 error_message <<
"The boundary (" << b
2327 <<
") has not established final zeta coordinate\n";
2335 return (*it).second;
2342 std::map<unsigned, Vector<double>>::iterator
it =
2349 std::stringstream error_message;
2350 error_message <<
"The boundary (" << b
2351 <<
") has no segments associated with it!!\n\n";
2359 return (*it).second;
2366 std::map<unsigned, Vector<double>>::iterator
it =
2373 std::stringstream error_message;
2374 error_message <<
"The boundary (" << b
2375 <<
") has no segments associated with it!!\n\n";
2383 return (*it).second;
2391 std::map<unsigned, Vector<Vector<double>>>::iterator
it =
2398 std::stringstream error_message;
2399 error_message <<
"The boundary (" << b
2400 <<
") has no segments associated with it!!\n\n";
2408 return (*it).second;
2415 std::map<unsigned, Vector<Vector<double>>>::iterator
it =
2422 std::stringstream error_message;
2423 error_message <<
"The boundary (" << b
2424 <<
") has no segments associated with it!!\n\n";
2432 return (*it).second;
2441 template<
class ELEMENT>
2454 template<
class ELEMENT>
2459#ifdef OOMPH_HAS_TRIANGLE_LIB
2517 std::map<
unsigned, std::map<unsigned, unsigned>>&
2563 std::map<unsigned, Vector<Vector<double>>>
2568 std::map<unsigned, Vector<Vector<double>>>
2629 std::map<unsigned, Vector<std::pair<double, double>>>
2670#ifdef OOMPH_HAS_TRIANGLE_LIB
2703 if (!(
boundary_pt->space_vertices_evenly_in_arclength()))
2712 for (
unsigned s = 0;
s <
n_seg + 1;
s++)
2784 for (
unsigned s = 1;
s <
n_seg;
s++)
2869 std::sort(connection_points_pt->begin(), connection_points_pt->end());
2875 std::ostringstream error_message;
2887 <<
"One of the specified connection points is out of the\n"
2888 <<
"curviline limits. We found that the point ("
2889 << (*connection_points_pt)[0] <<
") is\n"
2891 <<
"initial s value which is (" <<
zeta_initial <<
").\n"
2901 <<
"One of the specified connection points is out of the\n"
2902 <<
"curviline limits. We found that the point ("
2904 <<
"greater than the final s value which is (" <<
zeta_final
2917 <<
"One of the specified connection points is out of the\n"
2918 <<
"curviline limits. We found that the point ("
2919 << (*connection_points_pt)[0] <<
") is\n"
2920 <<
"greater than the"
2921 <<
"initial s value which is (" <<
zeta_initial <<
").\n"
2931 <<
"One of the specified connection points is out of the\n"
2932 <<
"curviline limits. We found that the point ("
2934 <<
"less than the final s value which is (" <<
zeta_final <<
").\n"
2971 std::string
output_string =
"UnstructuredTwoDMeshGeometryBase::";
2972 output_string +=
"create_vertex_coordinates_for_polyline_connections()";
2975 <<
"The number of segments specified for the curviline with\n"
2976 <<
"boundary id (" <<
boundary_pt->boundary_id() <<
") is less "
2977 <<
"(or equal) than the ones that will be\ngenerated by using "
2978 <<
"the specified number of connection points.\n"
2979 <<
"You specified (" <<
n_seg <<
") segments but ("
2980 <<
n_connections + 1 <<
") segments\nwill be generated." << std::endl;
3058 if (!(
boundary_pt->space_vertices_evenly_in_arclength()))
3113 <<
"The total number of assigned vertices is different from\n"
3114 <<
"the number of elements in the z_values list. The number"
3115 <<
"of\nelements in the z_values list is (" <<
s <<
") but "
3297 <<
"The total number of assigned vertices is different from\n"
3298 <<
"the number of elements in the z_values list. The number of\n"
3299 <<
"elements in the z_values list is (" << h
3300 <<
") but the number\n"
3354 std::ostringstream error_message;
3355 error_message <<
"TriangleMeshClosedCurve that defines outer boundary\n"
3356 <<
"must be made up of at least two "
3357 <<
"TriangleMeshCurveSections\n"
3358 <<
"to allow the automatic set up boundary coordinates.\n"
3359 <<
"Yours only has (" <<
nb <<
")" << std::endl;
3379 for (
unsigned b = 0; b <
nb; b++)
3400 unrefinement_tolerance[b] =
curviline_pt->unrefinement_tolerance();
3403 refinement_tolerance[b] =
curviline_pt->refinement_tolerance();
3420 else if (polyline_pt != 0)
3449 error_stream <<
"The 'curve_segment' is not a curviline neither a\n "
3450 <<
"polyline: What is it?\n"
3476 for (
unsigned b = 0; b <
nb; b++)
3480 unrefinement_tolerance[b]);
3483 refinement_tolerance[b]);
3513 for (
unsigned i = 0;
i <
nb;
i++)
3533 unrefinement_tolerance[
i] =
curviline_pt->unrefinement_tolerance();
3536 refinement_tolerance[
i] =
curviline_pt->refinement_tolerance();
3556 else if (polyline_pt != 0)
3589 <<
"The 'curve_segment' (open) is not a curviline neither a\n "
3590 <<
"polyline: What is it?\n"
3613 for (
unsigned b = 0; b <
nb; b++)
3617 unrefinement_tolerance[b]);
3620 refinement_tolerance[b]);
3640 std::ostringstream error_message;
3641 error_message <<
"TriangleMeshCurve that defines closed boundary\n"
3642 <<
"must be made up of at least two "
3643 <<
"TriangleMeshCurveSection\n"
3644 <<
"to allow the automatic set up boundary coordinates.\n"
3645 <<
"Yours only has " <<
nb << std::endl;
3691 for (
unsigned b = 0; b <
nb; b++)
3724 for (
unsigned b = 0; b <
nb; b++)
3750#ifdef OOMPH_HAS_TRIANGLE_LIB
3810 double s = (*vertex_info)[
n_vertex].second;
3826 std::ostringstream error_message;
3827 error_message <<
"Could not find the associated vertex number in\n"
3828 <<
"boundary " <<
bnd_id <<
" with the given s\n"
3830 <<
"this tolerance: " <<
s_tolerance << std::endl;
3850 template<
class ELEMENT>
3852 const unsigned& b, std::ofstream&
outfile)
3894 std::ostringstream error_message;
3895 error_message <<
"Region attributes should be unsigneds because we \n"
3896 <<
"only use them to set region ids\n";
3915 "UnstructuredTwoDMeshGeometryBase::setup_boundary_coordinates()";
3917 <<
"There are no elements associated with boundary (" << b
3919 <<
"in region (" <<
region_id <<
"). This could happen because:\n"
3920 <<
"1) You did not specify boundaries with this boundary id.\n"
3921 <<
"---- Review carefully the indexing of your boundaries.\n"
3922 <<
"2) The boundary (" << b <<
") is not associated with region ("
3924 <<
"---- The boundary does not touch the region.\n"
3925 <<
"You can suppress this warning by setting the static public "
3928 "UnstructuredTwoDMeshGeometryBase::Suppress_warning_about_"
3929 "regions_and_boundaries\n\n"
3975 std::pair<Node*, Node*>
tmp_pair = std::make_pair(
4051 "UnstructuredTwoDMeshGeometryBase::setup_boundary_coordinates()";
4053 <<
"There are no elements associated with boundary (" << b <<
").\n"
4054 <<
"This could happen because you did not specify boundaries with\n"
4055 <<
"this boundary id. Review carefully the indexing of your\n"
4071 for (
unsigned e = 0;
e <
nel;
e++)
4099 std::pair<Node*, Node*>
tmp_pair = std::make_pair(
4163 std::ostringstream error_message;
4165 <<
"The independent counting of face elements (" <<
nel <<
") for "
4166 <<
"boundary (" << b <<
") is different\n"
4167 <<
"from the real number of face elements in the container ("
4231 std::ostringstream error_message;
4233 <<
"There should not be halo face elements since they were not\n"
4234 <<
"considered when computing the face elements.\n"
4235 <<
"The number of found halo face elements is: ("
4259 std::map<FiniteElement*, bool>
done_el;
4341 std::ostringstream error_message;
4342 error_message <<
"Could not find an initial face element for the "
4343 "current segment\n";
4443 std::ostringstream error_message;
4444 error_message <<
"Was only able to setup boundary coordinate on "
4447 <<
" face elements. This usually means\n"
4448 <<
"that the boundary is not simply connected.\n\n"
4449 <<
"Re-run the setup_boundary_coordintes() function\n"
4450 <<
"with an output file specified "
4451 <<
"as the second argument.\n"
4452 <<
"This file will contain FaceElements that\n"
4453 <<
"oomph-lib believes to be located on the boundary.\n"
4489 std::ostringstream error_message;
4491 <<
"The number of segments is zero, but the number of nonhalo\n"
4515 for (
unsigned is = 0;
is < nsegments;
is++)
4521 std::ostringstream error_message;
4523 "UnstructuredTwoDMeshGeometryBase::setup_boundary_coordinates()";
4524 error_message <<
"The (" <<
is <<
")-th segment has no elements\n";
4567 for (std::list<FiniteElement*>::iterator
it =
4585 for (
unsigned j = 1;
j <
nnod;
j++)
4599 nod_pt->set_coordinates_on_boundary(b,
zeta);
4672 for (
unsigned is = 0;
is < nsegments;
is++)
4726 std::stringstream error_message;
4727 std::string
output_string =
"UnstructuredTwoDMeshGeometryBase::"
4728 "setup_boundary_coordinates()";
4730 <<
"The zeta values are in decreasing order, this is weird\n"
4731 <<
"since they have just been set-up in increasing order few\n"
4733 <<
"Boundary: (" << b <<
")\n"
4734 <<
"Segment: (" <<
is <<
")\n"
4741 <<
"Initial coordinate: (" <<
last_node_pt->x(0) <<
", "
4748 std::stringstream error_message;
4749 std::string
output_string =
"UnstructuredTwoDMeshGeometryBase::"
4750 "setup_boundary_coordinates()";
4752 <<
"It was not possible to determine whether the zeta values on"
4753 <<
"the current segment\nof the boundary are in"
4754 <<
"increasing or decreasing order\n\n"
4755 <<
"Boundary: (" << b <<
")\n"
4756 <<
"Segment: (" <<
is <<
")\n"
4764 <<
"Initial coordinate: (" <<
last_node_pt->x(0) <<
", "
4799 nod_pt->get_coordinates_on_boundary(b,
zeta);
4803 nod_pt->set_coordinates_on_boundary(b,
zeta);
4836 nod_pt->get_coordinates_on_boundary(b,
zeta);
4840 nod_pt->set_coordinates_on_boundary(b,
zeta);
4847 std::stringstream error_message;
4848 std::string
output_string =
"UnstructuredTwoDMeshGeometryBase::"
4849 "setup_boundary_coordinates()";
4851 <<
"It was not possible to identify if the zeta values on the\n"
4852 <<
"current segment in the boundary should go in increasing\n"
4853 <<
"or decreasing order.\n\n"
4854 <<
"Boundary: (" << b <<
")\n"
4855 <<
"Segment: (" <<
is <<
")\n"
4881 std::ostringstream error_message;
4883 "UnstructuredTwoDMeshGeometryBase::setup_boundary_coordinates()";
4884 error_message <<
"The number of segments (" << nsegments
4885 <<
") and the number of "
4887 <<
") representing\n"
4888 <<
"the\nsegments is different!!!\n\n";
4949 std::ostringstream error_message;
4951 "UnstructuredTwoDMeshGeometryBase::setup_boundary_coordinates()";
4952 error_message <<
"The boundary arclength is zero for boundary (" << b
5015 for (
unsigned is = 0;
is < nsegments;
is++)
5020 std::ostringstream error_message;
5022 "UnstructuredTwoDMeshGeometryBase::setup_boundary_coordinates()";
5023 error_message <<
"The (" <<
is <<
")-th segment has no elements\n";
5065 for (
unsigned i = 0;
i < 2;
i++)
5087 if (geom_object_pt != 0)
5118 for (
unsigned i = 0;
i < 2;
i++)
5126 for (
unsigned i = 0;
i < 2;
i++)
5139 for (
unsigned i = 0;
i < 2;
i++)
5147 for (
unsigned i = 0;
i < 2;
i++)
5208 "UnstructuredTwoDMeshGeometryBase::setup_boundary_coordinates()";
5210 <<
"Something very strange has happened.\n"
5211 <<
"The error between the endpoints of the geometric object\n"
5212 <<
"and the first and last nodes on the boundary is the same\n"
5213 <<
"irrespective of the direction of the coordinate.\n"
5214 <<
"This probably means that things are way off.\n"
5270 nod_pt->get_coordinates_on_boundary(b,
zeta);
5318 double diff = std::fabs(
5325 <<
"Wasn't able to locate the polygonal arclength exactly\n"
5326 <<
"during re-setup of boundary coordinates and have\n"
5327 <<
"assumed that we're dealing with the final point along\n"
5328 <<
"the curvilinear segment and encountered some roundoff\n"
5329 <<
"However,the difference in the polygonal zeta "
5331 <<
"between zeta[0] " <<
zeta[0]
5332 <<
" and the originallly stored value "
5335 <<
" which exceeds the threshold specified\n"
5336 <<
"in the publically modifiable variable\n"
5337 <<
"ToleranceForVertexMismatchInPolygons::Tolerable_error\n"
5338 <<
"whose current value is: "
5340 <<
"\nPlease check your mesh carefully and increase the\n"
5341 <<
"threshold if you're sure this is appropriate\n";
5352 nod_pt->set_coordinates_on_boundary(b,
zeta);
5411 nod_pt->get_coordinates_on_boundary(b,
zeta);
5447 nod_pt->set_coordinates_on_boundary(b,
zeta);
5468 std::ostringstream error_message;
5469 std::string
output_string =
"UnstructuredTwoDMeshGeometryBase::"
5470 "setup_boundary_coordinates()";
5471 error_message <<
"The first face element in the (" <<
is
5497 std::ostringstream error_message;
5498 std::string
output_string =
"UnstructuredTwoDMeshGeometryBase::"
5499 "setup_boundary_coordinates()";
5500 error_message <<
"The last face element in the (" <<
is
5529 for (
unsigned k = 0;
k < 2;
k++)
5566 nod_pt->get_coordinates_on_boundary(b,
zeta);
5572 nod_pt->set_coordinates_on_boundary(b,
zeta);
5585 for (
unsigned e = 0;
e <
nel;
e++)
5607 namespace TriangleBoundaryHelper
A general Finite Element class.
void position(const Vector< double > &zeta, Vector< double > &r) const
Return the parametrised position of the FiniteElement in its incarnation as a GeomObject,...
double size() const
Calculate the size of the element (length, area, volume,...) in Eulerian computational coordinates....
unsigned nnode() const
Return the number of nodes.
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
bool is_halo() const
Is this element a halo?
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).
bool is_mesh_distributed() const
Boolean to indicate if Mesh has been distributed.
int face_index_at_boundary(const unsigned &b, const unsigned &e) const
For the e-th finite element on boundary b, return int to indicate the face_index of the face adjacent...
unsigned nboundary_element(const unsigned &b) const
Return number of finite elements that are adjacent to boundary b.
Node *& node_pt(const unsigned long &n)
Return pointer to global node n.
FiniteElement * boundary_element_pt(const unsigned &b, const unsigned &e) const
Return pointer to e-th finite element on boundary b.
void set_boundary_coordinate_exists(const unsigned &i)
Set boundary coordinate on the i-th boundary to be existing.
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...
void output(std::ostream &outfile)
Output function: x,y,u or x,y,z,u.
Base class defining a closed curve for the Triangle mesh generation.
void output(std::ostream &outfile, const unsigned &n_sample=50)
Output each sub-boundary at n_sample (default: 50) points.
unsigned nvertices() const
Number of vertices.
Vector< double > Internal_point_pt
Vector of vertex coordinates.
Vector< double > & internal_point()
Coordinates of the internal point.
bool is_internal_point_fixed() const
Test whether the internal point is fixed.
Vector< double > internal_point() const
Coordinates of the internal point.
bool Is_internal_point_fixed
Indicate whether the internal point should be updated automatically.
unsigned nsegments() const
Total number of segments.
void unfix_internal_point()
Unfix the internal point (i.e. allow our automatic machinery to update it)
void fix_internal_point()
Fix the internal point (i.e. do not allow our automatic machinery to update it)
virtual ~TriangleMeshClosedCurve()
Empty destructor.
Base class for defining a triangle mesh boundary, this class has the methods that allow to connect th...
double & final_s_connection_value()
Sets the s value to which the final end is connected.
bool Final_vertex_connected_suspended
Indicates if the connection is suspended because the boundary to connect is no longer part of the dom...
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 is_initial_vertex_connected_to_curviline() const
Test whether the initial vertex is connected to a curviline.
virtual unsigned boundary_chunk() const =0
Boundary chunk (Used when a boundary is represented by more than one polyline.
virtual void output(std::ostream &outfile, const unsigned &n_sample=50)=0
Output the curve_section.
bool Final_vertex_connected
Used for stating if the final end is connected to another boundary.
double unrefinement_tolerance()
Get tolerance for unrefinement of curve section to create a better representation of curvilinear boun...
void unset_final_vertex_connected_to_curviline()
Sets the final vertex as non connected to a curviline.
unsigned Final_vertex_connected_n_vertex
Stores the vertex number used for connection with the final end.
double final_s_connection_value() const
Gets the s value to which the final end is connected.
double & initial_s_connection_value()
Sets the s value to which the initial end is connected.
double Unrefinement_tolerance
Tolerance for unrefinement of curve sections (neg if refinement is disabled)
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.
void set_unrefinement_tolerance(const double &tolerance)
Set tolerance for unrefinement of curve sections to avoid unnecessarily large numbers of elements on ...
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...
void resume_initial_vertex_connected()
Resumes the initial vertex connection, it may be that after load balancing the boundary to which the ...
double Final_s_connection_value
Stores the s value used for connecting the final end with a curviline.
double tolerance_for_s_connection() const
Gets the tolerance value for connections among curvilines.
unsigned Final_vertex_connected_bnd_id
Stores the id to which the initial end is connected.
void suspend_final_vertex_connected()
Set the final vertex connection as suspended, it will be resumed when the method to resume the connec...
unsigned Initial_vertex_connected_n_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 resume_final_vertex_connected()
Resumes the final vertex connection, it may be that after load balancing the boundary to which the co...
double Refinement_tolerance
Tolerance for refinement of curve sections (neg if refinement is disabled)
void set_refinement_tolerance(const double &tolerance)
Set tolerance for refinement of curve sections to create a better representation of curvilinear bound...
unsigned & final_vertex_connected_n_vertex()
Gets the vertex number to which the final end is connected.
virtual unsigned nvertex() const =0
Number of vertices.
unsigned & initial_vertex_connected_n_vertex()
Sets the vertex number to which the initial end is connected.
virtual ~TriangleMeshCurveSection()
Empty destructor.
virtual unsigned nsegment() const =0
Number of segments that this part of the boundary is to be represented by. This corresponds to the nu...
double Maximum_length
Maximum allowed distance between two vertices on the polyline representation of the curve section.
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_bnd_id()
Sets the id to which the final end is connected.
unsigned final_vertex_connected_n_chunk() const
Gets the boundary chunk to which the final end is connected.
void set_maximum_length(const double &maximum_length)
Allows to specify the maximum distance between two vertices that define the associated polyline of th...
void unset_initial_vertex_connected()
Sets the initial vertex as non 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.
double refinement_tolerance()
Get tolerance for refinement of curve sections to create a better representation of curvilinear bound...
unsigned Initial_vertex_connected_n_vertex
Stores the vertex number used for connection with the initial end.
bool Initial_vertex_connected_suspended
Indicates if the connection is suspended because the boundary to connect is no longer part of the dom...
TriangleMeshCurveSection()
Empty constructor. Initialises the curve section as non connected.
void disable_refinement_tolerance()
Disable refinement of curve section.
unsigned & initial_vertex_connected_bnd_id()
Sets the id to which the initial end is connected.
bool is_final_vertex_connected_to_curviline() const
Test whether the final vertex is connected to a curviline.
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.
void disable_unrefinement_tolerance()
Disable unrefinement of curve sections.
unsigned & final_vertex_connected_n_chunk()
Sets the boundary chunk to which the final end is connected.
double & tolerance_for_s_connection()
Sets the tolerance value for connections among curvilines.
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.
void enable_refinement_tolerance(const double &tolerance=0.08)
Enable refinement of curve section to create a better representation of curvilinear boundaries (e....
void set_initial_vertex_connected()
Sets the initial vertex as connected.
unsigned Final_vertex_connected_n_chunk
Stores the chunk number of the boundary to which is connected th initial end.
void set_final_vertex_connected()
Sets the final vertex as connected.
void enable_unrefinement_tolerance(const double &tolerance=0.04)
Enable unrefinement of curve sections to avoid unnecessarily large numbers of elements on of curvilin...
void unset_final_vertex_connected()
Sets the final vertex as non connected.
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...
void set_initial_vertex_connected_to_curviline()
Sets the initial vertex as connected to a curviline.
double initial_s_connection_value() const
Gets the s value to which the initial end is connected.
void suspend_initial_vertex_connected()
Set the initial vertex connection as suspended, it will be resumed when the method to resume the conn...
unsigned & initial_vertex_connected_n_chunk()
Sets the boundary chunk to which the initial end is connected.
unsigned initial_vertex_connected_n_chunk() const
Gets the boundary chunk to which the initial end is connected.
double maximum_length()
Gets access to the maximum length variable.
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...
void set_final_vertex_connected_to_curviline()
Sets the final vertex as connected to a curviline.
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.
void disable_use_maximum_length()
Disables the use of the maximum length criteria on the unrefinement or refinement steps.
void unset_initial_vertex_connected_to_curviline()
Sets the initial vertex as non connected to a curviline.
closed curves and open curves. All TriangleMeshCurves are composed of a Vector of TriangleMeshCurveSe...
double Polyline_unrefinement_tolerance
Tolerance for unrefinement of polylines (neg if refinement is disabled)
void set_polyline_refinement_tolerance(const double &tolerance)
Set tolerance for refinement of polylines to create a better representation of curvilinear boundaries...
void set_polyline_unrefinement_tolerance(const double &tolerance)
Set tolerance for unrefinement of polylines to avoid unnecessarily large numbers of elements on of cu...
void disable_polyline_unrefinement()
Disable unrefinement of polylines.
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.
TriangleMeshCurve(const Vector< TriangleMeshCurveSection * > &curve_section_pt)
Empty constructor.
virtual void output(std::ostream &outfile, const unsigned &n_sample=50)=0
Output each sub-boundary at n_sample (default: 50) points.
void disable_polyline_refinement()
Disable refinement of polylines.
double polyline_unrefinement_tolerance()
Get tolerance for unrefinement of polylines to create a better representation of curvilinear boundari...
void enable_polyline_refinement(const double &tolerance=0.08)
Enable refinement of polylines to create a better representation of curvilinear boundaries (e....
virtual ~TriangleMeshCurve()
Empty destructor.
virtual unsigned nsegments() const =0
Total number of segments.
double Polyline_refinement_tolerance
Tolerance for refinement of polylines (neg if refinement is disabled)
double polyline_refinement_tolerance()
Get tolerance for refinement of polylines to create a better representation of curvilinear boundaries...
virtual unsigned nvertices() const =0
Number of vertices.
void enable_polyline_unrefinement(const double &tolerance=0.04)
Enable unrefinement of polylines to avoid unnecessarily large numbers of elements on of curvilinear b...
unsigned max_boundary_id()
Return max boundary id of associated curves.
virtual TriangleMeshCurveSection *& curve_section_pt(const unsigned &i)
Pointer to i-th constituent curve section.
virtual unsigned ncurve_section() const
Number of constituent curves.
Class definining a curvilinear triangle mesh boundary in terms of a GeomObject. Curvlinear equivalent...
bool are_there_connection_points()
Does the vector for storing connections has elements?
unsigned Boundary_id
Boundary ID.
void initial_vertex_coordinate(Vector< double > &vertex)
Get first vertex coordinates.
Vector< double > Connection_points_pt
Stores the information for connections received on the curviline. Used when converting to polyline.
void add_connection_point(const double &z_value, const double &tol=1.0e-12)
Add the connection point (z_value) to the connection points that receive the curviline.
bool Space_vertices_evenly_in_arclength
Boolean to indicate if vertices in polygonal representation of the Curviline are spaced (approximatel...
unsigned boundary_chunk() const
Boundary chunk (Used when a boundary is represented by more than one polyline.
void output(std::ostream &outfile, const unsigned &n_sample=50)
Output curvilinear boundary at n_sample (default: 50) points.
unsigned nvertex() const
Number of vertices.
double Zeta_end
End coordinate in terms of the GeomObject's intrinsic coordinate.
void final_vertex_coordinate(Vector< double > &vertex)
Get last vertex coordinates.
double zeta_start()
Start coordinate in terms of the GeomObject's intrinsic coordinate.
unsigned & nsegment()
Number of (initially straight-line) segments that this part of the boundary is to be represented by....
GeomObject * Geom_object_pt
Pointer to GeomObject that represents this part of the boundary.
TriangleMeshCurviLine(GeomObject *geom_object_pt, const double &zeta_start, const double &zeta_end, const unsigned &nsegment, const unsigned &boundary_id, const bool &space_vertices_evenly_in_arclength=true, const unsigned &boundary_chunk=0)
Constructor: Specify GeomObject, the start and end coordinates of the relevant boundary in terms of t...
unsigned Boundary_chunk
Boundary chunk (Used when a boundary is represented by more than one polyline.
Vector< double > * connection_points_pt()
Returns the connection points vector.
double Zeta_start
Start coordinate in terms of the GeomObject's intrinsic coordinate.
virtual ~TriangleMeshCurviLine()
Empty Destuctor.
unsigned boundary_id() const
Boundary ID.
double zeta_end()
End coordinate in terms of the GeomObject's intrinsic coordinate.
unsigned Nsegment
Number of (initially straight-line) segments that this part of the boundary is to be represented by.
bool space_vertices_evenly_in_arclength() const
Boolean to indicate if vertices in polygonal representation of the Curvline are spaced (approximately...
unsigned nsegment() const
Number of (initially straight-line) segments that this part of the boundary is to be represented by.
GeomObject * geom_object_pt()
Pointer to GeomObject that represents this part of the boundary.
Base class defining an open curve for the Triangle mesh generation Basically used to define internal ...
TriangleMeshPolyLine * polyline_pt(const unsigned &i)
Pointer to i-th constituent polyline.
unsigned nsegments() const
Total number of segments.
virtual ~TriangleMeshOpenCurve()
Empty destructor.
TriangleMeshPolyLine * polyline_pt(const unsigned &i) const
Pointer to i-th constituent polyline.
unsigned nvertices() const
Number of vertices.
void output(std::ostream &outfile, const unsigned &n_sample=50)
Output each sub-boundary at n_sample (default: 50) points.
Class defining a polyline for use in Triangle Mesh generation.
unsigned Boundary_id
Boundary ID.
Vector< double > vertex_coordinate(const unsigned &i) const
Coordinate vector of i-th vertex (const version)
TriangleMeshPolyLine(const Vector< Vector< double > > &vertex_coordinate, const unsigned &boundary_id, const unsigned &boundary_chunk=0)
Constructor: Takes vectors of vertex coordinates in order Also allows the optional specification of a...
unsigned boundary_chunk() const
Boundary chunk (Used when a boundary is represented by more than one polyline.
unsigned Boundary_chunk
Boundary chunk (Used when a boundary is represented by more than one polyline.
unsigned nsegment() const
Number of segments.
void final_vertex_coordinate(Vector< double > &vertex)
Get last vertex coordinates.
virtual ~TriangleMeshPolyLine()
Empty destructor.
unsigned nvertex() const
Number of vertices.
void output(std::ostream &outfile, const unsigned &n_sample=50)
Output the polyline – n_sample is ignored.
Vector< Vector< double > > Vertex_coordinate
Vector of Vector of vertex coordinates.
void reverse()
Reverse the polyline, this includes the connection information and the vertices order.
void initial_vertex_coordinate(Vector< double > &vertex)
Get first vertex coordinates.
Vector< double > & vertex_coordinate(const unsigned &i)
Coordinate vector of i-th vertex.
unsigned boundary_id() const
Boundary id.
Class defining a closed polygon for the Triangle mesh generation.
unsigned npolyline() const
Number of constituent polylines.
bool is_fixed() const
Test whether the polygon is fixed or not.
bool can_update_reference_configuration() const
Test whether curve can update reference.
TriangleMeshPolyLine * polyline_pt(const unsigned &i) const
Pointer to i-th constituent polyline.
void set_fixed()
Set the polygon to be fixed.
bool is_redistribution_of_segments_between_polylines_enabled()
Is re-distribution of polyline segments in the curve between different boundaries during adaptation e...
TriangleMeshPolyLine * polyline_pt(const unsigned &i)
Pointer to i-th constituent polyline.
unsigned ncurve_section() const
Number of constituent curves.
bool Can_update_configuration
Boolean flag to indicate whether the polygon can update its own reference configuration after it has ...
bool Polygon_fixed
Boolean flag to indicate whether the polygon can move (default false because if it doesn't move this ...
void set_unfixed()
Set the polygon to be allowed to move (default)
virtual ~TriangleMeshPolygon()
Empty virtual destructor.
virtual void reset_reference_configuration()
Virtual function that should be overloaded to update the polygons reference configuration.
void disable_redistribution_of_segments_between_polylines()
Disable re-distribution of polyline segments in the curve between different boundaries during adaptat...
bool Enable_redistribution_of_segments_between_polylines
Is re-distribution of polyline segments between different boundaries during adaptation enabled?...
Vector< unsigned > polygon_boundary_id()
Return vector of boundary ids of associated polylines.
void enable_redistribution_of_segments_between_polylines()
Enable re-distribution of polyline segments in the curve between different boundaries during adaptati...
Contains functions which define the geometry of the mesh, i.e. regions, boundaries,...
std::map< unsigned, Vector< double > > & boundary_segment_final_arclength()
Return direct access to the final arclength for the segments that are part of a boundary.
std::map< unsigned, Vector< double > > & boundary_segment_initial_zeta()
Return direct access to the initial zeta for the segments that are part of a boundary.
GeomObject * boundary_geom_object_pt(const unsigned &b)
Return the geometric object associated with the b-th boundary or null if the boundary has associated ...
std::map< unsigned, GeomObject * > Boundary_geom_object_pt
Storage for the geometric objects associated with any boundaries.
Vector< double > & boundary_initial_coordinate(const unsigned &b)
Return the initial coordinates for the boundary.
void check_contiguousness_on_polylines_helper(Vector< TriangleMeshPolyLine * > &polylines_pt, unsigned &index)
Sort the polylines coming from joining them. Check whether it is necessary to reverse them or not....
Vector< TriangleMeshOpenCurve * > Internal_open_curve_pt
Vector of open polylines that define internal curves.
std::map< unsigned, Vector< unsigned > > & boundary_segment_inverted()
Return the info. to know if it is necessary to reverse the segment based on a previous mesh.
double region_attribute(const unsigned &i)
Return the attribute associated with region i.
static bool Suppress_warning_about_regions_and_boundaries
Public static flag to suppress warning; defaults to false.
std::map< unsigned, Vector< Vector< double > > > Boundary_segment_initial_coordinate
Stores the initial coordinates for the segments that appear when a boundary is splited among processo...
void disable_automatic_creation_of_vertices_on_boundaries()
Disables the creation of points (by Triangle) on the outer and internal boundaries.
void create_vertex_coordinates_for_polyline_connections(TriangleMeshCurviLine *boundary_pt, Vector< Vector< double > > &vertex_coord, Vector< std::pair< double, double > > &polygonal_vertex_arclength_info)
Helper function to create polyline vertex coordinates for curvilinear boundary specified by boundary_...
bool is_automatic_creation_of_vertices_on_boundaries_allowed()
Returns the status of the variable Allow_automatic_creation_of_vertices_on_boundaries.
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...
TriangleMeshPolyLine * boundary_polyline_pt(const unsigned &b)
Return pointer to the current polyline that describes the b-th mesh boundary.
Vector< TriangleMeshPolygon * > Outer_boundary_pt
Polygon that defines outer boundaries.
FiniteElement * boundary_element_in_region_pt(const unsigned &b, const unsigned &r, const unsigned &e) const
Return pointer to the e-th element adjacent to boundary b in region r.
std::map< unsigned, Vector< double > > Boundary_segment_initial_zeta
Stores the initial zeta coordinate for the segments that appear when a boundary is splited among proc...
std::map< unsigned, Vector< double > > & boundary_final_coordinate()
Return direct access to the final coordinates of a boundary.
const Vector< unsigned > boundary_segment_inverted(const unsigned &b) const
Return the info. to know if it is necessary to reverse the segment based on a previous mesh.
Vector< double > & boundary_final_coordinate(const unsigned &b)
Return the final coordinates for the boundary.
void set_nboundary_segment_node(const unsigned &b, const unsigned &s)
Set the number of segments associated with a boundary.
void check_contiguousness_on_polylines_helper(Vector< TriangleMeshPolyLine * > &polylines_pt, unsigned &index_halo_start, unsigned &index_halo_end)
Sort the polylines coming from joining them. Check whether it is necessary to reverse them or not....
Vector< TriangleMeshPolygon * > Internal_polygon_pt
Vector of polygons that define internal polygons.
std::map< unsigned, Vector< Vector< double > > > Boundary_segment_final_coordinate
Stores the final coordinates for the segments that appear when a boundary is splited among processors...
Vector< double > & boundary_coordinate_limits(const unsigned &b)
Return access to the coordinate limits associated with the geometric object associated with boundary ...
Vector< Vector< double > > & boundary_segment_final_coordinate(const unsigned &b)
Return the final coordinates for the segments that are part of a boundary.
std::map< unsigned, bool > Assigned_segments_initial_zeta_values
Flag used at the setup_boundary_coordinate function to know if initial zeta values for segments have ...
unsigned nboundary_segment(const unsigned &b)
Return the number of segments associated with a boundary.
Vector< double > & boundary_segment_final_arclength(const unsigned &b)
Return the final arclength for the segments that are part of a boundary.
Vector< unsigned > & boundary_segment_inverted(const unsigned &b)
Return the info. to know if it is necessary to reverse the segment based on a previous mesh.
void snap_nodes_onto_geometric_objects()
Snap the boundary nodes onto any curvilinear boundaries defined by geometric objects.
std::map< unsigned, Vector< double > > Boundary_initial_zeta_coordinate
Stores the initial zeta coordinate for the boundary.
std::map< unsigned, Vector< Vector< double > > > & boundary_segment_final_coordinate()
Return direct access to the final coordinates for the segments that are part of a boundary.
TriangleMeshOpenCurve * create_open_curve_with_polyline_helper(TriangleMeshOpenCurve *open_curve_pt, unsigned &max_bnd_id_local)
Helper function that creates and returns an open curve with the polyline representation of its consti...
Vector< double > & boundary_initial_zeta_coordinate(const unsigned &b)
Return the initial zeta coordinate for the boundary.
std::map< unsigned, std::set< Node * > > Nodes_on_boundary_pt
Stores a pointer to a set with all the nodes related with a boundary.
unsigned long nboundary_segment_node(const unsigned &b)
Return the number of segments associated with a boundary.
~UnstructuredTwoDMeshGeometryBase()
Empty destructor.
std::map< unsigned, Vector< Vector< Node * > > > Boundary_segment_node_pt
Used to store the nodes associated to a boundary and to an specific segment (this only applies in dis...
std::map< unsigned, Vector< Vector< double > > > & boundary_segment_initial_coordinate()
Return direct access to the initial coordinates for the segments that are part of a boundary.
std::map< unsigned, Vector< unsigned > > Boundary_segment_inverted
Stores the info. to know if it is necessary to reverse the segment based on a previous mesh.
std::map< unsigned, Vector< double > > Regions_coordinates
Storage for extra coordinates for regions. The key on the map is the region id.
void enable_automatic_creation_of_vertices_on_boundaries()
Enables the creation of points (by Triangle) on the outer and internal boundaries.
Vector< Vector< double > > Extra_holes_coordinates
Storage for extra coordinates for holes.
bool Allow_automatic_creation_of_vertices_on_boundaries
Flag to indicate whether the automatic creation of vertices along the boundaries by Triangle is allow...
UnstructuredTwoDMeshGeometryBase(const UnstructuredTwoDMeshGeometryBase &dummy)=delete
Broken copy constructor.
int face_index_at_boundary_in_region(const unsigned &b, const unsigned &r, const unsigned &e) const
Return face index of the e-th element adjacent to boundary b in region r.
Vector< std::map< unsigned, Vector< FiniteElement * > > > Boundary_region_element_pt
Storage for elements adjacent to a boundary in a particular region.
std::map< unsigned, Vector< double > > Boundary_coordinate_limits
Storage for the limits of the boundary coordinates defined by the use of geometric objects....
std::map< unsigned, Vector< double > > Boundary_segment_final_arclength
Stores the final arclength for the segments that appear when a boundary is splited among processors.
Vector< double > & boundary_final_zeta_coordinate(const unsigned &b)
Return the final zeta coordinate for the boundary.
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...
Vector< double > Region_attribute
Vector of attributes associated with the elements in each region.
std::map< unsigned, Vector< double > > & boundary_initial_coordinate()
Return direct access to the initial coordinates of a boundary.
Vector< std::map< unsigned, Vector< int > > > Face_index_region_at_boundary
Storage for the face index adjacent to a boundary in a particular region.
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...
unsigned nboundary_element_in_region(const unsigned &b, const unsigned &r) const
Return the number of elements adjacent to boundary b in region r.
TriangleMeshPolygon * closed_curve_to_polygon_helper(TriangleMeshClosedCurve *closed_curve_pt, unsigned &max_bnd_id_local)
Helper function that returns a polygon representation for the given closed curve, it also computes th...
void add_boundary_segment_node(const unsigned &b, const unsigned &s, Node *const &node_pt)
Add the node node_pt to the b-th boundary and the s-th segment of the mesh.
unsigned nregion()
Return the number of regions specified by attributes.
Vector< double > & boundary_segment_initial_zeta(const unsigned &b)
Return the initial zeta for the segments that are part of a boundary.
TriangleMeshCurveSection * curviline_to_polyline(TriangleMeshCurviLine *&curviline_pt, unsigned &bnd_id)
Helper function that creates the associated polyline representation for curvilines.
void setup_boundary_coordinates(const unsigned &b)
Setup boundary coordinate on boundary b. Boundary coordinate increases continously along polygonal bo...
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...
std::set< TriangleMeshOpenCurve * > Free_open_curve_pt
A set that contains the open curves created by this object therefore it is necessary to free their as...
std::map< unsigned, std::set< Node * > > & nodes_on_boundary_pt()
Gets a pointer to a set with all the nodes related with a boundary.
void create_vertex_coordinates_for_polyline_no_connections(TriangleMeshCurviLine *boundary_pt, Vector< Vector< double > > &vertex_coord, Vector< std::pair< double, double > > &polygonal_vertex_arclength_info)
Helper function to create polyline vertex coordinates for curvilinear boundary specified by boundary_...
Vector< Vector< double > > & boundary_segment_initial_coordinate(const unsigned &b)
Return the initial coordinates for the segments that are part of a boundary.
unsigned nregion_attribute()
Return the number of attributes used in the mesh.
unsigned get_associated_vertex_to_svalue(double &target_s_value, unsigned &bnd_id, double &s_tolerance)
Get the associated vertex to the given s value by looking to the list of s values created when changi...
std::set< TriangleMeshCurveSection * > Free_curve_section_pt
A set that contains the curve sections created by this object therefore it is necessary to free their...
std::map< unsigned, Vector< std::pair< double, double > > > Polygonal_vertex_arclength_info
Storage for pairs of doubles representing: .first: the arclength along the polygonal representation o...
Vector< double > & boundary_segment_initial_arclength(const unsigned &b)
Return the initial arclength for the segments that are part of a boundary.
std::map< unsigned, Vector< double > > Boundary_final_coordinate
Stores the final coordinates for the boundary.
std::map< unsigned, Vector< double > > & boundary_segment_final_zeta()
Return direct access to the final zeta for the segments that are part of a boundary.
std::map< unsigned, Vector< double > > Boundary_initial_coordinate
Stores the initial coordinates for the boundary.
std::map< unsigned, Vector< double > > & boundary_segment_initial_arclength()
Return direct access to the initial arclength for the segments that are part of a boundary.
std::set< TriangleMeshPolygon * > Free_polygon_pt
A set that contains the polygons created by this object therefore it is necessary to free their assoc...
std::map< unsigned, Vector< FiniteElement * > > Region_element_pt
Vector of elements in each region differentiated by attribute (the key of the map is the attribute)
std::map< unsigned, Vector< double > > Boundary_final_zeta_coordinate
Stores the final zeta coordinate for the boundary.
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....
void set_geom_objects_and_coordinate_limits_for_open_curve(TriangleMeshOpenCurve *input_open_curve_pt)
Stores the geometric objects associated to the curve sections that compound the open curve....
std::map< unsigned, Vector< double > > Boundary_segment_initial_arclength
Stores the initial arclength for the segments that appear when a boundary is splited among processors...
FiniteElement * region_element_pt(const unsigned &i, const unsigned &e)
Return the e-th element in the i-th region.
bool Immersed_rigid_body_triangle_mesh_polygon_used
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 set_geom_objects_and_coordinate_limits_for_close_curve(TriangleMeshClosedCurve *input_closed_curve_pt)
Stores the geometric objects associated to the curve sections that compound the closed curve....
std::map< unsigned, Vector< double > > & boundary_initial_zeta_coordinate()
Return direct access to the initial zeta coordinate of a boundary.
std::map< unsigned, Vector< double > > Boundary_segment_final_zeta
Stores the final zeta coordinate for the segments that appear when a boundary is splited among proces...
std::map< unsigned, TriangleMeshCurveSection * > Boundary_curve_section_pt
A map that stores the associated curve section of the specified boundary id.
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.
unsigned nregion_element(const unsigned &i)
Return the number of elements in the i-th region.
UnstructuredTwoDMeshGeometryBase()
Empty constructor.
void flush_boundary_segment_node(const unsigned &b)
Flush the boundary segment node storage.
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.
Vector< double > & boundary_segment_final_zeta(const unsigned &b)
Return the final zeta for the segments that are part of a boundary.
std::map< unsigned, Vector< double > > & boundary_coordinate_limits()
Return access to the vector of boundary coordinates associated with each geometric object.
unsigned long nboundary_segment_node(const unsigned &b, const unsigned &s)
Return the number of nodes associated with a given segment of a boundary.
std::map< unsigned, Vector< double > > & boundary_final_zeta_coordinate()
Return direct access to the final zeta coordinates of a boundary.
void operator=(const UnstructuredTwoDMeshGeometryBase &)=delete
Broken assignment operator.
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).
Structure for Boundary Informations.
FiniteElement * FE_pt
Pointer to bulk finite element.
unsigned Boundary
Boundary ID.
The Triangle data structure, modified from the triangle.h header supplied with triangle 1....
double * pointlist
Pointer to list of points x coordinate followed by y coordinate.
int numberoftriangleattributes
int * pointmarkerlist
Pointer to list of point markers.
double * trianglearealist
double * triangleattributelist
double * pointattributelist
Pointer to list of point attributes.
int numberofpointattributes
Data structure to store the base vertex info, initial or final vertex in the polylines have an associ...
bool has_base_vertex_assigned
Data structure filled when the connection matrix is created, for each polyline, there are two vertex_...
unsigned boundary_id_to_connect
unsigned boundary_chunk_to_connect
unsigned vertex_number_to_connect