[Gmsh] Extract mesh info from C++ API classes

Martin Vymazal martin.vymazal at vki.ac.be
Wed Apr 2 16:52:23 CEST 2014


Hello,

 I have just one quick question about this. Is there a particular reason why 
the majority of gmsh sources contain absolutely no comments? It is hard to 
understand code if you don't even know what is its purpose. What I mean is 
that 3 lines of top each class header saying what the class is supposed to do 
would already be a big help ...
 I understand that developers like to code and not write documentation, but 
besides that, are there any other reasons?

Best regards,

   Martin Vymazal

On Wednesday 12 February 2014 17:02:11 Christophe Geuzaine wrote:
> On 11 Feb 2014, at 11:38, Sacconi, Andrea <a.sacconi11 at imperial.ac.uk> 
wrote:
> > Hi all GMSH users,
> > 
> > I would like to ask you a quick question about the usage of the API C++
> > classes to extract the connectivity of the mesh, once it has been
> > created. The setting is a planar mesh of triangles. I managed to create
> > the GModel, passing lines, planar surface and physical entities. So far,
> > so good. The problem is, how can I extract how many triangles I have got
> > and their vertices? It seems a silly question, but I am really confused
> > about all the methods I found. What is the method to traverse only the
> > elements and extract their vertices?
> > 
> > For example, what is the difference between GVertex and MVertex? Same
> > questions for the other geometrical objects ... In general, I need to
> > pass the connectivity information to the C++ code I am writing for my
> > thesis simulations.
> Basically:
> 
> * a model is stored as a GModel
> * the GModel contains a bunch of geometrical entities derived from GEntity
> (GVertex, GEdge, GFace, GRegion) * each GEntity can store its mesh: i.e.,
> both mesh elements, derived from MElement (MPoint, MLine, MTriangle,
> MTetrahedron, etc.), and mesh vertices (derived from MVertex)
> 
> The 2009 paper contains the basics... but we should indeed write a short
> introduction to the API.
> 
> Christophe
> 
> > Any help would be much appreciated!
> > Kind regards,
> > Andrea
> > __________________________________________________________
> > 
> > Andrea Sacconi
> > PhD student, Applied Mathematics
> > AMMP Section, Department of Mathematics, Imperial College London,
> > London SW7 2AZ, UK
> > a.sacconi11 at imperial.ac.uk
> > 
> > _______________________________________________
> > gmsh mailing list
> > gmsh at geuz.org
> > http://www.geuz.org/mailman/listinfo/gmsh