Errors while creating mesh with Gmsh

About the development of the FEM module/workbench.

Moderator: bernd

Davide_sd
Posts: 25
Joined: Fri Feb 12, 2021 4:18 pm

Errors while creating mesh with Gmsh

Post by Davide_sd »

Just downloaded Freecad 0.19-24267 appimage. I'm getting the following errors while generating the mesh with Gmsh.

Explanation:
1. I select the part in the viewport.
2. Click the button "Create a FEM mesh from a shape by Gmsh mesher" (I do have Gmsh installed).
3. Click apply. This message appears in the window:

Code: Select all

0.0: We are going to start ...
0.0: Start Gmsh ...
Unfortunaly, the meshing process never ends. Then I click cancel with no mesh created.

Here is the report:

Code: Select all

19:18:17  Active analysis found: Analysis
19:18:17    ElementDimension: 3
19:18:17    Group meshing for analysis is set to true in FEM General Preferences. Are you really sure about this? You could run into trouble!
19:18:17    Empty reference: MaterialSolid
19:18:17    One material with no reference shapes. No need to make a group for materials.
19:18:17    {'ConstraintFixed': ['Face1'], 'ConstraintForce': ['Face2']}
19:18:17    /tmp/fcfem_rujnmida/Box_Geometry.brep
19:18:17    /tmp/fcfem_rujnmida/Box_Mesh.unv
19:18:17    /tmp/fcfem_rujnmida/shape2mesh.geo
19:18:17    /usr/local/bin/gmsh
19:18:17  Unexpected error when creating mesh: <class 'RuntimeError'>
19:18:17  Traceback (most recent call last):
  File "/tmp/.mount_FreeCAZvgZl3/usr/Mod/Fem/femtaskpanels/task_mesh_gmsh.py", line 117, in clicked
    self.run_gmsh()
  File "/tmp/.mount_FreeCAZvgZl3/usr/Mod/Fem/femtaskpanels/task_mesh_gmsh.py", line 210, in run_gmsh
    error = sys.exc_info()[0].strip()
<class 'AttributeError'>: type object 'RuntimeError' has no attribute 'strip'
19:18:17  timer2
19:18:17  timer2
19:18:17  timer2
19:18:18  timer2
19:18:18  timer2
19:18:18  timer2
19:18:18  timer2
19:18:18  timer2
19:18:18  timer2
19:18:18  timer2
19:18:18  timer2
19:18:18  timer2
19:18:18  timer2
19:18:18  timer2
19:18:19  timer2
19:18:19  timer2
19:18:19  timer2
19:18:19  timer2
19:18:19  timer2
19:18:19  timer2
19:18:19  timer2
19:18:19  timer2
19:18:19  timer2
19:18:19  timer2
19:18:20  timer2
19:18:20  timer2
19:18:20  timer2
19:18:20  timer2
19:18:20  timer2
19:18:20  timer2
19:18:20  timer2
19:18:20  timer2
19:18:20  timer2
19:18:20  timer2
19:18:21  timer2
19:18:21  timer2
19:18:21  timer2
19:18:21  timer2
19:18:21  timer2
19:18:21  timer2
19:18:21  timer2
19:18:21  timer2
19:18:21  timer2
19:18:21  timer2
19:18:22  timer2
19:18:22  timer2
19:18:22  timer2
19:18:22  timer2
19:18:22  timer2
19:18:22  timer2
19:18:22  timer2
19:18:22  timer2
19:18:22  timer2
19:18:22  timer2
19:18:23  timer2
19:18:23  timer2
19:18:23  timer2
19:18:23  timer2
19:18:23  timer2
19:18:23  timer2
19:18:23  timer2
19:18:23  timer2
19:18:23  timer2
19:18:23  timer2
19:18:24  timer2
19:18:24  timer2
19:18:24  timer2
19:18:24  timer2
19:18:24  timer2
19:18:24  timer2
19:18:24  timer2
19:18:24  timer2
19:18:24  timer2
19:18:24  timer2
19:18:25  timer2
19:18:25  timer2
19:18:25  timer2
19:18:25  timer2
19:18:25  timer2
19:18:25  timer2
19:18:25  timer2
19:18:25  Traceback (most recent call last):
19:18:25    File "/tmp/.mount_FreeCAZvgZl3/usr/Mod/Fem/femtaskpanels/task_mesh_gmsh.py", line 151, in update_timer_text
19:18:25      self.form.l_time.setText("Time: {0:4.1f}: ".format(time.time() - self.Start))
19:18:25  AttributeError: 'NoneType' object has no attribute 'l_time'
19:18:25  timer2
19:18:25  Traceback (most recent call last):
19:18:25    File "/tmp/.mount_FreeCAZvgZl3/usr/Mod/Fem/femtaskpanels/task_mesh_gmsh.py", line 151, in update_timer_text
19:18:25      self.form.l_time.setText("Time: {0:4.1f}: ".format(time.time() - self.Start))
19:18:25  AttributeError: 'NoneType' object has no attribute 'l_time'
19:18:25  timer2
No errors if I create the mesh with Netgen.
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Errors while creating mesh with Gmsh

Post by bernd »

Is gmsh installed and does the gui of gmsh works for you? Ahh just realized you did not mention on which operating system do you are? On Linux you need to install gmsh yourself, on windows it is included in FreeCAD.
Davide_sd
Posts: 25
Joined: Fri Feb 12, 2021 4:18 pm

Re: Errors while creating mesh with Gmsh

Post by Davide_sd »

Sorry about that. Here are the information:

Code: Select all

OS: Ubuntu 20.04.2 LTS (KDE/plasma)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.24267 (Git) AppImage
Build type: Release
Branch: master
Hash: b2ca86d8d72b636011a73394bf9bcdedb3b109b7
Python version: 3.8.6
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: English/United States (en_US)
Gmsh (version 4.8.0) is installed in my system; I compiled it from source. I can launch it from anywhere in the terminal as well as with a desktop launcher. Gmsh is working fine both with script and with GUI.
UR_
Veteran
Posts: 1355
Joined: Tue Jan 03, 2017 8:42 pm

Re: Errors while creating mesh with Gmsh

Post by UR_ »

Davide_sd wrote: Fri Mar 12, 2021 11:13 pm ...I compiled it from source. I can launch it from anywhere...
So your system knows about location of gmsh, but FreeCAD works with

Davide_sd wrote: Fri Mar 12, 2021 6:35 pm Here is the report:
19:18:17 /usr/local/bin/gmsh
Better to use Edit->Preferences->FEM to setup your executable's location.

Screenshot 001.png
Screenshot 001.png (20.32 KiB) Viewed 3157 times
Davide_sd
Posts: 25
Joined: Fri Feb 12, 2021 4:18 pm

Re: Errors while creating mesh with Gmsh

Post by Davide_sd »

UR_ wrote: Sat Mar 13, 2021 4:52 am
Better to use Edit->Preferences->FEM to setup your executable's location.
There is no FEM in my Preferences!
Davide_sd
Posts: 25
Joined: Fri Feb 12, 2021 4:18 pm

Re: Errors while creating mesh with Gmsh

Post by Davide_sd »

Davide_sd wrote: Sat Mar 13, 2021 9:27 am There is no FEM in my Preferences!
Ok, found it, I had to activate the workbench in Preferences -> Workbenches. I specified the installation path but it doesn't solve the problem.

A little note: I also installed FreeCAD 0.18.4 with apt from the repository, which is perfectly able to use gmsh out of the box. Unfortunately this version throw errors about Python's time.clock, that's why I'm trying v0.19...
UR_
Veteran
Posts: 1355
Joined: Tue Jan 03, 2017 8:42 pm

Re: Errors while creating mesh with Gmsh

Post by UR_ »

Can you please provide an updated copy of your report view.


Remark: strip() error was fixed at version 0.19.24385
Last edited by UR_ on Sat Mar 13, 2021 12:09 pm, edited 1 time in total.
Davide_sd
Posts: 25
Joined: Fri Feb 12, 2021 4:18 pm

Re: Errors while creating mesh with Gmsh

Post by Davide_sd »

UR_ wrote: Sat Mar 13, 2021 10:36 am Can you please provide an updated copy of your report view.


Remark: split() error was fixed at version 0.19.24385

Code: Select all

11:49:11  ('Mod/Pyramids_and_polyhedrons', 'Mod/Pyramids-and-Polyhedrons', 'Mod/FreeCAD-Pyramids-and-Polyhedrons', 'Mod/Pyramids-and-polyhedrons')
11:49:50  Active analysis found: Analysis
11:54:40  Active analysis found: Analysis
11:54:44  Active analysis found: Analysis
11:54:44    ElementDimension: 3
11:54:44    Group meshing for analysis is set to true in FEM General Preferences. Are you really sure about this? You could run into trouble!
11:54:44    /tmp/fcfem_40b2x50x/Box_Geometry.brep
11:54:44    /tmp/fcfem_40b2x50x/Box_Mesh.unv
11:54:44    /tmp/fcfem_40b2x50x/shape2mesh.geo
11:54:44    /usr/local/bin/gmsh
11:54:44  Unexpected error when creating mesh: <class 'RuntimeError'>
11:54:44  Traceback (most recent call last):
  File "/tmp/.mount_FreeCAFjVwO4/usr/Mod/Fem/femtaskpanels/task_mesh_gmsh.py", line 117, in clicked
    self.run_gmsh()
  File "/tmp/.mount_FreeCAFjVwO4/usr/Mod/Fem/femtaskpanels/task_mesh_gmsh.py", line 210, in run_gmsh
    error = sys.exc_info()[0].strip()
<class 'AttributeError'>: type object 'RuntimeError' has no attribute 'strip'
11:54:44  timer2
11:54:44  timer2
11:54:45  timer2
11:54:45  timer2
11:54:45  timer2
11:54:45  timer2
11:54:45  timer2
11:54:45  timer2
11:54:45  timer2
11:54:45  timer2
11:54:45  timer2
11:54:45  timer2
11:54:46  timer2
11:54:46  timer2
11:54:46  timer2
11:54:46  timer2
11:54:46  timer2
11:54:46  timer2
11:54:46  timer2
11:54:46  timer2
11:54:46  timer2
11:54:46  timer2
11:54:47  timer2
11:54:47  timer2
11:54:47  timer2
11:54:47  timer2
11:54:47  timer2
11:54:47  timer2
11:54:47  timer2
11:54:47  timer2
11:54:47  timer2
11:54:47  timer2
11:54:48  timer2
11:54:48  timer2
11:54:48  timer2
11:54:48  timer2
11:54:48  timer2
11:54:48  timer2
11:54:48  timer2
11:54:48  timer2
11:54:48  timer2
11:54:48  timer2
11:54:49  timer2
11:54:49  timer2
11:54:49  timer2
11:54:49  timer2
11:54:49  timer2
11:54:49  timer2
11:54:49  timer2
11:54:49  timer2
11:54:49  timer2
11:54:49  timer2
11:54:50  timer2
11:54:50  timer2
11:54:50  timer2
11:54:50  Traceback (most recent call last):
11:54:50    File "/tmp/.mount_FreeCAFjVwO4/usr/Mod/Fem/femtaskpanels/task_mesh_gmsh.py", line 151, in update_timer_text
11:54:50      self.form.l_time.setText("Time: {0:4.1f}: ".format(time.time() - self.Start))
11:54:50  AttributeError: 'NoneType' object has no attribute 'l_time'
11:54:50  timer2
11:54:50  Traceback (most recent call last):
11:54:50    File "/tmp/.mount_FreeCAFjVwO4/usr/Mod/Fem/femtaskpanels/task_mesh_gmsh.py", line 151, in update_timer_text
11:54:50      self.form.l_time.setText("Time: {0:4.1f}: ".format(time.time() - self.Start))
11:54:50  AttributeError: 'NoneType' object has no attribute 'l_time'
11:54:50  timer2
Is there an AppImage for 0.19.24385?
UR_
Veteran
Posts: 1355
Joined: Tue Jan 03, 2017 8:42 pm

Re: Errors while creating mesh with Gmsh

Post by UR_ »

Davide_sd wrote: Sat Mar 13, 2021 10:57 am Is there an AppImage for 0.19.24385?
Latest at github is 24267, ATM :cry:
Perhaps a more recent one will be available on wednesday.
UR_
Veteran
Posts: 1355
Joined: Tue Jan 03, 2017 8:42 pm

Re: Errors while creating mesh with Gmsh

Post by UR_ »

Davide_sd wrote: Fri Mar 12, 2021 11:13 pm I compiled it from source
Using precompiled version from http://gmsh.info/bin/Linux/gmsh-4.8.0-Linux64.tgz is perhaps worth a try.
Post Reply