GLVis / glvis

Lightweight OpenGL tool for accurate and flexible finite element visualization
http://glvis.org
BSD 3-Clause "New" or "Revised" License
249 stars 51 forks source link

Wrong vertex ids with ncmesh #261

Closed tsokar closed 1 year ago

tsokar commented 1 year ago

Dear GLVis developers, I am playing with mfem's ncmeshes, and I figured out that when I am opening such a mesh within GLVis and displaying the node ids, these ids are not consistent with the underlying mesh file.

For example, if I open the mesh attached below (ncmesh.mesh), the vertex parents are not consistent with the mesh which is displayed (see image):

vertex_parents
14
4 0 1
5 1 3
6 2 3
7 0 2
8 4 6
10 4 8
13 1 4
14 1 5
15 5 8
16 3 5
17 3 6
18 6 8
21 13 15
34 15 17

Vertex 4 is OK, but the other vertices parents are obviously wrong. Is it an bug or am I missing something ?

Thanks ! ncmesh.mesh.txt

GLVis_s01

rw-anderson commented 1 year ago

I am not actually sure without looking at code, which I will do shortly. My suspicion is that the numbering used in the mesh file defines a set of relationships, but it is not guaranteed to be the same numbering that ends up being used in the internal data structures, which is what glvis is displaying. I will take a look.

rw-anderson commented 1 year ago

I think the upshot of this is that the numbering that you specify in the ncmesh file defines parent-child relationships for the ncmesh. What glvis is showing you is not the contents of the "ncmesh" data structure (which contains the entire refinement tree from root nodes to leaves), but the "mesh" data structure information, which is a collapsed view of the mesh that contains only the leaf elements. Because of this, the vertex numberings can be different.

tsokar commented 1 year ago

Ah, OK... Thanks a lot !