Anonymous - 2012-08-02

Hello.

I get a fatal error when using local mesh refinement. Let me explain how to reproduce the problem. I open Netgen GUI, load a geometry from the tutorials folder (lets say lshape3d.geo) and generate a mesh without any changes in the meshing options. Then I select a vertex by double-clicking, open the menu "Refinement->Refinement Dialog…" and click the "Refine" button. Then I get a segmentation fault. I didn't change anything in the dialog. The output I get is:

select element 21 on face 5
Nodes: 16 2 7
selected point 2, pos = (-1, -1, 1)
Mesh bisection
Bisection done
Curve elements, order = 1
Curve elements, order = 1
oldnp 16 newnp 24
Mesh bisection
Speicherzugriffsfehler (Speicherabzug geschrieben)

I tried to attach to this process with GDB and found out, that this error occurs in general/table.cpp:

Program received signal SIGSEGV, Segmentation fault.
0x00007fa114743e8e in AddSave (acont=<optimized out>, i=0, this=0x7fff6102f120) at ./../general/table.hpp:145
145           ((T*)data.col)[data.size] = acont;

It seems that this happens only in the last iteration of the bisection algorithm. When I refine the mesh 4 times uniform and then set local mesh size 0.05 to an arbitrary vertex, I get the output

Restrict h at point to 0.05
Mesh bisection
Bisection done
Curve elements, order = 1
Curve elements, order = 1
oldnp 2025 newnp 2041
Mesh bisection
Bisection done
Curve elements, order = 1
Curve elements, order = 1
oldnp 2041 newnp 2081
Mesh bisection
Bisection done
Curve elements, order = 1
Curve elements, order = 1
oldnp 2081 newnp 2178
Mesh bisection
Bisection done
Curve elements, order = 1
Curve elements, order = 1
oldnp 2178 newnp 2204
Mesh bisection
Bisection done
Curve elements, order = 1
Curve elements, order = 1
oldnp 2204 newnp 2593
Mesh bisection

and at this point, the debugger reports exactly the same error.
However, in the user interface I can see that the mesh is refined as expected.
Maybe some helpful output:

(gdb) p i
$34 = 1316
(gdb) p data
$35 = {<netgen::FlatArray<netgen::BASE_TABLE::linestruct, 0>> = {size = 584, data = 0x2cd1280}, allocsize = 584, ownmem = true}
(gdb) up
#1  netgen::MeshTopology::Update (this=0x7fcfe0000c40) at topology.cpp:189
189               vert2edge.AddSave (edge2vert_, i+1);

There seems to be something wrong with the list (?) edge2vert.

Is this an operating error or maybe a bug in Netgen? Can please some explain me how to correctly use the local refinement? I also get the same error when I restrict the mesh size to a face or an element.

Btw: I use the newest version from the Subversion repository but I had the same problems with released versions. Using Netgen under Windows works with the same steps described above.

Thank you in advance and best regards.

Max
_