CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (https://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   [Gmsh] Vertex numbering is dense (https://www.cfd-online.com/Forums/openfoam-meshing/157271-vertex-numbering-dense.html)

KateEisenhower July 24, 2015 07:56

Vertex numbering is dense
 
Hello foamers,

I always wondered what the meaning of

Code:

Vertex numbering is dense
is, when importing a *.msh file into gmsh. Is this an error message? What does ist mean?

Here you can find my complete output:

Code:

Info    : -------------------------------------------------------
Info    : Gmsh version  : 2.9.3
Info    : Build OS      : MacOSX
Info    : Build options  : 64Bit Ann Bamg Bfgs Blas(VecLib) Blossom Chaco DIntegration Dlopen Fltk Gmm Jpeg(Fltk) Kbipack Lapack(VecLib) MathEx Med Mesh Metis Mmg3d Mpeg NativeFileChooser Netgen ONELAB ONELABMetamodel OpenCascade OpenGL OptHom PETSc Parser Plugins Png(Fltk) Post SLEPc Salome Solver Tetgen(1.5) Voro3D Zlib
Info    : Build date    : 20150418
Info    : Build host    : Christophes-Mac.local
Info    : Packager      : geuzaine
Info    : Executable    : /Applications/Gmsh.app/Contents/MacOS/gmsh
Info    : Home directory : /Users/kateeisenhower/
Info    : Launch date    : Fri Jul 24 13:43:41 2015
Info    : Command line  : /Applications/Gmsh.app/Contents/MacOS/gmsh
Info    : -------------------------------------------------------
Info    : Reading '/Users/kateeisenhower/Documents/gmsh/Daten/cone/test.geo'...
Info    : Reading '/Users/kateeisenhower/Documents/gmsh/Daten/cone/cone.msh'...
Info    : 64 vertices
Info    : Vertex numbering is dense
Info    : 64 elements
Info    : Done reading '/Users/kateeisenhower/Documents/gmsh/Daten/cone/cone.msh'
Info    : Creating topology from mesh...
Info    : Removing duplicate mesh vertices...
Info    : Found 0 duplicate vertices
Info    : No duplicate vertices found
Info    : Done creating topology from mesh (0.002625 s)
Info    : Done reading '/Users/kateeisenhower/Documents/gmsh/Daten/cone/test.geo'

And as an additional question: Why can't I see my 64 imported vertices in the tree browser tab of the visibility window?

Best regards,

Kate

alexeym July 24, 2015 10:17

Hi,

If you look into GModelIO_MSH2.cpp:

Code:

      // If the vertex numbering is dense, transfer the map into a
      // vector to speed up element creation
      if((int)vertexMap.size() == numVertices &&
        ((minVertex == 1 && maxVertex == numVertices) ||
          (minVertex == 0 && maxVertex == numVertices - 1))){
        Msg::Info("Vertex numbering is dense");
                ...
      }

I guess what author would like to say is "vertex numbering is contiguous". I.e. there is no gaps in vertex numbering and we can use vector instead of map to store them.

Concerning second question: could you provide example file? Just opened MSH file and all entities were in visibility tree browser. Or should I merge MSH file from GEO file?

KateEisenhower July 24, 2015 10:48

1 Attachment(s)
Hi Alexey,

Thank you for your answer. Regarding the vertex numbering, that's what I assumed too. Only it looks like some kind of error message in gmsh. I googled for vertex numbering is dense but couldn't find anything useful. How do you search for such a term in the source code? This would be very helpful for the future.

I attached cone.zip to this post which contains my *.stl file which I created in Blender (cone.stl). I opened this file in gmsh and hit save mesh. The cone.msh file is also attached, as well as my test.geo.
When i open the cone.msh file with a text edit app, I can see 64 vertices, which is the same number as the points I can count in Blender. In the gmsh tree browser in the visibility window, I can only see 17 points. Some of these were created in the geo file to define the wind tunnel. Point 1 and 2 are on the cone I guess but why they have that exact position or what they are here for, I never found out. And I can't even find point 5 and 9.
I don't really get the logic how gmsh handles geometry imported as stl. But it's getting better every day.

Best regards and thanks for your help,

Kate

alexeym July 24, 2015 11:33

3 Attachment(s)
Hi,

Quote:

Originally Posted by KateEisenhower (Post 556857)
How do you search for such a term in the source code? This would be very helpful for the future.

I use grep, nothing fancy. So to find the lines from previous post I used:

Code:

alexey at daphne in gmsh$ grep -r 'is dense' *
Geo/GModel.cpp:  // if the vertex numbering is dense, transfer the map into a vector to speed
Geo/GModel.cpp:    Msg::Info("Vertex numbering is dense");
Geo/GModelIO_DIFF.cpp:      // If the vertex numbering is dense, tranfer the map into a
Geo/GModelIO_DIFF.cpp:        Msg::Info("Vertex numbering is dense");
Geo/GModelIO_MSH.cpp:      // if the vertex numbering is dense, transfer the map into a vector to
Geo/GModelIO_MSH.cpp:        Msg::Info("Vertex numbering is dense");
Geo/GModelIO_MSH2.cpp:      // If the vertex numbering is dense, transfer the map into a
Geo/GModelIO_MSH2.cpp:        Msg::Info("Vertex numbering is dense");
contrib/gmm/gmm_precond_ildltt.h:// the matrix is dense. In this case the fill-in is K on each line.

Since you question was about MSH, I have chosen Geo/GModelIO_MSH2.cpp file.

Quote:

I attached cone.zip to this post which contains my *.stl file which I created in Blender (cone.stl).
Well, STL and Gmsh is something special and in fact a little bit beyond my knowledge. Yet, Google helped me to find:

1. It is not enough to call CreateTopology, you need to create compound lines and surfaces. Like in t13.geo from demos.

2. If you use the same procedure as in t13.geo on your cone.stl (or cone.msh) Gmsh finds only 2 vertices.

3. There is "Reclassify 2D" tool in Gmsh GUI. It greatly improves handling of STL (see attached screenshots). Unfortunately it is not accessible through the scripting interface.

KateEisenhower July 31, 2015 10:15

Hi Alexey,

Thanks for that very helpful answer.

Quote:

Originally Posted by alexeym (Post 556866)
Hi,



I use grep, nothing fancy. So to find the lines from previous post I used:

Code:

alexey at daphne in gmsh$ grep -r 'is dense' *
Geo/GModel.cpp:  // if the vertex numbering is dense, transfer the map into a vector to speed
Geo/GModel.cpp:    Msg::Info("Vertex numbering is dense");
Geo/GModelIO_DIFF.cpp:      // If the vertex numbering is dense, tranfer the map into a
Geo/GModelIO_DIFF.cpp:        Msg::Info("Vertex numbering is dense");
Geo/GModelIO_MSH.cpp:      // if the vertex numbering is dense, transfer the map into a vector to
Geo/GModelIO_MSH.cpp:        Msg::Info("Vertex numbering is dense");
Geo/GModelIO_MSH2.cpp:      // If the vertex numbering is dense, transfer the map into a
Geo/GModelIO_MSH2.cpp:        Msg::Info("Vertex numbering is dense");
contrib/gmm/gmm_precond_ildltt.h:// the matrix is dense. In this case the fill-in is K on each line.

Since you question was about MSH, I have chosen Geo/GModelIO_MSH2.cpp file.

I have a few questions about this. In which directory do you execute this command? What does daphne mean? Is this possible when running gmsh on OS X too?

Quote:



Well, STL and Gmsh is something special and in fact a little bit beyond my knowledge. Yet, Google helped me to find:

1. It is not enough to call CreateTopology, you need to create compound lines and surfaces. Like in t13.geo from demos.

2. If you use the same procedure as in t13.geo on your cone.stl (or cone.msh) Gmsh finds only 2 vertices.

3. There is "Reclassify 2D" tool in Gmsh GUI. It greatly improves handling of STL (see attached screenshots). Unfortunately it is not accessible through the scripting interface.
Yes, I have played around with this "Reclassify 2D" tool too. Originally my question was aiming at why gmsh handles stl files this way? What is the logic behind it? But thanks anyway!

I have still problems with a default patch which appears after using gmshToFoam. This patch contains some undefined faces which are located at a problematic location of the mesh (cut trailing edge of an airfoil). When I view this default patch in ParaView, the cells seem to be part of my prismatic region. I am not allowed to share my files here but I try to create a minimal example over the weekend.

In the meantime I am trying to understand the gmsh output better:

Code:

Info    : Reading '/Users/kateeisenhower/Documents/gmsh/Daten/Kante2mm_13_hk1element_enGridmsh/fluegel.msh'...
Info    : 46420 vertices
Info    : Vertex numbering is dense
Info    : 92355 elements
Info    : Done reading '/Users/kateeisenhower/Documents/gmsh/Daten/Kante2mm_13_hk1element_enGridmsh/fluegel.msh'
Info    : Creating topology from mesh...
Info    : Removing duplicate mesh vertices...
Info    : Found 0 duplicate vertices
Info    : No duplicate vertices found
Info    : Done creating topology from mesh (1.0721 s)
Info    : Done reading '/Users/kateeisenhower/Documents/gmsh/Daten/Kante2mm_13_hk1element_enGridmsh/test.geo'
Info    : Done
Info    : Meshing 1D...
Info    : Meshing curve 15 (Line)
Info    : Meshing curve 16 (Line)
Info    : Meshing curve 17 (Line)
Info    : Meshing curve 18 (Line)
Info    : Meshing curve 22 (Line)
Info    : Meshing curve 23 (Line)
Info    : Meshing curve 24 (Line)
Info    : Meshing curve 25 (Line)
Info    : Meshing curve 26 (Line)
Info    : Meshing curve 27 (Line)
Info    : Meshing curve 28 (Line)
Info    : Meshing curve 29 (Line)
Info    : Done meshing 1D (0.004893 s)
Info    : Meshing 2D...
Info    : 0 dependencies in mesh of source faces
Info    : Meshing curve 15 (Line)
Info    : Meshing curve 16 (Line)
Info    : Meshing curve 17 (Line)
Info    : Meshing curve 18 (Line)
Info    : Meshing curve 22 (Line)
Info    : Meshing curve 23 (Line)
Info    : Meshing curve 24 (Line)
Info    : Meshing curve 25 (Line)
Info    : Meshing curve 26 (Line)
Info    : Meshing curve 27 (Line)
Info    : Meshing curve 28 (Line)
Info    : Meshing curve 29 (Line)
Info    : Meshing curve 4
Info    : Meshing curve 4 (extruded)
Info    : Meshing curve 5
Info    : Meshing curve 5 (extruded)
Info    : Meshing curve 7
Info    : Meshing curve 7 (extruded)
Info    : Meshing curve 11
Info    : Meshing curve 11 (extruded)
Info    : Meshing surface 14 (extruded)
Info    : Meshing surface 21 (Plane, Delaunay)
Info    : Meshing surface 31 (Plane, Delaunay)
Info    : Meshing surface 33 (Plane, Delaunay)
Info    : Meshing surface 35 (Plane, Delaunay)
Info    : Meshing surface 37 (Plane, Delaunay)
Info    : Meshing surface 40 (Plane, Delaunay)
Info    : Meshing surface 9 (extruded)
Info    : Meshing surface 13 (extruded)
Info    : Meshing surface 9 (Boundary layer surface)
Info    : Meshing surface 9 (extruded)
Info    : Meshing surface 13 (Boundary layer surface)
Info    : Meshing surface 13 (extruded)
Info    : Meshing surface 14 (Boundary layer surface)
Info    : Meshing surface 14 (extruded)
Info    : Done meshing 2D (1.03019 s)

Everything up to here is clear.

Code:

Info    : 94719 vertices 190474 elements
Info    : Meshing 3D...
Info    : Meshing volume 1 (extruded)
Info    : Meshing volume 2000 (Frontal)
Info    : Region 2000 Face 14, 2 intersect
Info    : Region 2000 Face 21, 1 intersect
Info    : Region 2000 Face 31, 0 intersect
Info    : Region 2000 Face 33, 1 intersect
Info    : Region 2000 Face 35, 1 intersect
Info    : Region 2000 Face 37, 0 intersect
Info    : Region 2000 Face 40, 1 intersect
Info    : CalcLocalH: 48299 Points 0 Elements 96598 Surface Elements

Volume 1 is my extruded prismatic layer. Volume 2 is my farfield from the extruded surface 14 to the boundaries of my wind tunnel. What does
Code:

Info: Region 2000 Face 14, 2 intersect
mean then?
What does
Code:

Info: CalcLocalH: 48299 Points 0 Elements 96598 Surface Elements
mean? Does this mean that there are no volume elements before the 3D meshing? Well, this is obvious, isn't it?

Code:

Info    : Check subdomain 1 / 1
Info    : 96598 open elements

This means that all of my Surface Elements are open. So my assumption is that this is okay?
Code:

Info    : Meshing subdomain 1 of 1
Info    : 96598 open elements
Info    : Use internal rules
Info    : 96598 open elements
Info    : Delaunay meshing
Info    : number of points: 48299
Info    : blockfill local h
Info    : number of points: 147786
Info    : Points: 147786
Info    : Elements: 917243
Info    : 388 open elements
Info    : Num open: 388
Info    : free: 4836, fixed: 912407
Info    : SwapImprove 
Info    : 843 swaps performed
Info    : 24 open elements
Info    : Num open: 24
Info    : free: 425, fixed: 916503
Info    : SwapImprove 
Info    : 25 swaps performed
Info    : 13 degenerated elements removed
Info    : Remove intersecting
Info    : Remove outer
Info    : tables filled
Info    : outer removed
Info    : 96598 open elements
Info    : 143090 points, 761358 elements
Info    : 242 open elements
Info    : 242 open faces
Info    : start tetmeshing
Info    : Use internal rules

What are internal rules?
What is blockfill local h?
What is SwapImprove?
At the end I have 242 open elements. I guess these are 2D elements. How does an open 2D element look like?
The meshed than starts tetmeshing with 242 open faces? Doesn't gmsh need to close them first?
Code:


Info    : El: 0 faces: 242 vol = 100
Info    : El: 1 faces: 244 vol = 99.6836
Info    : El: 2 faces: 240 vol = 99.674
Info    : El: 3 faces: 236 vol = 99.4231
Info    : El: 4 faces: 234 vol = 99.3117
Info    : El: 5 faces: 230 vol = 99.2368
Info    : El: 6 faces: 226 vol = 98.9873
Info    : El: 8 faces: 228 vol = 98.9099
Info    : El: 9 faces: 230 vol = 98.4964
Info    : El: 10 faces: 230 vol = 98.4773
Info    : El: 12 faces: 232 vol = 98.1052
Info    : El: 13 faces: 232 vol = 98.0222
Info    : El: 14 faces: 232 vol = 97.9299
Info    : El: 15 faces: 232 vol = 97.9131
Info    : El: 16 faces: 230 vol = 97.8938
Info    : El: 18 faces: 232 vol = 97.548
Info    : El: 19 faces: 232 vol = 97.3348
Info    : El: 21 faces: 234 vol = 97.1164
Info    : El: 22 faces: 236 vol = 96.8727
Info    : El: 23 faces: 234 vol = 96.7858
Info    : El: 24 faces: 234 vol = 96.6404
Info    : El: 25 faces: 230 vol = 96.5812
Info    : El: 26 faces: 228 vol = 96.3466
Info    : El: 27 faces: 230 vol = 96.2778
Info    : El: 28 faces: 230 vol = 96.0911
Info    : El: 30 faces: 232 vol = 95.2821
Info    : El: 31 faces: 232 vol = 95.1339
Info    : El: 32 faces: 232 vol = 94.8947
Info    : El: 33 faces: 232 vol = 94.8266
Info    : El: 34 faces: 232 vol = 94.7491
Info    : El: 35 faces: 232 vol = 94.6145
Info    : El: 36 faces: 232 vol = 94.1144
Info    : El: 37 faces: 232 vol = 93.9356
Info    : El: 38 faces: 230 vol = 93.722
Info    : El: 39 faces: 232 vol = 93.3295
Info    : El: 41 faces: 234 vol = 92.8613
Info    : El: 43 faces: 236 vol = 92.7953
Info    : El: 45 faces: 238 vol = 92.666
Info    : El: 47 faces: 240 vol = 92.595
Info    : El: 48 faces: 242 vol = 92.4929
Info    : El: 50 faces: 244 vol = 92.2974
Info    : El: 51 faces: 244 vol = 92.2702
Info    : El: 52 faces: 242 vol = 92.1424
Info    : El: 53 faces: 244 vol = 91.9445
Info    : El: 54 faces: 244 vol = 91.6564
Info    : El: 56 faces: 246 vol = 91.5494
Info    : El: 57 faces: 248 vol = 91.4719
Info    : El: 59 faces: 250 vol = 91.3639
Info    : El: 60 faces: 248 vol = 91.1938
Info    : El: 61 faces: 246 vol = 90.7731
Info    : El: 62 faces: 248 vol = 90.5932
Info    : El: 63 faces: 248 vol = 90.3011
Info    : El: 64 faces: 248 vol = 90.0146
Info    : El: 65 faces: 250 vol = 89.2982
Info    : El: 66 faces: 250 vol = 88.4385
Info    : El: 67 faces: 252 vol = 87.5789
Info    : El: 68 faces: 250 vol = 87.0057
Info    : El: 69 faces: 246 vol = 86.4326
Info    : El: 70 faces: 248 vol = 86.0028
Info    : El: 72 faces: 250 vol = 85.5387
Info    : El: 73 faces: 250 vol = 85.2946
Info    : El: 74 faces: 250 vol = 84.4349
Info    : El: 75 faces: 250 vol = 84.2031
Info    : El: 76 faces: 252 vol = 84.0599
Info    : El: 77 faces: 252 vol = 83.2002
Info    : El: 78 faces: 250 vol = 82.3405
Info    : El: 79 faces: 252 vol = 82.2022
Info    : El: 80 faces: 252 vol = 82.016
Info    : El: 82 faces: 254 vol = 81.7547
Info    : El: 83 faces: 254 vol = 81.3249
Info    : El: 84 faces: 256 vol = 80.4652
Info    : El: 85 faces: 254 vol = 80.2503
Info    : El: 86 faces: 254 vol = 80.0354
Info    : El: 88 faces: 256 vol = 78.5481
Info    : El: 89 faces: 258 vol = 78.2956
Info    : El: 90 faces: 256 vol = 78.224
Info    : El: 91 faces: 258 vol = 78.0807
Info    : El: 92 faces: 258 vol = 77.5076
Info    : El: 93 faces: 258 vol = 77.221
.
.
.
Info    : El: 459 faces: 8 vol = 0.00284852
Info    : El: 463 faces: 8 vol = 0.00226242
Info    : El: 464 faces: 8 vol = 0.00209685
Info    : El: 465 faces: 6 vol = 0.00203621
Info    : El: 466 faces: 4 vol = 0.00196921

I don't understand this peace of code. El stands for element? Can someone explain these lines? Is a smaller volume better?

Code:

Info    : 0 open elements
Info    : Success !
Info    : 143135 points, 761825 elements
Info    : Done meshing 3D (28.1425 s)
Info    : 189555 vertices 1044654 elements

This looks promising in the first place. But as I wrote already, checkMesh complains about the mesh.

I am aware of this being a huge post with a lot of questions. If you, Alexey, or anyone else could provide some answers, I would be very grateful!
Sadly the gmsh Guide doesn't.

Best regards,

Kate

alexeym August 3, 2015 10:28

Hi,

Since the messages are from particular meshing algorithm (guess, they will change if you select different values in Options -> Mesh -> General -> 2D and 3D algorithm drop-downs), it is possible to locate the reason for concrete message in source code, but there is almost no comments in the code ;)

Guess, the easiest way to find meaning of the messages is to use Gmsh mailing list (http://www.geuz.org/mailman/listinfo/gmsh/) and ask authors of software directly.

KateEisenhower August 3, 2015 10:35

Hi Alexey,

I've previously posted on the mailing list but sadly I almost never got an answer. However, I'll give it another try.

Can you please answer the first of my questions?

Quote:


Hi Alexey,

Thanks for that very helpful answer.

Quote:
Originally Posted by alexeym View Post
Hi,



I use grep, nothing fancy. So to find the lines from previous post I used:

Code:
alexey at daphne in gmsh$ grep -r 'is dense' *
Geo/GModel.cpp: // if the vertex numbering is dense, transfer the map into a vector to speed
Geo/GModel.cpp: Msg::Info("Vertex numbering is dense");
Geo/GModelIO_DIFF.cpp: // If the vertex numbering is dense, tranfer the map into a
Geo/GModelIO_DIFF.cpp: Msg::Info("Vertex numbering is dense");
Geo/GModelIO_MSH.cpp: // if the vertex numbering is dense, transfer the map into a vector to
Geo/GModelIO_MSH.cpp: Msg::Info("Vertex numbering is dense");
Geo/GModelIO_MSH2.cpp: // If the vertex numbering is dense, transfer the map into a
Geo/GModelIO_MSH2.cpp: Msg::Info("Vertex numbering is dense");
contrib/gmm/gmm_precond_ildltt.h:// the matrix is dense. In this case the fill-in is K on each line.
Since you question was about MSH, I have chosen Geo/GModelIO_MSH2.cpp file.


I have a few questions about this. In which directory do you execute this command? What does daphne mean? Is this possible when running gmsh on OS X too?


alexeym August 3, 2015 10:49

Hi,

Oh, sorry, overlooked these questions.

1. I execute the command in project's root folder. I.e. if I checked out sources in $HOME/Sources/gmsh, I execute command in $HOME/Sources/gmsh. See read-only svn clause in http://www.geuz.org/gmsh/#Download, on how to get project sources.

2. daphne is the host name of my laptop, so it is irrelevant to the problem. 'alexey at daphne in gmsh' is a prompt of my shell, which consists of user name, host name and current folder.

3. Since project sources and OS X compiled binaries are separate entities, you can search source code on any platform you like.


All times are GMT -4. The time now is 08:24.