GMesh broken in Conda_Py3QT5 build

About the development of the FEM module/workbench.

Moderator: bernd

User avatar
uwestoehr
Posts: 452
Joined: Sun Jan 27, 2019 3:21 am

GMesh broken in Conda_Py3QT5 build

Postby uwestoehr » Sun Feb 03, 2019 4:29 pm

- open the attached file: https://forum.freecadweb.org/download/f ... w&id=76010

* at first with:
OS: Windows 7
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.15780 (Git)
Build type: Release
Branch: master
Hash: f94e76c1116ec3b818961ff65131b3d86fa5b95e
Python version: 2.7.14
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: German/Germany (de_DE)

- double-click there on the Gmsh mesh and press in the appearing task "Apply" to recalculate the mesh

result: everything is fine

* now open the same file with:
OS: Windows 7
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.15780 (Git)
Build type: Release
Branch: master
Hash: f94e76c1116ec3b818961ff65131b3d86fa5b95e
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Germany (de_DE)

- double-click there on the Gmsh mesh and press in the appearing task "Apply" to recalculate the mesh

result: the mesh generation failes:

Code: Select all

Warning : Unknown element type for UNV export (MSH type 15) - output file might be invalid
Warning : Unknown element type for UNV export (MSH type 15) - output file might be invalid
Warning : Unknown element type for UNV export (MSH type 15) - output file might be invalid
Warning : Unknown element type for UNV export (MSH type 15) - output file might be invalid
Warning : Unknown element type for UNV export (MSH type 15) - output file might be invalid
Warning : Unknown element type for UNV export (MSH type 15) - output file might be invalid
Warning : Unknown element type for UNV export (MSH type 15) - output file might be invalid
Warning : Unknown element type for UNV export (MSH type 15) - output file might be invalid
Warning : Unknown element type for UNV export (MSH type 15) - output file might be invalid
Warning : Unknown element type for UNV export (MSH type 15) - output file might be invalid
Warning : Unknown element type for UNV export (MSH type 15) - output file might be invalid
Warning : Unknown element type for UNV export (MSH type 15) - output file might be invalid
I spent some time and are lost because I have not set up anything special, just use the official releases:
https://github.com/FreeCAD/FreeCAD/releases
and I assured that all preferences settings are on default.

Is this a bug or is Gmsh not yet ready for Python3?
Attachments
Bimetall-Test.FCStd
(887.84 KiB) Downloaded 18 times
Jee-Bee
Posts: 1806
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: GMesh broken in Conda_Py3QT5 build

Postby Jee-Bee » Sun Feb 03, 2019 8:05 pm

can you check if GMSH is available in the build. it should be in the bin folder (same as the freecad.exe) before it wasn't available. you can link to another GMSH if needed. GMSH don't care about python. python just tells how to execute GMSH.

But my own experience is that i never had GMSH to work with precompiled FC versions. (see https://forum.freecadweb.org/viewtopic.php?p=231656) What i remember is that it create a mesh but for some reason i won't be imported...
User avatar
uwestoehr
Posts: 452
Joined: Sun Jan 27, 2019 3:21 am

Re: GMesh broken in Conda_Py3QT5 build

Postby uwestoehr » Sun Feb 03, 2019 8:12 pm

Jee-Bee wrote:
Sun Feb 03, 2019 8:05 pm
can you check if GMSH is available in the build. it should be in the bin folder (same as the freecad.exe) before it wasn't available. you can link to another GMSH if needed. GMSH don't care about python. python just tells how to execute GMSH.
For me GMSH works out of the box with the OCCT 7.2 release of 0.18.
For the Conda build I tried to use the latest GMSH 4.1.4 but also with this, it fails while it works for the OCCT 7.2 build.

Since I can work fine with the OCCT 7.2 build of FC I have no real troubles but maybe there is something to be fixed with the Conda build.
User avatar
bernd
Posts: 7730
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: GMesh broken in Conda_Py3QT5 build

Postby bernd » Sun Feb 03, 2019 8:23 pm

Uwe for your infromation ...

gmsh mesh object works as follows ...

- FreeCAD geometry is exported to brep
- a geo file is written (Gmsh scripting language before Python but still supported)
- Gmsh is called with this geo file
- Gmsh writes an unv file
- FreeCAD reades the unv file

- if you watch the report output during meshing. the filenames are writen. In the geo file you will find the appropriate commands to run Gmsh with the geo and the brep geometry.
- With this you will easily find where the culprit is (In Gmsh, in FreeCAD, in SMESH (govern for unv writer) in OCCT (govern for brep writer and reader)) etc

cheers bernd
User avatar
uwestoehr
Posts: 452
Joined: Sun Jan 27, 2019 3:21 am

Re: GMesh broken in Conda_Py3QT5 build

Postby uwestoehr » Mon Feb 04, 2019 12:22 pm

bernd wrote:
Sun Feb 03, 2019 8:23 pm
gmsh mesh object works as follows ...
Many thanks Bernd, I will try the next days if I can find out what makes the problem.
User avatar
uwestoehr
Posts: 452
Joined: Sun Jan 27, 2019 3:21 am

Re: GMesh broken in Conda_Py3QT5 build

Postby uwestoehr » Tue Feb 05, 2019 9:13 pm

Hi Bernd, I had now a closer look and I am puzzled because I get a successful run but nevertheless warnings:

Code: Select all

Fem::FemMeshObjectPython / FEMMeshGmsh: Links go out of the allowed scope
We are going to start Gmsh FEM mesh run!
  Part to mesh: Name --> Box,  Label --> Box, ShapeType --> Solid
  CharacteristicLengthMax: 2.0
  CharacteristicLengthMin: 0.0
  ElementOrder: 2
  ElementDimension: 3
  C:\Users\USti\AppData\Local\Temp\Box_Geometry.brep
  C:\Users\USti\AppData\Local\Temp\Box_Mesh_TmpGmsh.unv
  C:\Users\USti\AppData\Local\Temp\shape2mesh.geo
  C:/Users/USti/Desktop/FreeCAD_0.18.15780_Conda_Py3QT5-WinVS2015_x64/bin/gmsh.exe
  No Group meshing for analysis.
  The Part should have a pretty new FEM mesh!
Warning : Unknown element type for UNV export (MSH type 15) - output file might be invalid
What means "Links go out of the allowed scope"?

Besides this the only thing I notice is that the path to the gmsh.exe uses slashes instead of backslashes. But this is the same for both FC builds.

The only difference between the Conda and normal build I see is in the unv-file and in the precision of the geo-file.

I attached the .geo, .unv, bprep and the .diff files of them in a ZIP file.

Do you have an idea what is going wrong?
Attachments
Temp.zip
ZIP file with 9 files
(289.7 KiB) Downloaded 6 times
User avatar
bernd
Posts: 7730
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: GMesh broken in Conda_Py3QT5 build

Postby bernd » Tue Feb 05, 2019 11:31 pm

uwestoehr wrote:
Tue Feb 05, 2019 9:13 pm
Do you have an idea what is going wrong?
The only idea I have is that the builds uses different gmsh binaries. Might be the conda build builds his own gmsh. If you did not change anything every build should use his provided gmsh. You can change the path in FEM prefs. Try to set the gmsh binary path to the one from the normal build and try the conda build. Does it work. You could do the other way too. Set the path to the conda gmsh and run the normal build. Does it fail? I would assume it is conda gmsh than ...
uwestoehr wrote:
Tue Feb 05, 2019 9:13 pm

Code: Select all

Fem::FemMeshObjectPython / FEMMeshGmsh: Links go out of the allowed scope
Never had this ...
User avatar
uwestoehr
Posts: 452
Joined: Sun Jan 27, 2019 3:21 am

Re: GMesh broken in Conda_Py3QT5 build

Postby uwestoehr » Wed Feb 06, 2019 1:20 am

bernd wrote:
Tue Feb 05, 2019 11:31 pm
Try to set the gmsh binary path to the one from the normal build and try the conda build. Does it work.
Yes, this works.
When I set the gmsh of the conda build in the conda FC build it fails.

It might be that FC addresses GMSH in an outdated way because it works with GMSH 3.x (the normal FC build uses GMSH 3.0.6) and it fails with all versions of GMSH 4.x (the Conda build uses GMSH 4.0.7 and I also tried 4.1.3 and 4.1.4).

The question is if GMSH 4.x is declared ready to use. if yes, should I open a FC bug AND also report this to the GMSH developers?

Btw., what does "Conda" mean?
User avatar
bernd
Posts: 7730
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: GMesh broken in Conda_Py3QT5 build

Postby bernd » Wed Feb 06, 2019 10:35 am

See last post, gmsh seams to have problems in conda build ...
looo wrote: PING
sgrogan wrote: PING
uwestoehr wrote:
Wed Feb 06, 2019 1:20 am
Btw., what does "Conda" mean?
The guys above do far better know this than me. https://en.wikipedia.org/wiki/Conda_(package_manager)
User avatar
uwestoehr
Posts: 452
Joined: Sun Jan 27, 2019 3:21 am

Re: GMesh broken in Conda_Py3QT5 build

Postby uwestoehr » Wed Feb 06, 2019 10:58 am

bernd wrote:
Wed Feb 06, 2019 10:35 am
See last post, gmsh seams to have problems in conda build ...
Conda is not to blame. I tried the normal build of FC and tried there GMSH 4.0.7 and GMSH 4.1.4. And also the normal FC build fails with GMSH 4.x while it works fine with GMSH 3.x.
The error messages are the same as with the Conda build of FC.