libMesh

A C++ interface between LibMesh and the Triangle library written by J.R. More...
#include <mesh_triangle_interface.h>
Classes  
class  ArbitraryHole 
Another concrete instantiation of the hole, this one should be sufficiently general for most nonpolygonal purposes. More...  
class  Hole 
An abstract class for defining a 2dimensional hole. More...  
class  PolygonHole 
A concrete instantiation of the Hole class that describes polygonal (triangular, square, pentagonal, ...) holes. More...  
Public Types  
enum  TriangulationType { GENERATE_CONVEX_HULL = 0, PSLG = 1, INVALID_TRIANGULATION_TYPE } 
The TriangulationType is used with the general triangulate function defined below. More...  
Public Member Functions  
TriangleInterface (UnstructuredMesh &mesh)  
The constructor. More...  
~TriangleInterface ()  
Empty destructor. More...  
void  triangulate () 
This is the main public interface for this function. More...  
ElemType &  elem_type () 
Sets and/or gets the desired element type. More...  
Real &  desired_area () 
Sets and/or gets the desired triangle area. More...  
Real &  minimum_angle () 
Sets and/or gets the minimum angle. More...  
std::string &  extra_flags () 
Sets and/or gets additional flags to be passed to triangle. More...  
TriangulationType &  triangulation_type () 
Sets and/or gets the desired triangulation type. More...  
bool &  insert_extra_points () 
Sets and/or gets the flag for inserting add'l points. More...  
bool &  smooth_after_generating () 
Sets/gets flag which tells whether to do Delaunay mesh smoothing after generating the grid. More...  
void  attach_hole_list (const std::vector< Hole *> *holes) 
Attaches a vector of Hole* pointers which will be meshed around. More...  
Public Attributes  
std::vector< std::pair< unsigned int, unsigned int > >  segments 
When constructing a PSLG, it is often not possible to do so implicitly through the ordering of the points. More...  
Private Attributes  
UnstructuredMesh &  _mesh 
Reference to the mesh which is to be created by triangle. More...  
const std::vector< Hole * > *  _holes 
A pointer to a vector of Hole*s. More...  
ElemType  _elem_type 
The type of elements to generate. More...  
Real  _desired_area 
The desired area for the elements in the resulting mesh. More...  
Real  _minimum_angle 
Minimum angle in triangles. More...  
std::string  _extra_flags 
Additional flags to be passed to triangle. More...  
TriangulationType  _triangulation_type 
The type of triangulation to perform: choices are: convex hull PSLG. More...  
bool  _insert_extra_points 
Flag which tells whether or not to insert additional nodes before triangulation. More...  
bool  _smooth_after_generating 
Flag which tells whether we should smooth the mesh after it is generated. More...  
MeshSerializer  _serializer 
Triangle only operates on serial meshes. More...  
A C++ interface between LibMesh and the Triangle library written by J.R.
Shewchuk.
Definition at line 57 of file mesh_triangle_interface.h.
The TriangulationType is used with the general triangulate function defined below.
Enumerator  

GENERATE_CONVEX_HULL  Uses the triangle library to first generate a convex hull from the set of points passed in, and then triangulate this set of points. This is probably the most common type of usage. 
PSLG  Use the triangle library to triangulate a Planar Straight Line Graph which is defined implicitly by the order of the "points" vector: a straight line is assumed to lie between each successive pair of points, with an additional line joining the final and first points. In case your triangulation is a little too "structured" looking (which can happen when the initial PSLG is really simple) you can try to make the resulting triangulation a little more "unstructured" looking by setting insert_points to true in the triangulate() function. 
INVALID_TRIANGULATION_TYPE  Does nothing, used as a default value. 
Definition at line 78 of file mesh_triangle_interface.h.

explicit 
The constructor.
A reference to the mesh containing the points which are to be triangulated must be provided. Unless otherwise specified, a convex hull will be computed for the set of input points and the convex hull will be meshed.
libMesh::TriangleInterface::~TriangleInterface  (  ) 
void libMesh::TriangleInterface::attach_hole_list  (  const std::vector< Hole *> *  holes  ) 
Attaches a vector of Hole* pointers which will be meshed around.
Definition at line 162 of file mesh_triangle_interface.h.
References _holes.
Real& libMesh::TriangleInterface::desired_area  (  ) 
Sets and/or gets the desired triangle area.
Set to zero to disable area constraint.
Definition at line 129 of file mesh_triangle_interface.h.
References _desired_area.
ElemType& libMesh::TriangleInterface::elem_type  (  ) 
Sets and/or gets the desired element type.
Definition at line 123 of file mesh_triangle_interface.h.
References _elem_type.
std::string& libMesh::TriangleInterface::extra_flags  (  ) 
Sets and/or gets additional flags to be passed to triangle.
Definition at line 140 of file mesh_triangle_interface.h.
References _extra_flags.
bool& libMesh::TriangleInterface::insert_extra_points  (  ) 
Sets and/or gets the flag for inserting add'l points.
Definition at line 150 of file mesh_triangle_interface.h.
References _insert_extra_points.
Real& libMesh::TriangleInterface::minimum_angle  (  ) 
Sets and/or gets the minimum angle.
Set to zero to disable area constraint.
Definition at line 135 of file mesh_triangle_interface.h.
References _minimum_angle.
bool& libMesh::TriangleInterface::smooth_after_generating  (  ) 
Sets/gets flag which tells whether to do Delaunay mesh smoothing after generating the grid.
Definition at line 156 of file mesh_triangle_interface.h.
References _smooth_after_generating.
void libMesh::TriangleInterface::triangulate  (  ) 
This is the main public interface for this function.
Internally, it calls Triangle's triangulate routine.
TriangulationType& libMesh::TriangleInterface::triangulation_type  (  ) 
Sets and/or gets the desired triangulation type.
Definition at line 145 of file mesh_triangle_interface.h.
References _triangulation_type.

private 
The desired area for the elements in the resulting mesh.
Definition at line 198 of file mesh_triangle_interface.h.
Referenced by desired_area().

private 
The type of elements to generate.
(Defaults to TRI3).
Definition at line 193 of file mesh_triangle_interface.h.
Referenced by elem_type().

private 
Additional flags to be passed to triangle.
Definition at line 208 of file mesh_triangle_interface.h.
Referenced by extra_flags().

private 
A pointer to a vector of Hole*s.
If this is nullptr, there are no holes!
Definition at line 187 of file mesh_triangle_interface.h.
Referenced by attach_hole_list().

private 
Flag which tells whether or not to insert additional nodes before triangulation.
This can sometimes be used to "deregularize" the resulting triangulation.
Definition at line 222 of file mesh_triangle_interface.h.
Referenced by insert_extra_points().

private 
Reference to the mesh which is to be created by triangle.
Definition at line 181 of file mesh_triangle_interface.h.

private 
Minimum angle in triangles.
Definition at line 203 of file mesh_triangle_interface.h.
Referenced by minimum_angle().

private 
Triangle only operates on serial meshes.
Definition at line 233 of file mesh_triangle_interface.h.

private 
Flag which tells whether we should smooth the mesh after it is generated.
True by default.
Definition at line 228 of file mesh_triangle_interface.h.
Referenced by smooth_after_generating().

private 
The type of triangulation to perform: choices are: convex hull PSLG.
Definition at line 215 of file mesh_triangle_interface.h.
Referenced by triangulation_type().
std::vector<std::pair<unsigned int, unsigned int> > libMesh::TriangleInterface::segments 
When constructing a PSLG, it is often not possible to do so implicitly through the ordering of the points.
You can use the segments vector to specify the segments explicitly, Ex: unit square numbered counterclockwise starting from origin segments[0] = (0,1) segments[1] = (1,2) segments[2] = (2,3) segments[3] = (3,0) For this case you could actually use the implicit ordering!
Definition at line 175 of file mesh_triangle_interface.h.