1

I would like to link my Fortran 90 application to a library which would give me Delaunay triangulation (for a 2D set of points) and tetrahedralization (for a 3D set of points). As suggested in Fastest Delaunay triangulation libraries for sets of 3D points thread I am going to try TETGEN, which functions as both, a library and a command line utility. By default, TETGEN gives you 3D Delaunay tetrahedralization, and I would like to know if I can also obtain Delaunay triangulation for a set of 2D points using TETGEN. As was pointed out in the comments below, this can be accomplished using TRIANGLE via an API similar to TETGEN, but I would still like to link my code to a single library and not two different ones depending on the dimension.

So, can I use TETGEN with a 2D set of points in addition to 3D? Any other suggestions on what library I can use? The thread above also mentions CGAL.

Anton Menshov
  • 8,672
  • 7
  • 38
  • 94
mishatomsk
  • 11
  • 2
  • Are you sure that triangle isn't available as a library? I'd understood that both PETSc and libmesh use it in that way. – origimbo May 18 '16 at 18:06
  • 1
    In fact, if you download a recent copy of triangle and look at the commented head of the header file triangle.h, it has a section called "How to call Triangle from another program" which seems to document an API unsurprisingly close to that of Tetgen. – origimbo May 18 '16 at 18:15
  • Thank you for your answer. I just did not see it on their website and assumed that it is unavailable. What you said makes perfect sense to me now. However, I would still prefer to link against one single library and not two depending on the dimension. Also I am trying to stay away from massive "framework" type packages like PETSc and libMesh. So far I have been using HYPRE as a linear solver and GMSH as a mesh file generator. I am using gmsh via GUI and not linking my application to it. I am not sure that gmsh can give me Delaunay triangulation either. – mishatomsk May 18 '16 at 20:50
  • 3
    I suggest CGAL. I think you'll find that implementation of 2D Delaunay to be close to the state of the art. – Bill Greene May 18 '16 at 21:11

1 Answers1

1

TetGen is specifically designed to perform 3-D meshes -> tetrahedralization. I do not see a reliable and direct way to use it explicitly as a 2-D mesher. It is well pointed out that Triangle has a "surprisingly" similar API and specifically targets 2-D mesh generation. No surprise is there: both TetGen and Triangle are a part of pdelib2 software collection that contains necessary building blocks for solving PDEs. So, if you are already using TetGen, I would advise going to add Triangle to your library dependencies (maybe in addition to a couple of other "helpers" from pdelib2).

Regarding GMSH. Recently, GMSH started to offer API to its functionality for C, C++, Python, and Julia. That would eliminate the need to use GMSH GUI or even command line interfaces. And certainly, GMSH offers Delaunay triangulation.

Anton Menshov
  • 8,672
  • 7
  • 38
  • 94