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

Jayesh Badwaik badwaik.jayesh at gmail.com
Fri Sep 22 12:13:06 CEST 2017


Hi,

I am looking for code in gmsh that reads the msh file (say of an 2d 
triangular grid as the msh file attached in the mail) and populates the 
faces which are displayed in the mesh but not written in the gmsh file. 
(As far as I understand, gmsh writes only the boundary faces.) 

I am trying to write a code that reads msh files and and converts it into 
a grid. This involves populating the faces which are not written in the 
msh file. I see that gmsh itself is able to read the msh file and populate 
the faces very quickly (almost instantly on my computer). 

In contrast, my own finite volume code takes substantially more time to 
read the same mesh. Hence, I am wondering how gmsh does it so quickly 
and would like to read the relevant code. 

Thank you


-- 
Cheers
Jayesh Badwaik
https://www.jayeshbadwaik.in
-------------- next part --------------
$MeshFormat
2.2 0 8
$EndMeshFormat
$Nodes
13
1 -1 -1 0
2 1 -1 0
3 1 1 0
4 -1 1 0
5 -2.752797989558076e-12 -1 0
6 1 -2.752797989558076e-12 0
7 2.752797989558076e-12 1 0
8 -1 2.752797989558076e-12 0
9 0 -5.418753048657249e-18 0
10 0.4999999999988027 -0.5000000000011973 0
11 0.5000000000011973 0.4999999999988027 0
12 -0.5000000000010252 -0.4999999999989747 0
13 -0.4999999999988027 0.5000000000011973 0
$EndNodes
$Elements
28
1 15 2 0 1 1
2 15 2 0 2 2
3 15 2 0 3 3
4 15 2 0 4 4
5 1 2 0 5 1 5
6 1 2 0 5 5 2
7 1 2 0 6 2 6
8 1 2 0 6 6 3
9 1 2 0 7 3 7
10 1 2 0 7 7 4
11 1 2 0 8 4 8
12 1 2 0 8 8 1
13 2 2 0 10 6 9 10
14 2 2 0 10 7 9 11
15 2 2 0 10 11 9 6
16 2 2 0 10 13 9 7
17 2 2 0 10 1 12 8
18 2 2 0 10 2 10 5
19 2 2 0 10 3 11 6
20 2 2 0 10 4 13 7
21 2 2 0 10 5 10 9
22 2 2 0 10 5 9 12
23 2 2 0 10 8 12 9
24 2 2 0 10 8 9 13
25 2 2 0 10 2 6 10
26 2 2 0 10 3 7 11
27 2 2 0 10 4 8 13
28 2 2 0 10 1 5 12
$EndElements
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_open.geo
Type: text/x-csrc
Size: 306 bytes
Desc: not available
URL: <http://onelab.info/pipermail/gmsh/attachments/20170922/cb77531b/attachment.geo>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <http://onelab.info/pipermail/gmsh/attachments/20170922/cb77531b/attachment.asc>


More information about the gmsh mailing list