[Gmsh] Where to find the code that reads msh file and generates faces?

Jeremy Theler jeremy at seamplex.com
Thu Sep 28 23:09:36 CEST 2017

> Thank you for your response. So, just to be sure we are on the same 
> page. Consider a 2D grid, it has vertices (points), faces (lines joining 
> points) and cells (polygons). Gmsh outputs  the vertices, the cells and 
> the boundary faces only. 

Yes, this is correct. Strictly speaking, Gmsh treats all points, lines and polygons as "elements" and it
only outputs those "elements" that belong to a physical entity. It does not "keep track" of the lines that
separate two polygons that are located in the bulk of the domain.

> My objective is now to generate the interior faces as well, and this is 
> the process which is slow for me. Is this the same process you are 
> referring to when you say it is an unresolved issue? 

More or less. I do not need to have information about actual "line elements" that separate two triangles
(nor Gmsh does). For my FVM codes, what I need is a list of neighbors each cell has. For your 2D examples,
I need to have for each triangle a list of three other elements. For bulk elements, this list will contain
the id of three other triangles. For triangles in the border, I will have either 2 triangles and 1 line or
1 triangle and 2 lines. That's why at some point I suggested to add an optional section $Neighbors$ to the
msh file:


> If yes, then thank you. You solved my question, since I see you 
> mentioning that you use a poorly designed algorithm to do this and I 
> think this is the best one can do straight from gmsh. 

I agree the best way would be to compute this information from Gmsh. But this feature is not coded yet in Gmsh.
My approach is based on having a list of elements associated to each node and then trying to find common nodes between volumetric elements:


jeremy theler

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://onelab.info/pipermail/gmsh/attachments/20170928/8d7696b0/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part
URL: <http://onelab.info/pipermail/gmsh/attachments/20170928/8d7696b0/attachment.asc>

More information about the gmsh mailing list