[Gmsh] C++ API for using GMSH::Mesher

Josef Weinbub weinbub at gmail.com
Tue Jan 13 11:42:55 CET 2009


Hi all!

What I am working on:
---------------------
I am working on an C++ API which should allow my application to use the
3D mesher capabilities of GMSH. The goal is to feed the GMSH::Mesher
with geometry information (boundary points and interior points) and
topology (the boundary facets/triangles as in this case). As a result
the mesher should provide me with a 3D tet mesh where the interior
points and the given boundary(points/facets) should be respected. After
a successful mesh is created the GMSH::Mesh domain should be written
back to my domain via some kind of writeback() function, which copies
the geometry(the points) and the topology(of the meshed tetrahedras)
back.

The following parts describe my approach. It would be great if someone
can look it through and give me some hints.

The problem:
------------
The problem is that the mesher doesn't mesh anything. The *.msh output
after calling mesh(3) only contains the previously entered points and
the triangles(which should act as the boundary of the volume).

The approach:
-------------
So far I've used the readMSH() function within GModelIO_Mesh.cpp as a
basis for the API implementation. I tried to copy the mechanisms within
the readMSH() function. 

the key steps are: 
 -) setting up geometry: creating MVertex objects and store them on the 
                         GModel object via "_storeVerticesInEntities()"
 -) setting up topology: creating MElement objects of type 2 (triangles 
                         as these triangles should bound my 3D volume).
                         (note that reg=physical=part=0)
                         the elements are stored on the GModel object 
                         via "_storeElementsInEntities()"
 -) associateEntityWithMeshVertices: calling the function
                         _associateEntityWithMeshVertices()

 -) mesh(3): call the mesh algorithm ...


Thank you very much for your time,
yours Josef