What Causes Segmentation fault after reading a file

The graphical user interface of Elmer
Post Reply
Ahmed
Posts: 40
Joined: 31 Aug 2009, 20:10
Location: NY

What Causes Segmentation fault after reading a file

Post by Ahmed »

I prepared the naca 4412 profile using Salome,
naca4412.png
naca4412.png (7.55 KiB) Viewed 9589 times
naca4412-00.png
naca4412-00.png (11.83 KiB) Viewed 9589 times
when reading the file into Elmer, I got a long list of error messages that ends up with a Segmentation error message

Vendor: Mesa project: http://www.mesa3d.org
Renderer: Mesa GLX Indirect
Version: 1.4 (2.1 Mesa 7.0.4)
... Step File Reading : /home/ahmed/Tutorials_Salome/AirFoil.step
... STEP File Read ...
Elapsed time: 0 Hours 0 Minutes 0.00872 Seconds
CPU user time: 0 seconds
CPU system time: 0 seconds
... Step File loaded ...
Elapsed time: 0 Hours 0 Minutes 0.011893 Seconds
CPU user time: 0.01 seconds
CPU system time: 0 seconds
920 records (entities,sub-lists,scopes), 2906 parameters
...............................................................................................
...............................................................................................
STEP Loading done : 477 Entities
Added shape: 1
Clear screen
Bounding box: [ -12.5299, -13.5299, -4.82011e-05] x [ 21, 13.5299, 4.82011e-05]
StlSurfaceData: points: 91
StlSurfaceData: cells: 92
StlEdgeData: lines: 90
StlModelData: length: 40.9987
Initializing nglib
Start meshing...
Cad import: max mesh size: 4.09987
Cad import: mesh fineness: 0.5
number of triangles = 92
boundingbox: [-11.4945, -12.5, 0] - [21, 12.5, 0]

file reading seems to be OK, now here are messages from the mesher

point tolerance = 4.09987e-05
topology built, checking
topology_ok = 0
orientation_ok = 0
topology found
point -> trig table generated
ERROR: TRIG 1 has 2 neighbours!!!!
neighbour-trig1 = 2
neighbour-trig2 = 13
ERROR: TRIG 2 has 2 neighbours!!!!
neighbour-trig1 = 1
neighbour-trig2 = 3

this last message repeats and finally I get the following messages

ERROR: TRIG 88 has 2 neighbours!!!!
neighbour-trig1 = 89
neighbour-trig2 = 91
ERROR: TRIG 89 has 2 neighbours!!!!
neighbour-trig1 = 88
neighbour-trig2 = 90
ERROR: TRIG 90 has 2 neighbours!!!!
neighbour-trig1 = 89
neighbour-trig2 = 92
NO points= 91
built 90 edges with yellow angle = 30 degree
atlasminh = 0.204993
SYSTEM ERROR: Get neighbourpoints failed!
SYSTEM ERROR: Get neighbourpoints failed!
Segmentation fault

What might be the cause of mesh generation failure

Appreciate you hints and clues

Thank you and good luck to all
mal
Site Admin
Posts: 54
Joined: 21 Aug 2009, 14:21

Re: What Causes Segmentation fault after reading a file

Post by mal »

Seems like an internal error somewhere in the Netgen engine. Difficult to say without having a closer look at the model.

Anyways, since you are using Salome for geometry modeling, you might want to use it for mesh generation as well.

There are some user contributed instructions for generating and exporting the mesh files from Salome to Elmer.
Ahmed
Posts: 40
Joined: 31 Aug 2009, 20:10
Location: NY

Re: What Causes Segmentation fault after reading a file

Post by Ahmed »

I spent this weekend trying to find out what is going wrong.
First I exported the geometry in other formats, stl and brep but I got the same segmentation error, then I exported the geometry in iges format, this time the geometry is read correctly
Screenshot-ElmerGUI geometry viewer.png
Screenshot-ElmerGUI geometry viewer.png (9.67 KiB) Viewed 9569 times
But the mesh generated is not ok by any standard.
First the mesh generator added two internal boundaries to the domain, and the quality of the mesh generated is so poor, it cannot be used in any CFD analysis
here is the shot (I do not understand why the mesh generator inverted all coordinates)
MeshIges.png
MeshIges.png (22.01 KiB) Viewed 9569 times
Now here is the file itself
AirFoil.iges
(21.2 KiB) Downloaded 419 times
I am really confused, you see, I am trying to answer to myself the following question,
Is it possible to use open source programmes to carry out an industrial level analysis?
Both Elmer and Salome seem to be the best available candidates, but right now, I have no clue to answer this question.
Your hints will be appreciated, thanks and good luck to all
Ahmed
Posts: 40
Joined: 31 Aug 2009, 20:10
Location: NY

Re: What Causes Segmentation fault after reading a file

Post by Ahmed »

I am just trying to keep this thread alive, so I am attaching both the hdf and step files, they might be useful in the debugging process
Hints and clues are appreciated
Thanks and good luck to all
AirFoil.step
(33.33 KiB) Downloaded 486 times
Sorry, files with extension hdf are not allowed by the forum software
hazelsct
Posts: 153
Joined: 05 Oct 2009, 17:02
Location: Boston, MA, USA
Contact:

Re: What Causes Segmentation fault after reading a file

Post by hazelsct »

Hi Ahmed, Thanks for your continuing efforts to document and draw attention to Elmer flaws.

I can't promise I'll have time to work on your bug, but with any Segmentation fault it's helpful to have a backtrace. If you're running on Linux, you can install gdb and do "gdb ElmerGUI" (with any environment variable settings before it), then at the prompt type "run" to run it. When you hit the bug, it should give a trace of which function calls led to the problem -- or if it doesn't, then type "backtrace" and it will.

This can help to pinpoint the location of a bug, though finding seg faults is never an exact science...
Ahmed
Posts: 40
Joined: 31 Aug 2009, 20:10
Location: NY

Re: What Causes Segmentation fault after reading a file

Post by Ahmed »

As I see it, it is a moral and ethical duty (or obligation if you like) that users of open source programmes have to contribute to the maintenance, development and enhancements to the programmes they are using.
Following your technical recommendation, I ran ElmerGUI under gdb,
gdb_bugReport.txt
(12.49 KiB) Downloaded 385 times
The read geometry function is ok, the problem is related to the mesher, I wish I could have advanced the debugging process more than just that, but my field of expertise is not related to software management.
Thanks for reading my post and good luck to all
Ahmed
Posts: 40
Joined: 31 Aug 2009, 20:10
Location: NY

Re: What Causes Segmentation fault after reading a file

Post by Ahmed »

Happy Holidays season to all, developers and readers
Today I updated the installation of Elmer to the latest svn revision, then I tested the naca file again, I still have the same problem, reading the iges file the mesher produces a very distorted useless mesh, reading other file formats causes the programme to exit.
I have a question, is the file produced by Salome a non compliant file? any thing wrong with salome?
do I need to look for other open source programmes to generate my geometry or What programme do you recommend/use for geometry generation.

Thanks for reading my post and again, happy Holidays
NacaNoseDec29.png
NacaNoseDec29.png (40.53 KiB) Viewed 9419 times
NacaTail-Dec29.png
NacaTail-Dec29.png (24.15 KiB) Viewed 9419 times
Post Reply