gmshToFoam : problem with patch
I try to use gmshToFoam (from 1.6 binaries) to convert meshes with patches from gmsh 2.4.2.
I get following error message:
Does anybody know how to solve that ? Here attached one mesh sample
Thanks in advance
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:
<length of list>
<number> <patch name>
The current "msh" has the following format:
<length of list>
<physical dimension> <number> <patch name>
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;
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!
Mattijs says the fix is already in 1.6.x: http://www.cfd-online.com/Forums/ope...-x-import.html
gmshToFoam : 1.6 version may not handle .msh version 2.0
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
|All times are GMT -4. The time now is 19:28.|