GMSH macro

Need help, or want to share a macro? Post here!
revolver1941
Posts: 19
Joined: Sat Aug 30, 2014 9:47 am

Re: GMSH macro

Postby revolver1941 » Wed Jan 20, 2016 6:14 pm

bernd wrote: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
Thanks bernd,
I use python script http://www.freecadweb.org/wiki/index.ph ... a_FEM_Mesh to build a beam, and use GMSH to build a shell. And I still have some questions. I'm not very clearly about how the beam cross section and shell thickness works although I have done the basic examples as follows. And the beam cross section and the shell thickness doesn't display in the result information. Is there anything I haven't noticed to display the correct results?
pic (2).PNG
pic (2).PNG (27.59 KiB) Viewed 1603 times
pic (1).PNG
pic (1).PNG (73.07 KiB) Viewed 1603 times
BeamTest.FCStd
(7.45 KiB) Downloaded 48 times
ShellTest.FCStd
(17.75 KiB) Downloaded 46 times
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 9:08 pm

revolver1941 wrote:... And I still have some questions. I'm not very clearly about how the beam cross section and shell thickness works although I have done the basic examples as follows. And the beam cross section and the shell thickness doesn't display in the result information. Is there anything I haven't noticed to display the correct results?
Your files look good to me. What exactly are you after ? What kind of result informations. If you would like to see results on 3D geometry (bending stress) this is not possible at the moment inside FreeCAD. You need to edit the input file. See attached screen. Delete the ",OUTPUT=2d" in the input file. This will expand the results in CalculiX to 3D. But than FreeCAD can not read the frd file anymore. You need to use CalculiX Graphix (CGX) to display them. Just open the frd with CGX. Your frd file is in E:/MSTMMSim/FemTest

You may open a thread in FEM part of the forum for further stuff in the regard of FEM module.
Attachments
screen.jpg
screen.jpg (260.04 KiB) Viewed 1596 times
fandaL
Posts: 384
Joined: Thu Jul 24, 2014 8:29 am

Re: GMSH macro

Postby fandaL » Wed Jan 20, 2016 11:35 pm

bernd wrote:
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
1) I downloaded the macro for windows by ulrich1a from here:
viewtopic.php?f=22&t=11182#p93788

2) changed a path at line 8 to my gmsh.exe
gmsh_bin = "D:\soft\gmsh-2.11.0-Windows\gmsh.exe"

3) applied changes from the commit:
https://github.com/psicofil/Macros_Free ... 4a695e4ce4

4) and successfully ran the macro on windows

OS: Windows 7
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
User avatar
sgrogan
Posts: 6217
Joined: Wed Oct 22, 2014 5:02 pm

Re: GMSH macro

Postby sgrogan » Thu Jan 21, 2016 3:00 am

fandaL wrote:1) I downloaded the macro for windows by ulrich1a from here:
viewtopic.php?f=22&t=11182#p93788

2) changed a path at line 8 to my gmsh.exe
gmsh_bin = "D:\soft\gmsh-2.11.0-Windows\gmsh.exe"

3) applied changes from the commit:
https://github.com/psicofil/Macros_Free ... 4a695e4ce4

4) and successfully ran the macro on windows
Works for me as well on
OS: Windows 7
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.6253 (Git)
Build type: Release
Branch: master
Hash: a07b9cd0d447fe28610330622c9b5a2557538325
Python version: 2.7.8
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17

EDIT: But I can't run an analysis?


Thanks fandaL :)
Attachments
FEM.PNG
FEM.PNG (152.55 KiB) Viewed 1571 times
"fight the good fight"
fandaL
Posts: 384
Joined: Thu Jul 24, 2014 8:29 am

Re: GMSH macro

Postby fandaL » Thu Jan 21, 2016 7:07 am

For me it works in usual way.
analysis_with_gmsh_mesh.png
analysis_with_gmsh_mesh.png (117.45 KiB) Viewed 1559 times
revolver1941
Posts: 19
Joined: Sat Aug 30, 2014 9:47 am

Re: GMSH macro

Postby revolver1941 » Thu Jan 21, 2016 4:26 pm

bernd wrote:...Your files look good to me. What exactly are you after ? What kind of result informations...
Hi bernd,
I'm sorry for not having a clear expression. I know a little about ANSYS, so at first I thought there should be more detail settings about the beam cross section and shell thickness in FreeCAD such as I-Beam and L-Beam and the corresponding size as shown in the following figure.
And I also concerned about showing results on 3D geometry (bending stress). But now I Know it cann't be achieved in FreeCAD currently as you said. Anyway, your help played an important role to me. However, it seems a little hard for me to transplant this feature form CGX to FreeCAD at present. I will continue to pay close attention to the latest developments of FEM module.
Thanks very much again for your generous help.
revol
22.PNG
22.PNG (87.38 KiB) Viewed 1539 times
revolver1941
Posts: 19
Joined: Sat Aug 30, 2014 9:47 am

Re: GMSH macro

Postby revolver1941 » Thu Jan 21, 2016 4:31 pm

fandaL wrote:...and successfully ran the macro on windows...
Thanks fandaL. The macro works for me, too. :lol:
User avatar
sgrogan
Posts: 6217
Joined: Wed Oct 22, 2014 5:02 pm

Re: GMSH macro

Postby sgrogan » Thu Jan 21, 2016 10:24 pm

I must highlight the solver object!
Image
Thanks fandaL :)
"fight the good fight"
User avatar
bernd
Posts: 11096
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: GMSH macro

Postby bernd » Fri Jan 22, 2016 7:26 am

revolver1941 wrote:... at first I thought there should be more detail settings about the beam cross section and shell thickness in FreeCAD such as I-Beam and L-Beam and the corresponding size as shown in the following figure.
This is not a limitation of FreeCAD but a limitation off CalculiX the solver FreeCAD FEM uses. CalculiX only supports beam elements for rectangle and circle sections at the moment. :(
revolver1941 wrote:And I also concerned about showing results on 3D geometry (bending stress). But now I Know it cann't be achieved in FreeCAD currently as you said.
At the moment ! Development is going on. I'm interested in this too. So stay tuned.
User avatar
bernd
Posts: 11096
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: GMSH macro

Postby bernd » Fri Jan 22, 2016 7:27 am

sgrogan wrote:I must highlight the solver object!
Image
Thanks fandaL :)
We should add another smiley !!! :lol: :lol: