34#ifdef OOMPH_HAS_TRIANGLE_LIB
54 for (
unsigned b = 0; b <
nb; b++)
58 dump_file <<
"1 # Boundary coordinate for boundary " << b
62 for (
unsigned j = 0;
j <
nnod;
j++)
68 dump_file <<
"-999 # Done boundary coords for boundary " << b <<
"\n";
72 dump_file <<
"0 # Boundary coordinate for boundary " << b
73 <<
" does not exist\n";
116 <<
"Number of boundaries before remesh from triangulateio, "
117 <<
nbound_new <<
",\ndoesn't match number boundaries afterwards, "
119 <<
". Have you messed \naround with boundary nodes in the "
120 <<
"derived mesh constructor (or after calling \nit)? If so,"
121 <<
" the dump/restart won't work as written at the moment.";
133 for (
unsigned b = 0; b <
nb; b++)
163 <<
" doesn't match number of nodes on boundary " << b
164 <<
": " <<
nnod << std::endl;
171 for (
unsigned j = 0;
j <
nnod;
j++)
195 error_stream <<
"Haven't read all nodes on boundary " << b
204 oomph_info <<
"Restart: Boundary coordinate for boundary " << b
205 <<
" does not exist.\n";
229 outfile <<
"# Triangulateio object values:\n\n" << std::endl;
234 outfile <<
"# Triangulateio number of points is:"
235 <<
triangle.numberofpoints << std::endl;
239 outfile <<
"# Vertex coordinates are:" << std::endl;
240 for (
int k = 0;
k <
triangle.numberofpoints * 2;
k += 2)
243 <<
triangle.pointlist[
k + 1] << std::endl;
248 if (
triangle.numberofpointattributes != 0)
250 outfile <<
"# Triangulateio number of points attributelist is:"
251 <<
triangle.numberofpointattributes << std::endl;
255 outfile <<
"# Vertex attribute are:" << std::endl;
256 for (
int k = 0;
k <
triangle.numberofpointattributes;
k++)
265 outfile <<
"# Vertex Markers are:" << std::endl;
279 <<
triangle.numberofpointattributes <<
" 0" << std::endl;
280 for (
int j = 0;
j <
triangle.numberofpoints * 2;
j += 2)
283 <<
triangle.pointlist[
j + 1] << std::endl;
296 outfile <<
"# Segments are:" << std::endl;
297 for (
int k = 0;
k <
triangle.numberofsegments * 2;
k += 2)
300 <<
triangle.segmentlist[
k + 1] << std::endl;
307 outfile <<
"# Segments Markers are:" << std::endl;
308 for (
int k = 0;
k <
triangle.numberofsegments;
k++)
329 outfile <<
"# Holes are:" << std::endl;
330 for (
int k = 0;
k <
triangle.numberofholes * 2;
k += 2)
338 if (
triangle.numberoftriangles != 0)
340 outfile <<
"# Triangulateio number of triangles:"
341 <<
triangle.numberoftriangles << std::endl;
345 outfile <<
"# Triangulateio number of corners:"
346 <<
triangle.numberofcorners << std::endl;
348 if (
triangle.numberoftriangleattributes != 0)
350 outfile <<
"# Triangulateio number of triangles attributes:"
351 <<
triangle.numberoftriangleattributes << std::endl;
355 outfile <<
"# Traingles are:" << std::endl;
356 for (
int k = 0;
k <
triangle.numberoftriangles * 3;
k += 3)
360 <<
triangle.trianglelist[
k + 2] << std::endl;
366 outfile <<
"# Triangle's areas are:" << std::endl;
367 for (
int k = 0;
k <
triangle.numberoftriangles;
k++)
382 for (
int j = 0;
j <
triangle.numberoftriangles * 3;
j += 3)
386 <<
triangle.trianglelist[
j + 2] << std::endl;
435 std::map<Edge, TriangleBoundaryHelper::BCInfo>
edge_bcinfo;
436 std::map<Edge, TriangleBoundaryHelper::BCInfo>
face_info;
444 for (
unsigned e = 0;
e <
nel;
e++)
462 for (
unsigned i = 0;
i < 3;
i++)
487 std::insert_iterator<std::set<unsigned>>(
488 edge_boundary[0], edge_boundary[0].
begin()));
489 std::set<unsigned>::iterator
it0 = edge_boundary[0].begin();
492 if (edge_boundary[0].size() > 0)
516 std::insert_iterator<std::set<unsigned>>(
517 edge_boundary[1], edge_boundary[1].
begin()));
526 std::set<unsigned>::iterator
it1 = edge_boundary[1].begin();
529 if (edge_boundary[1].size() > 0)
553 std::insert_iterator<std::set<unsigned>>(
554 edge_boundary[2], edge_boundary[2].
begin()));
563 std::set<unsigned>::iterator
it2 = edge_boundary[2].begin();
566 if (edge_boundary[2].size() > 0)
587 for (
unsigned i = 0;
i < 3;
i++)
594 for (std::set<unsigned>::iterator
it = edge_boundary[
i].
begin();
595 it != edge_boundary[
i].end();
607 error_stream <<
"This is rather strange, so I'm going to die\n";
617 for (
unsigned i = 0;
i < 3;
i++)
625 typedef std::map<Edge, TriangleBoundaryHelper::BCInfo>::iterator
ITE;
629 unsigned bound =
it->second.Boundary;
643 info.Face_id =
it->second.Face_id;
644 info.FE_pt =
it->second.FE_pt;
645 info.Boundary =
it->second.Boundary;
716 if (
itt->second.Boundary ==
i)
737 outfile <<
"Boundary: " <<
i <<
" is adjacent to " <<
nel <<
" elements"
741 for (
unsigned e = 0;
e <
nel;
e++)
745 <<
" Face index of boundary is "
//////////////////////////////////////////////////////////////////////// ////////////////////////////...
A general Finite Element class.
double size() const
Calculate the size of the element (length, area, volume,...) in Eulerian computational coordinates....
unsigned dim() const
Return the spatial dimension of the element, i.e. the number of local coordinates required to paramet...
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
unsigned long nboundary_node(const unsigned &ibound) const
Return number of nodes on a particular boundary.
bool is_mesh_distributed() const
Boolean to indicate if Mesh has been distributed.
Vector< Vector< FiniteElement * > > Boundary_element_pt
Vector of Vector of pointers to elements on the boundaries: Boundary_element_pt(b,...
bool Lookup_for_elements_next_boundary_is_setup
Flag to indicate that the lookup schemes for elements that are adjacent to the boundaries has been se...
std::vector< bool > Boundary_coordinate_exists
Vector of boolean data that indicates whether the boundary coordinates have been set for the boundary...
FiniteElement * finite_element_pt(const unsigned &e) const
Upcast (downcast?) to FiniteElement (needed to access FiniteElement member functions).
Vector< Vector< int > > Face_index_at_boundary
For the e-th finite element on boundary b, this is the index of the face that lies along that boundar...
unsigned nboundary() const
Return number of boundaries.
unsigned long nelement() const
Return number of elements in the mesh.
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...
virtual void get_boundaries_pt(std::set< unsigned > *&boundaries_pt)
Return a pointer to set of mesh boundaries that this node occupies; this will be overloaded by Bounda...
An OomphLibError object which should be thrown when an run-time error is encountered....
//////////////////////////////////////////////////////////////////////
virtual void remesh_from_internal_triangulateio()
Virtual function that is used for specific remeshing from the triangulateio.
void dump_triangulateio(std::ostream &dump_file)
Dump the triangulateio structure to a dump file and record boundary coordinates of boundary nodes.
TriangulateIO Triangulateio
TriangulateIO representation of the mesh.
void remesh_from_triangulateio(std::istream &restart_file)
Regenerate the mesh from a dumped triangulateio file and dumped boundary coordinates of boundary node...
void setup_boundary_element_info()
Setup lookup schemes which establish whic elements are located next to mesh's boundaries (wrapper to ...
void write_triangulateio(TriangulateIO &triangulate_io, std::string &s)
Helper function. Write a TriangulateIO object file with all the triangulateio fields....
A slight extension to the standard template vector class so that we can include "graceful" array rang...
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 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 clear_triangulateio(TriangulateIO &triangulate_io, const bool &clear_hole_data)
Clear TriangulateIO structure.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
OomphInfo oomph_info
Single (global) instantiation of the OomphInfo object – this is used throughout the library as a "rep...
Structure for Boundary Informations.
The Triangle data structure, modified from the triangle.h header supplied with triangle 1....