CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   gmshToFoam teminates on Segmentation fault (https://www.cfd-online.com/Forums/openfoam/94986-gmshtofoam-teminates-segmentation-fault.html)

XXLRay November 29, 2011 09:33

gmshToFoam teminates on Segmentation fault
 
1 Attachment(s)
I created a .msh file with gmsh 2.4.2 on Ubuntu Linux. Now I want to convert it to OpenFoam201. I copied the mesh to the OpenFoam example folder $FOAM_RUN/tutorials/incompressible/icoFoam/cavity/ . There I executed "gmshToFoam ./Savonius_S2.geo.msh". It terminates on a Segmentation fault (I shortened some long output):
Code:

/*---------------------------------------------------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.0.1                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.com                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
Build  : 2.0.1-51f1de99a4bc
Exec  : gmshToFoam ./Savonius_S2.geo.msh
Date  : Nov 29 2011
Host  : ubuntu
PID    : 8927
Case  : /home/hanke/OpenFOAM/hanke-2.0.1/run/tutorials/incompressible/icoFoam/Savonius
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Disallowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Starting to read mesh format at line 2
Read format version 2.1  ascii 0

Starting to read points at line 5
Vertices to be read:175
Vertices read:175

Starting to read cells at line 183
Cells to be read:1333

Unhandled element 15 at line 185
...
Unhandled element 15 at line 209
Unhandled element 1 at line 210
...
Unhandled element 1 at line 305
Mapping region 0 to Foam patch 0
Mapping region 0 to Foam cellZone 0
Cells:
    total:876
    hex  :0
    prism:0
    pyr  :0
    tet  :876

CellZones:
Zone    Size
    0    876

Skipping tag  at line 1519
Patch 0 gets name patch0

Finding faces of patch 0
--> FOAM Warning : Not using gmsh face 3(27 25 7) since zero vertex is not on boundary of polyMesh
...
--> FOAM Warning : Not using gmsh face 3(22 35 38) since zero vertex is not on boundary of polyMesh

FaceZones:
Zone    Size
    0    336

Writing zone 0 to cellZone cellZone_0 and cellSet
Writing zone 0 to faceZone faceZone_0 and faceSet
#0  Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam201/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#1  Foam::sigSegv::sigHandler(int) in "/opt/openfoam201/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#2  Uninterpreted:
#3 
 in "/opt/openfoam201/platforms/linuxGccDPOpt/bin/gmshToFoam"
#4  __libc_start_main in "/lib/tls/i686/cmov/libc.so.6"
#5 
 in "/opt/openfoam201/platforms/linuxGccDPOpt/bin/gmshToFoam"
Segmentation fault

I guess that something is wrong with my mesh. I attached the file and would be glad if you could have a look at it.

-mAx- November 30, 2011 03:50

you are not in the right forum >>>> http://www.cfd-online.com/Forums/ope...meshing-other/

With which software did you create your .msh file?

XXLRay November 30, 2011 05:22

As stated out in the first post I created the mesh with gmsh 2.4.2.

Perhaps one of the admins could be so kind to move this thread to the correct location?

XXLRay December 2, 2011 04:02

Can anybody confirm that the mesh itself and not my installation of OpenFOAM causes the fault?

XXLRay December 2, 2011 04:47

In http://www.cfd-online.com/Forums/ope...ion-error.html a similar problem has been described. It seems as if it could be solved by removing the "gmsh label". Unfortunately I have not idea what this means. Anyone else?

XXLRay December 3, 2011 05:25

1 Attachment(s)
I tried a mesh from an new smaller and simpler geometry (attached to this post). The output of the mesh conversion is now:

Code:

/*---------------------------------------------------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.0.1                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.com                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
Build  : 2.0.1-51f1de99a4bc
Exec  : gmshToFoam Cylinder.msh
Date  : Dec 03 2011
Time  : 10:07:35
Host  : ubuntu
PID    : 2222
Case  : /home/hanke/OpenFOAM/hanke-2.0.1/run/tutorials/incompressible/icoFoam/Cylinder
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Disallowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Starting to read mesh format at line 2
Read format version 2.1  ascii 0

Starting to read points at line 5
Vertices to be read:1232
Vertices read:1232

Starting to read cells at line 1240
Cells to be read:6835

Unhandled element 15 at line 1242
...
Unhandled element 1 at line 1367
Mapping region 0 to Foam patch 0
Mapping region 0 to Foam cellZone 0
Cells:
    total:5303
    hex  :0
    prism:0
    pyr  :0
    tet  :5303

CellZones:
Zone    Size
    0    5303

Skipping tag  at line 8078
Patch 0 gets name patch0

--> FOAM Warning :
    From function polyMesh::polyMesh(... construct from shapes...)
    in file meshes/polyMesh/polyMeshFromShapeMesh.C at line 614
    Found 1406 undefined faces in mesh; adding to default patch.
Finding faces of patch 0

FaceZones:
Zone    Size

Writing zone 0 to cellZone cellZone_0 and cellSet
End

Is this what I should expect?
Are the unhandled elements bad?
Does the conversion work now because the geometry is smaller or simpler (I used a copy of the incompressible/icofoam/cavity example as starting point)?
Which tutorial should I copy to convert the mesh from my initial Post?

When I directly launch "icoFoam" after conversion, I get the following error message:
Code:

/*---------------------------------------------------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.0.1                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.com                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
Build  : 2.0.1-51f1de99a4bc
Exec  : icoFoam
Date  : Dec 03 2011
Time  : 10:19:02
Host  : ubuntu
PID    : 2642
Case  : /home/.../run/tutorials/incompressible/icoFoam/Cylinder
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Disallowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0

Reading transportProperties

Reading field p



--> FOAM FATAL IO ERROR:
keyword patch0 is undefined in dictionary "/home/.../run/tutorials/incompressible/icoFoam/Cylinder/0/p::boundaryField"

file: /home/.../run/tutorials/incompressible/icoFoam/Cylinder/0/p::boundaryField from line 25 to line 35.

    From function dictionary::subDict(const word& keyword) const
    in file db/dictionary/dictionary.C at line 461.

FOAM exiting

I get the same error message when I try to look at the mesh in paraFoam.

Is there something else I have to do before launching "icoFoam"?
Does the cavity tutorial simply not fit to my mesh?

XXLRay December 5, 2011 04:21

Do you need any more information to help me? Just ask and I will provide it.

I expect it to be an effort of a few minutes for someone experienced to try my mesh. Finding a solution on my own yet took me weeks and will take me months. Any help is really appreciated.

XXLRay December 6, 2011 04:45

Is anybody out there?

wyldckat December 6, 2011 10:36

Greetings XXLRay,

I personally don't have time to test the mesh, but this should be self explanatory in one of your latter posts:
Code:

keyword patch0 is undefined in dictionary "/home/.../run/tutorials/incompressible/icoFoam/Cylinder/0/p::boundaryField"
Basically your new mesh has patch names different from the patches defined in the original tutorial case. You'll need to see the file "constant/polyMesh/boundary" to see the list of patches your new mesh has, then edit all variable files in the folder "0".

I suggest that you review the first tutorial (or even all 3 tutorials) on the User Guide to remember about boundaries and patches: http://www.openfoam.com/docs/user/cavity.php#x5-40002.1

As for «removing the "gmsh label"», the ".gmsh" files can sometimes be in text format, so editing the mesh ".gmsh" file with a text editor might be the way to go!

Best regards and good luck!
Bruno

XXLRay December 7, 2011 03:10

Thanks a lot. I will try that.


All times are GMT -4. The time now is 06:07.