|
[Sponsors] |
October 4, 2009, 06:28 |
gmshToFoam : problem with patch
|
#1 |
Member
Jean-Michel FONTAINE
Join Date: Aug 2009
Location: Orleans - France
Posts: 55
Rep Power: 17 |
Hello everybody
I try to use gmshToFoam (from 1.6 binaries) to convert meshes with patches from gmsh 2.4.2. I get following error message: Code:
Found $MeshFormat tag; assuming version 2 file format. Starting to read physical names at line 5 Physical names:3 wrong token type - expected string found on line 0 the label 1 file: IStringStream.sourceFile at line 0. From function operator>>(Istream&, string&) in file primitives/strings/string/stringIO.C at line 57. FOAM exiting Does anybody know how to solve that ? Here attached one mesh sample Thanks in advance J-Michel |
|
October 4, 2009, 07:43 |
|
#2 |
Senior Member
Philippose Rajan
Join Date: Mar 2009
Location: Germany
Posts: 552
Rep Power: 25 |
Hello Michel,
A Good Day to you! I was looking through the GMSH "msh" file that you have posted. It looks like there was a change in the "msh" file format when GMSH 2.4.0 (22 Aug 2009) was released. The older "msh" versions had the following format for the patch names: $PhysicalNames <length of list> <number> <patch name> $EndPhysicalNames The current "msh" has the following format: $PhysicalNames <length of list> <physical dimension> <number> <patch name> $EndPhysicalNames gmshToFoam parses the mesh file using the first format, and hence, aborts with an error because the current format has an additional number in each row. This is a change which has to be made by the maintainers of the "gmshToFoam" code. The other option is that you make the change to the file "gmshToFoam.C" at line number 316: lineStr >> regionI >> regionName; to: lineStr >> physDim >> regionI >> regionName; and just ignore the variable "physDim" in the rest of the code. If this works fine, you can submit the change to the "bugs" section of the forum, and get it integrated into the OpenFOAM code base. I am not sure why this change was made in GMSH, but here is the change log entry which mentions this change: 2.4.0 (Aug 22, 2009): switched build system to CMake; optionally copy transfinite mesh contraints during geometry transformations; bumped mesh version format to 2.1 (small change in the $PhysicalNames section, where the group dimension is now required); ported most plugins to the new post-processing API; switched from MathEval to MathEx and Flu_Tree_Browser to Fl_Tree; small bug fixes and improvements all over the place. Hope this helps...! Have a nice day! Philippose |
|
October 4, 2009, 10:22 |
|
#3 |
Super Moderator
Takuya OSHIMA
Join Date: Mar 2009
Location: Niigata City, Japan
Posts: 518
Blog Entries: 1
Rep Power: 20 |
Hi guys,
Mattijs says the fix is already in 1.6.x: http://www.cfd-online.com/Forums/ope...-x-import.html Takuya |
|
October 4, 2009, 17:27 |
gmshToFoam : 1.6 version may not handle .msh version 2.0
|
#4 |
Member
Jean-Michel FONTAINE
Join Date: Aug 2009
Location: Orleans - France
Posts: 55
Rep Power: 17 |
Dear Philippose and Takuya
Thanks for the time you spend to help me. The cause of the problem is indeed the new dimension field in patches list. gmeshToFoam works again after removing this field in each patch line at the beginning of .msh file. Apparently my OF1.6 did not include up to date gmeshToFoam. I followed the link given by Takuya, and compiled gmeshToFoam.C.gz archive posted by Etienne. Now it works. Many thanks to all of you Regards J-Michel |
|
Tags |
gmshtofoam patch |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[snappyHexMesh] SHM addLayers problem: boundary layers collapsing on a patch | DOFuser | OpenFOAM Meshing & Mesh Conversion | 1 | October 22, 2015 09:09 |
[Gmsh] Single volume Mesh gmsh | PeteH | OpenFOAM Meshing & Mesh Conversion | 9 | August 6, 2013 09:54 |
[Other] StarToFoam error | Kart | OpenFOAM Meshing & Mesh Conversion | 1 | February 4, 2010 05:38 |
[Gmsh] Import gmsh msh to Foam | adorean | OpenFOAM Meshing & Mesh Conversion | 24 | April 27, 2005 09:19 |
Multicomponent fluid | Andrea | CFX | 2 | October 11, 2004 06:12 |