[Gmsh] node and element sparsity in msh4
jeremy theler
jeremy at seamplex.com
Fri Sep 14 04:43:30 CEST 2018
Dear developers,
I am updating my .msh parser for the new version 4 format. What I found
was that nodes and elements are "sparse" (borrowing exact terms from
Gmsh manual) in the sense that they do not constitute a continuous list
of indexes starting at 1.
For example, the attached geo generates 45 nodes numbered up to an
index of 90 and 68 elements up to 184 using latest stable 4.0.1. Even
using RenumberMeshNodes and RenumberMeshElements (the output is the
same with these two instructions in and out... what do they actually
do?).
As the manual correctly says, this "sparcity" impacts efficiency and
performance as arrays cannot be used and other types of objects need to
appear (linked lists, hashed lists, etc) in order to handle them.
I still want to use arrays on my code due to performance issues. I
might re-order the nodes to get them straight at parse-time, but I
think that should be done on the mesher side (because the same mesh
might be read several times from the solver side so it makes no sense
to re-order every time).
On the other hand, if I use msh2 output (even in Gmsh 4.0.1) the
sparcity is gone and I can rely on my good old arrays.
Question is: what are the benefits of this behavior in msh4?
and again, what do RenumberNodes and RenumberElements do?
--
jeremy theler
www.seamplex.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tmp.geo
Type: text/x-csrc
Size: 219 bytes
Desc: not available
URL: <http://onelab.info/pipermail/gmsh/attachments/20180913/7e05efab/attachment.geo>
-------------- next part --------------
$MeshFormat
2.2 0 8
$EndMeshFormat
$Nodes
45
1 0.5 -0.5 0
2 1.5 -0.5 0
3 1.5 0.5 0
4 0.5 0.5 0
5 0.7000000000000004 -0.5 0
6 0.900000000000001 -0.5 0
7 1.100000000000001 -0.5 0
8 1.3 -0.5 0
9 1.5 -0.2999999999999997 0
10 1.5 -0.09999999999999898 0
11 1.5 0.1000000000000009 0
12 1.5 0.3000000000000004 0
13 1.3 0.5 0
14 1.099999999999999 0.5 0
15 0.8999999999999991 0.5 0
16 0.6999999999999996 0.5 0
17 0.5 0.2999999999999997 0
18 0.5 0.09999999999999898 0
19 0.5 -0.1000000000000009 0
20 0.5 -0.3000000000000004 0
21 0.9999999999999996 6.730727086790012e-16 0
22 1.212499999999999 -0.2124999999999996 0
23 1.2125 0.2124999999999997 0
24 0.7874999999999996 -0.2124999999999999 0
25 0.7874999999999995 0.2125000000000009 0
26 0.9896739130434777 0.2960644531250003 0
27 0.7039355468749997 -0.01032608695652164 0
28 1.010326086956522 -0.2960644531249997 0
29 1.296064453125 0.01032608695652221 0
30 1.342986111111111 -0.3429861111111108 0
31 1.335537825674487 0.3355378256744874 0
32 0.6644621743255125 -0.3355378256744876 0
33 0.6644621743255121 0.3355378256744878 0
34 1.13165665125543 -0.06965568849233006 0
35 0.9244708316955035 -0.1167953758399825 0
36 1.0689659716829 0.131452307738909 0
37 0.8830470425015831 0.07542366110451995 0
38 1.370310112847222 -0.1890320048309173 0
39 1.187542347743593 0.3688204557598975 0
40 0.812457652256407 -0.3688204557598975 0
41 0.6311795442401023 0.1875423477435931 0
42 1.193162439613527 -0.370310112847222 0
43 0.6311795442401024 -0.1916727825262021 0
44 0.8083272174737977 0.3688204557598977 0
45 1.368820455759898 0.1916727825262021 0
$EndNodes
$Elements
68
1 2 2 1 2 22 34 28
2 2 2 1 2 23 36 29
3 2 2 1 2 34 35 28
4 2 2 1 2 29 36 34
5 2 2 1 2 35 37 27
6 2 2 1 2 24 35 27
7 2 2 1 2 25 37 26
8 2 2 1 2 26 37 36
9 2 2 1 2 19 27 18
10 2 2 1 2 7 28 6
11 2 2 1 2 15 26 14
12 2 2 1 2 11 29 10
13 2 2 1 2 2 30 8
14 2 2 1 2 9 30 2
15 2 2 1 2 3 31 12
16 2 2 1 2 13 31 3
17 2 2 1 2 1 32 20
18 2 2 1 2 5 32 1
19 2 2 1 2 4 33 16
20 2 2 1 2 17 33 4
21 2 2 1 2 19 43 27
22 2 2 1 2 7 42 28
23 2 2 1 2 15 44 26
24 2 2 1 2 11 45 29
25 2 2 1 2 23 39 26
26 2 2 1 2 27 43 24
27 2 2 1 2 26 39 14
28 2 2 1 2 25 41 27
29 2 2 1 2 29 45 23
30 2 2 1 2 26 44 25
31 2 2 1 2 27 41 18
32 2 2 1 2 28 42 22
33 2 2 1 2 24 40 28
34 2 2 1 2 28 40 6
35 2 2 1 2 29 38 10
36 2 2 1 2 22 38 29
37 2 2 1 2 21 37 35
38 2 2 1 2 26 36 23
39 2 2 1 2 36 37 21
40 2 2 1 2 27 37 25
41 2 2 1 2 21 35 34
42 2 2 1 2 28 35 24
43 2 2 1 2 29 34 22
44 2 2 1 2 34 36 21
45 2 2 1 2 10 38 9
46 2 2 1 2 8 42 7
47 2 2 1 2 14 39 13
48 2 2 1 2 6 40 5
49 2 2 1 2 18 41 17
50 2 2 1 2 12 45 11
51 2 2 1 2 20 43 19
52 2 2 1 2 16 44 15
53 2 2 1 2 9 38 30
54 2 2 1 2 30 42 8
55 2 2 1 2 31 45 12
56 2 2 1 2 32 43 20
57 2 2 1 2 13 39 31
58 2 2 1 2 5 40 32
59 2 2 1 2 33 44 16
60 2 2 1 2 17 41 33
61 2 2 1 2 30 38 22
62 2 2 1 2 31 39 23
63 2 2 1 2 22 42 30
64 2 2 1 2 32 40 24
65 2 2 1 2 33 41 25
66 2 2 1 2 23 45 31
67 2 2 1 2 24 43 32
68 2 2 1 2 25 44 33
$EndElements
More information about the gmsh
mailing list