GMSH macro

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: GMSH macro

Post by bernd »

Gave the macro a home on FreeCAD wiki --> Macro_GMSH.
Serchu
Posts: 107
Joined: Tue Feb 10, 2015 12:33 pm
Location: General Pacheco (Buenos Aires) - Argentina
Contact:

Re: GMSH macro

Post by Serchu »

Hi, I have installed on Windows and works very very well, thanks!

Maybe in the future you could add one more botton "Apply", then the workflow would be

1) Select the part to mesh
2) Adjust the mesh parameters
3) Push the Apply button to create the mesh
4) Then the user should check visually if the mesh is good enough for his requeriments

Then if they see that the mesh is not good as he wants, could loop between 2-4. Maybe then the OK buton should be renameed to "ok and keep" or something similar.


Best regards, and thanks in advance.
Serchu
Posts: 107
Joined: Tue Feb 10, 2015 12:33 pm
Location: General Pacheco (Buenos Aires) - Argentina
Contact:

Re: GMSH macro

Post by Serchu »

How could be this macro mapped to a button on the FEM toolbar???

I have copied on the user/appdata/roaming folder, but when I try to customize the toolbars, on the macro tab it says me that there is no macro available.

Thanks
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: GMSH macro

Post by sgrogan »

Before going to the toolbars tab in customize, go to the macro tab and add the macro. Then the macro will be available in custom toolbars
"fight the good fight"
User avatar
teobo
Posts: 410
Joined: Fri Feb 21, 2014 11:23 am

change suggestion

Post by teobo »

Hi,
first would like to thank for the work of the macro, it resulted quite important for whole fem meshing imho, and for so long keeps being it.
Then: Suggest the following change:
1) who suspect the string option universal interface for hole gmsh function space? It will guide the new fc user a lot with the external tool.
2) We freecaders at the moment use it in special way, where compounds are modeled in fc and then afterwards needs to be sewed at gmsh side. This was a whole hurdle run work to find out, and one needs not do it twice.
diff newGMSHMesh.FCMacro oldGMSHMesh.py
84,85c84
< self.le_cmd_line_opt.setText(" -string Geometry.OCCSewFaces=1; ")
< # Ok buttons:
---
> # Ok buttons:
Do not know how the procedure ("pull requests"?) on this goes, first.
And neither what do you think of it?
Regards
ilyxa
Posts: 7
Joined: Mon Mar 23, 2015 12:28 pm

Re: GMSH macro

Post by ilyxa »

Still using with v0.16git, but (small) changes as commited here https://github.com/FreeCAD/FreeCAD/comm ... 859ef6234e

change:

Code: Select all

[ilyxa@orca Macros]$ diff gmshFEM.FCMacro gmshFEM.FCMacro.orig 
16c16
< import FemAnalysis
---
> import MechanicalAnalysis
203c203
<               FemAnalysis.makeFemAnalysis('MechanicalAnalysis')
---
>               MechanicalAnalysis.makeMechanicalAnalysis('MechanicalAnalysis')
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: GMSH macro

Post by bernd »

ilyxa wrote:Still using with v0.16git, but (small) changes as commited here https://github.com/FreeCAD/FreeCAD/comm ... 859ef6234e

change:

Code: Select all

[ilyxa@orca Macros]$ diff gmshFEM.FCMacro gmshFEM.FCMacro.orig 
16c16
< import FemAnalysis
---
> import MechanicalAnalysis
203c203
<               FemAnalysis.makeFemAnalysis('MechanicalAnalysis')
---
>               MechanicalAnalysis.makeMechanicalAnalysis('MechanicalAnalysis')
I made a PullRequst to psicofils github: https://github.com/psicofil/Macros_FreeCAD/pull/3
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: GMSH macro

Post by bernd »

bernd wrote:I made a PullRequst to psicofils github: https://github.com/psicofil/Macros_FreeCAD/pull/3
Is merged. Means the macro works with current FreeCAD 0.16.6189. Good in the regard of coming up release 0.16
revolver1941
Posts: 19
Joined: Sat Aug 30, 2014 9:47 am

Re: GMSH macro

Post by revolver1941 »

bernd wrote:Gave the macro a home on FreeCAD wiki --> Macro_GMSH.
Hi bernd,
I got the same error when using the GMSHMesh.FCMacro. Could you please help me to fix the problem?

Code: Select all

Running: /usr/bin/gmsh c:\users\xxjj\appdata\local\temp\tmp3zrm_w.step -3 -format unv -o c:\users\xxjj\appdata\local\temp/Box_Mesh.unv -algo netgen -clmax 5.00 -optimize -order 2
Unexpected error in GMSHMesh macro: <class 'subprocess.CalledProcessError'>
The macro comes form
https://github.com/psicofil/Macros_Free ... sh.FCMacro
  • OS: Windows 8
    Word size of OS: 64-bit
    Word size of FreeCAD: 64-bit
    Version: 0.16.6237 (Git)
    Build type: Release
    Branch: master
    Hash: f480791472af7f4585e814c266c3c48d901c59b0
    Python version: 2.7.8
    Qt version: 4.8.6
    Coin version: 4.0.0a
    OCC version: 6.8.0.oce-0.17
Thanks
Revol
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: GMSH macro

Post by bernd »

revolver1941 wrote:... I got the same error when using the GMSHMesh
  • OS: Windows 8...
The macro only runs on linux os. You are on windows. If you would like to mesh solid geometry (volumes) just use FreeCAD built in Netgen meshing by selecting the solid and click on FEM_Create Further informations for FEM mesh creation on http://www.freecadweb.org/wiki/index.ph ... a_FEM_Mesh.

If you really would like to use GMSH or if you would like to mesh 2D or 1D Geometry install GMSH --> export brep or step from FreeCAD --> import into GMSH --> mesh --> export *.unv --> import *.unv in FreeCAD
Post Reply