freecad to gmsh

About the development of the FEM module/workbench.

Moderator: bernd

Post Reply
Jihoon
Posts: 3
Joined: Thu Jul 21, 2022 5:51 am

freecad to gmsh

Post by Jihoon »

Hi! I'm totally new to FreeCAD.. and I really need some help..

The final goal is to draw a 3D shape with hex mesh.

1. is there any method to export node and element information for Gmsh from freeCAD? I need node and element information for analysis.
2. How can I make a hex mesh in freeCAD?
3. Can I actually import file in Gmsh from freeCad? If I can, could you please let me know what file extensions I have to use?

Thank you !
User avatar
NewJoker
Veteran
Posts: 3017
Joined: Sun Oct 11, 2020 7:49 pm

Re: freecad to gmsh

Post by NewJoker »

Hexahedral mesh can't be created in FreeCAD but you can export the geometry in one of the supported formats (e.g. STEP), import it to Gmsh or Salome_Meca (another free software) and create the hexahedral mesh. When it's ready, you can easily export the mesh to .inp file which can be opened in FreeCAD. However, you won't be able to prepare the analysis using this mesh because in FEM workbench constraints are applied only to the geometry. Thus, you would have to do the preprocessing outside of FreeCAD.

This thread should belong to the FEM subforum.
Jihoon
Posts: 3
Joined: Thu Jul 21, 2022 5:51 am

Re: freecad to gmsh

Post by Jihoon »

Thank you so much for your kind answer!
I'm so sorry for the late reply...
I have one more question though. You said I would have to do the preprocessing outside of FreeCAD.
Could you explain me what does it mean? How can I preprocess outside of FreeCAD?

Thanks a lot!! :D
User avatar
NewJoker
Veteran
Posts: 3017
Joined: Sun Oct 11, 2020 7:49 pm

Re: freecad to gmsh

Post by NewJoker »

CalculiX’s input files use very user-friendly keyword syntax. Once you have the mesh and set definitions, you can easily set the analysis manually, by specifying proper keywords. Use CalculiX’s documentation (especially the "Input deck format" section) for that: http://www.dhondt.de/ccx_2.19.pdf
thschrader
Veteran
Posts: 3129
Joined: Sat May 20, 2017 12:06 pm
Location: Germany

Re: freecad to gmsh

Post by thschrader »

Jihoon wrote: Thu Jul 21, 2022 5:56 am ...
2. How can I make a hex mesh in freeCAD?
...
Goto youtube, search for "anisim". He has done several tutorials on generating hex-meshes with gmsh
and importing into FC. Example:
https://www.youtube.com/watch?v=hLe8M4QIuNE

Tutorials are in german, but should work without sound.
User avatar
NewJoker
Veteran
Posts: 3017
Joined: Sun Oct 11, 2020 7:49 pm

Re: freecad to gmsh

Post by NewJoker »

I thought that it won't work this way but apparently it works very well. So:
1. Prepare the geometry in FreeCAD
2. Export it for meshing e.g. in Gmsh or Salome_Meca
3. Import the mesh in compatible format like .inp or .unv
4. Drag the mesh to the Analysis container
5. Apply constraints to the geometry

mesh.JPG
mesh.JPG (64.96 KiB) Viewed 1315 times
chrisb
Veteran
Posts: 53920
Joined: Tue Mar 17, 2015 9:14 am

Re: freecad to gmsh

Post by chrisb »

Moved from Help forum.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Post Reply