H2Lib
3.0

Twodimensional triangular meshes. More...
Data Structures  
struct  _tri2d 
Representation of a twodimensional triangular mesh. More...  
struct  _tri2dref 
Representation of the refinement relationship between two meshes. More...  
Typedefs  
typedef struct _tri2d  tri2d 
Twodimensional triangulat mesh.  
typedef tri2d *  ptri2d 
Pointer to tri2d object.  
typedef const tri2d *  pctri2d 
Pointer to constant tri2d object.  
typedef struct _tri2dref  tri2dref 
typedef tri2dref *  ptri2dref 
Pointer to tri2dref object.  
typedef const tri2dref *  pctri2dref 
Pointer to constant tri2dref object.  
typedef struct _tri2dbuilder  tri2dbuilder 
Tool for constructing tri2d meshes.  
typedef tri2dbuilder *  ptri2dbuilder 
Functions  
ptri2d  new_tri2d (uint vertices, uint edges, uint triangles) 
Create a partially initialized tri2d mesh. More...  
void  del_tri2d (ptri2d t2) 
Delete a tri2d object. More...  
ptri2d  new_unitsquare_tri2d () 
Create a mesh containing two triangles representing the unit square, . More...  
ptri2d  new_unitcircle_tri2d () 
Create a mesh containing four triangles representing the unit square, . More...  
ptri2d  new_lshape_tri2d () 
Create a mesh containing six triangles representing a Lshaped domain with vertices . More...  
ptri2d  new_ushape_tri2d () 
Create a mesh containing twentyfour triangles representing a Ushaped domain. More...  
void  write_tri2d (pctri2d t2, const char *name) 
Write a triangular mesh to a file. More...  
ptri2d  read_tri2d (const char *name) 
Read a triangular mesh from a file. More...  
void  getvertices_tri2d (pctri2d t2, uint tn, uint v[]) 
Find the vertices of a triangle. More...  
void  fixnormals_tri2d (ptri2d t2) 
Ensure that the vertices of boundary edges are in counterclockwise order as seen from outside of the mesh. More...  
void  check_tri2d (pctri2d t2) 
Perform various consistency checks. More...  
ptri2d  refine_tri2d (pctri2d t2, ptri2dref *t2r) 
Regular refinement of a triangular mesh. More...  
void  del_tri2dref (ptri2dref t2r) 
Delete a tri2dref object. More...  
void  draw_cairo_tri2d (pctri2d t2, const char *filename, bool mark_refedges, int mark_triangle) 
Draw a tri2d mesh. More...  
void  smooth_unitcircle_tri2d (ptri2d t2) 
Smooth a tri2d unitcircle. More...  
ptri2dbuilder  new_tri2dbuilder (uint vertices) 
Create a new tri2dbuilder object. More...  
void  del_tri2dbuilder (ptri2dbuilder tb) 
Delete a tri2dbuilder object. More...  
real(*  getx_tri2dbuilder (ptri2dbuilder tb))[2] 
Obtain array of vertex coordinates in tri2dbuilder object. More...  
void  addtriangle_tri2dbuilder (ptri2dbuilder tb, uint v0, uint v1, uint v2) 
Add a triangle to a tri2dbuilder object. More...  
ptri2d  buildmesh_tri2dbuilder (ptri2dbuilder tb) 
Create a tri2d mesh from the geometrical and topological information stored in a tri2dbuilder object. More...  
Twodimensional triangular meshes.
typedef tri2dbuilder* ptri2dbuilder 
Pointer to tri2dbuilder object
void addtriangle_tri2dbuilder  (  ptri2dbuilder  tb, 
uint  v0,  
uint  v1,  
uint  v2  
) 
Add a triangle to a tri2dbuilder object.
tb  Target tri2dbuilder object. 
v0  Index of first vertex. 
v1  Index of second vertex. 
v2  Index of third vertex. 
ptri2d buildmesh_tri2dbuilder  (  ptri2dbuilder  tb  ) 
Create a tri2d mesh from the geometrical and topological information stored in a tri2dbuilder object.
Once the mesh has been created, the corresponding tri2dbuilder object can be deleted.
tb  Source tri2dbuilder object. 
void check_tri2d  (  pctri2d  t2  ) 
Perform various consistency checks.
t2  Mesh 
void del_tri2dbuilder  (  ptri2dbuilder  tb  ) 
Delete a tri2dbuilder object.
tb  Object to be deleted. 
Draw a tri2d mesh.
Draw a tri2d mesh.
t2  This grid will be drawn. 
filename  In this fill the mesh will be drawn. 
mark_refedges  
mark_triangle 
void fixnormals_tri2d  (  ptri2d  t2  ) 
Ensure that the vertices of boundary edges are in counterclockwise order as seen from outside of the mesh.
t2  Mesh, offending boundary edges will be reordered 
Find the vertices of a triangle.
Due to the hierarchical representation of geometric objects, we cannot access the vertices of a triangle directly. This function finds the vertices and returns them in a specific order: v[i]
is the vertex opposite the i
th edge.
t2  Mesh 
tn  Number of the triangle 
v  Will be filled with vertex numbers. 
real(* getx_tri2dbuilder  (  ptri2dbuilder  tb  )  )[2] 
Obtain array of vertex coordinates in tri2dbuilder object.
Since tri2dbuilder is an opaque class, this function is provided for setting the coordinates of the vertices.
tb  tri2dbuilder object. 
tb>vertices
entries of type real [2]
representing the vertex coordinates. ptri2d new_lshape_tri2d  (  ) 
Create a mesh containing six triangles representing a Lshaped domain with vertices .
ptri2dbuilder new_tri2dbuilder  (  uint  vertices  ) 
Create a new tri2dbuilder object.
vertices  Number of vertices of the new mesh. 
ptri2d new_unitcircle_tri2d  (  ) 
Create a mesh containing four triangles representing the unit square, .
ptri2d new_unitsquare_tri2d  (  ) 
Create a mesh containing two triangles representing the unit square, .
ptri2d new_ushape_tri2d  (  ) 
Create a mesh containing twentyfour triangles representing a Ushaped domain.
ptri2d read_tri2d  (  const char *  name  ) 
Regular refinement of a triangular mesh.
The mesh is globally refined using regular refinement.
t2  Coarse mesh 
t2r  If not null, the target pointer will be set to a new tri2dref object describing the refinement relationship 
void smooth_unitcircle_tri2d  (  ptri2d  t2  ) 
void write_tri2d  (  pctri2d  t2, 
const char *  name  
) 
Write a triangular mesh to a file.
t2  Source mesh 
name  Filename 