CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Open Source Meshers: Gmsh, Netgen, CGNS, ...

Import stl file netgen writes segmentation faulterror

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   September 28, 2005, 18:02
Default Hi, I've been struggling in
  #1
unoder
Guest
 
Posts: n/a
Hi,

I've been struggling in order to import a stl-geometry into foam and after what can be read on this forum then netgen should be able to do the task. I tried tetgen with no luck:

martin@linux:~/tetgen1.3.4> ./tetgen -pqAz ascii_r50.stl
Opening ascii_r50.stl.
Constructing Delaunay tetrahedrization.
Delaunay seconds: 0.38
Creating surface mesh.
Jettisoning redundants points.
Perturbing vertices.
Delaunizing segments.
tetgen: tetgen.cxx:16986: void tetgenmesh::delaunizesegments(): Assertion `0' failed.
Aborted

Since netgen writes something about a "segmentation fault/error", then I can't convert this stl file I want to convert...

zip_compressed_stl.zip

Any hints/recommendations? netgen isn't exactly the most user-friendly software package to install I think... Had to compile a lot and download and read a lot of instructions for first installing tcl/tk, setting environment variables etc... Perhaps the windows version is easier to install than the linux version?
  Reply With Quote

Old   September 29, 2005, 05:11
Default I just ran surfaceCheck on you
  #2
Super Moderator
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,416
Rep Power: 16
mattijs is on a distinguished road
I just ran surfaceCheck on your geometry. It consists of three disconnected parts and I guess this is the problem. I can run tetgen on the individual parts without problems.

I suppose netgen has the same constraints. Might have better error messages though ;-)
mattijs is offline   Reply With Quote

Old   September 29, 2005, 06:56
Default 1) Thanks for the info. I can'
  #3
unoder
Guest
 
Posts: n/a
1) Thanks for the info. I can't even start netgen because it comes with this "segmentation fault/error" after I type ./ng, so it has nothing to do with the part being disconnected. I guess something is wrong with the installation of tix-8.1.1.tar.gz...

2) surfaceCheck? Is that from inside netgen?

3) How did you manage to run tetgen on the three individual parts? From inside pro/Engineer it looks to me like if it's one part, but I just got this file from somebody else so I don't know how it was made...
  Reply With Quote

Old   September 29, 2005, 13:11
Default 2) OpenFOAM app. 3) check the
  #4
Super Moderator
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,416
Rep Power: 16
mattijs is on a distinguished road
2) OpenFOAM app.
3) check the output of surfaceCheck. Use surfaceConvert to convert back to stl.
mattijs is offline   Reply With Quote

Old   September 30, 2005, 13:29
Default Hello, there Thanks a lot.
  #5
unoder
Guest
 
Posts: n/a
Hello, there

Thanks a lot. That was helpful. surfaceCheck and surfaceConvert looks like some really great tools for a lot of extensions: '.ftr', '.stl', '.stlb', '.gts', '.obj', '.vtk', '.off', '.dx', '.smesh', '.ac' and '.tri'?

However, now I'm struggling with tetgenToFoam once again... I never found out how one should do the conversion from tetgen to Foam mesh, but I guess I just hoped I would be luckier with this geometry than the last time I tried to convert a geometry from a stl-file to Foam:

Exec : tetgenToFoam -startAt0 . r25 /home/martin/OpenFOAM/martin-1.2/run/r25/constant/polyMesh/samlet_indloeb_r25_0. 1
Date : Sep 10 2005
Time : 23:31:11
Host : linux
PID : 27614
Root : /home/martin/OpenFOAM/martin-1.2/run
Case : r25
Nprocs : 1
Create time

Files:
nodes : "/home/martin/OpenFOAM/martin-1.2/run/r25/constant/polyMesh/samlet_indloeb_r25_0 .1.node"
elems : "/home/martin/OpenFOAM/martin-1.2/run/r25/constant/polyMesh/samlet_indloeb_r25_0 .1.ele"
faces : "/home/martin/OpenFOAM/martin-1.2/run/r25/constant/polyMesh/samlet_indloeb_r25_0 .1.face"

Reading .file for boundary information

Numbering in files starts at 0

Read .node header:
nodes : 689
nDims : 3
nAttr : 0
hasRegion : 0

Read .ele header:
tets : 2258
pointsPerTet : 4
nAttr : 0

Segmentation fault

Did you or anyone else have an easy solution for me in this case, so that I could do a simulation on this geometry?

I would appreciate any suggestions for bringing me closer to a solution a lot. For instance: Does a forum for netgen-related installation problems exist, so I perhaps could try to see what netgen can do here, if netgen is able to export the mesh into something usable?
  Reply With Quote

Old   September 30, 2005, 14:04
Default Ok, I inserted a lot of info-s
  #6
unoder
Guest
 
Posts: n/a
Ok, I inserted a lot of info-statements and found out that the place where this Segmentation fault occurs, is close to this loop (around line 280-285 in tetgenToFoam.C):

if (startAt1)
{
--elemI;
}

for (label i = 0; i < 4; i++)
{
label nodeI;

eleLine >> nodeI;

However, I can' t see what's happening here since I don't really understand this program code.
  Reply With Quote

Old   September 30, 2005, 14:18
Default Hi Martin, last time you ca
  #7
Super Moderator
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,416
Rep Power: 16
mattijs is on a distinguished road
Hi Martin,

last time you came across an error in:

cells[elemI] = cellShape(tet, tetPoints);

According to the printout you have 2258 tets and 689 points/vertices/nodes in your file.

So does your tet numbering in your file go from 0..2257 (0..688 for points) or from 1..2258?

If so use the startAt1 flag since all Foam numbering starts at 0.
mattijs is offline   Reply With Quote

Old   September 30, 2005, 16:20
Default Hi, The .ele file: 2258 4
  #8
unoder
Guest
 
Posts: n/a
Hi,

The .ele file:
2258 4 0
1 11 292 2 233
--------- cut a lot
2257 44 42 424 285
2258 285 42 424 45
# Generated by /home/martin/tetgen1.3.4/tetgen -f samlet_indloeb_r25_0.stl

The .node file:
689 3 0 0
1 3.78254 57.274900000000002 -0.94767500000000005
------------ cut a lot ------
688 -3.482773518325156 -25.063109137128237 -0.85637047580471404
689 -3.4406803462507036 -25.06484817786512 -0.94766313573558147
# Generated by /home/martin/tetgen1.3.4/tetgen -f samlet_indloeb_r25_0.stl

Just to be sure that the format of the data files are correct:
The .face file:
1374 0
1 1 234 233
------- cut a lot -----
1374 364 367 689
# Generated by /home/martin/tetgen1.3.4/tetgen samlet_indloeb_r25_0.stl


The .smesh file:
# samlet_indloeb_r25_0.1.smesh. TetGen's input file.

# part 1: node list.
689 3 0 0
1 3.78254 57.274900000000002 -0.94767500000000005
------ cut a lot -----
689 -3.4406803462507036 -25.06484817786512 -0.94766313573558147

# part 2: facet list.
1374 0
3 233 234 1
------- cut a lot ----
3 364 689 367

# part 3: hole list.
0

# part 4: region list.
0
# Generated by /home/martin/tetgen1.3.4/tetgen samlet_indloeb_r25_0.stl


So I guess this would mean that it's correct to start with the startAt1 flag, which should be the default but this doesn't work (and that's why I tried the startat0-option):

Exec : tetgenToFoam . r25 /home/martin/OpenFOAM/martin-1.2/run/r25/constant/polyMesh/samlet_indloeb_r25_0. 1
Date : Sep 11 2005
Time : 02:01:44
Host : linux
PID : 31733
Root : /home/martin/OpenFOAM/martin-1.2/run
Case : r25
Nprocs : 1
Create time

Files:
nodes : "/home/martin/OpenFOAM/martin-1.2/run/r25/constant/polyMesh/samlet_indloeb_r25_0 .1.node"
elems : "/home/martin/OpenFOAM/martin-1.2/run/r25/constant/polyMesh/samlet_indloeb_r25_0 .1.ele"
faces : "/home/martin/OpenFOAM/martin-1.2/run/r25/constant/polyMesh/samlet_indloeb_r25_0 .1.face"

Reading .file for boundary information

Numbering in files starts at 1

Read .node header:
nodes : 689
nDims : 3
nAttr : 0
hasRegion : 0



--> FOAM FATAL ERROR : point numbering not consecutive for node 1 or numbering starts at 0 or 1. Perhaps rerun w/o -startAt0 option?

I haven't got a clue, since I would assume that Foam is able to read the output from tetgen, but perhaps I need to pass some special arguments to tetgen other than -f (and sometimes I ran it without arguments, still same result).
  Reply With Quote

Old   October 2, 2005, 10:26
Default Solution to the problem - HOWT
  #9
unoder
Guest
 
Posts: n/a
Solution to the problem - HOWTO:

1)
follow this proposal by Stefan

2)
Use:
tetgenToFoam <root> <case> <file> -noFaceFile

3)
Use: patchTool - if it doesn't show the right geometry, I do a: PatchToolServer <root> <case> and then it works.

Result:


Then there should be no confusion about importing .stl files anymore, I hope?
  Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Import netgen mesh to OpenFOAM hsieh Open Source Meshers: Gmsh, Netgen, CGNS, ... 32 September 13, 2011 05:50
FluentMeshToFoam writes too small cellZones gschaider OpenFOAM Bugs 0 May 22, 2007 13:57
MSH file import Vivek Vasudevan Main CFD Forum 2 March 19, 2007 20:03
how to import a *.msh file to CFX san CFX 4 February 13, 2006 11:59
Please help me import the VTK file liugx212 OpenFOAM Pre-Processing 2 November 16, 2005 12:47


All times are GMT -4. The time now is 13:52.