GMSH macro

Need help, or want to share a macro? Post here!
User avatar
bernd
Posts: 11096
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: GMSH macro

Postby bernd » Tue Aug 25, 2015 4:32 am

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

Re: GMSH macro

Postby Serchu » Thu Sep 03, 2015 5:41 pm

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: 91
Joined: Tue Feb 10, 2015 12:33 pm
Location: Tigre (Buenos Aires) - Argentina
Contact:

Re: GMSH macro

Postby Serchu » Thu Sep 03, 2015 5:49 pm

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
Posts: 6210
Joined: Wed Oct 22, 2014 5:02 pm

Re: GMSH macro

Postby sgrogan » Thu Sep 03, 2015 5:56 pm

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

Postby teobo » Thu Oct 29, 2015 10:24 am

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

Postby ilyxa » Mon Dec 07, 2015 11:53 am

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
Posts: 11096
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: GMSH macro

Postby bernd » Thu Jan 07, 2016 9:11 pm

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
Posts: 11096
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: GMSH macro

Postby bernd » Sat Jan 09, 2016 12:03 pm

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

Postby revolver1941 » Wed Jan 20, 2016 5:29 am

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
Posts: 11096
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: GMSH macro

Postby bernd » Wed Jan 20, 2016 6:00 am

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