Felt in FEM Workbench

About the development of the FEM module/workbench.

Moderator: bernd

m42kus
Posts: 159
Joined: Tue Sep 02, 2014 9:41 am

Re: Felt in FEM Workbench

Postby m42kus » Thu Apr 04, 2019 7:07 am

Hey Sudhanshu,

i wrote a few tutorials on how to extend the solver framework a while back:
https://www.freecadweb.org/wiki/Extend_FEM_Module
https://www.freecadweb.org/wiki/Add_FEM ... n_Tutorial
https://www.freecadweb.org/wiki/Add_FEM ... t_Tutorial
They are a little outdated, the package structure and module naming has since been changed - but they may still be helpful :)

regards,
Markus
My GSoC Devlog: ceeli.github.io/gsoc
User avatar
Sudhanshu
Posts: 50
Joined: Mon Oct 15, 2018 5:22 am

Re: Felt in FEM Workbench

Postby Sudhanshu » Thu Apr 04, 2019 8:26 am

m42kus wrote:
Thu Apr 04, 2019 7:07 am
Hey Sudhanshu,

i wrote a few tutorials on how to extend the solver framework a while back:
https://www.freecadweb.org/wiki/Extend_FEM_Module
https://www.freecadweb.org/wiki/Add_FEM ... n_Tutorial
https://www.freecadweb.org/wiki/Add_FEM ... t_Tutorial
They are a little outdated, the package structure and module naming has since been changed - but they may still be helpful :)
I have looked into the first link already.
Will take a look at the other two.
Thanks for the help. :D
User avatar
Sudhanshu
Posts: 50
Joined: Mon Oct 15, 2018 5:22 am

Re: Felt in FEM Workbench

Postby Sudhanshu » Fri Apr 05, 2019 4:38 am

bernd wrote:
Fri Mar 29, 2019 11:14 am

Before you gone start a new solver, it is recommended to play with FreeCAD FEM and existing solver calculix.
So yesterday I was trying to install Netgen so that I could compare it with Corduroy.
I found the official installation instructions here and it looks rather painful to get the newest version of Netgen installed on your pc.

Then I switched to doing some FEM analysis to get deeper insights as a user.
There I noticed that though I had never installed netgen nor calculix (not that I remember even if I did) FreeCAD was able to use them.
But I have heard that you need to separately install 3rd party softwares in FreeCAD to use them.

So here are my few doubts:

1. How does FreeCAD installs netgen? Does it follow that painful process or is there some other way?
2. How is a solver, lets say Calculix, installed in FreeCAD? Through the addon manager or does it come with the installation of FEM workbench?
User avatar
bernd
Posts: 8232
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Felt in FEM Workbench

Postby bernd » Fri Apr 05, 2019 7:24 am

which OS are you on?

Netgen is integrated in FreeCAD. If it is not in your FreeCAD, use gmsh instead of netgen!

Installation of gmsh and calculix depends on your os. Again which os are you on?
User avatar
Sudhanshu
Posts: 50
Joined: Mon Oct 15, 2018 5:22 am

Re: Felt in FEM Workbench

Postby Sudhanshu » Sun Apr 07, 2019 2:00 pm

bernd wrote:
Fri Apr 05, 2019 7:24 am
which OS are you on? Netgen is integrated in FreeCAD. If it is not in your FreeCAD, use gmsh instead of netgen!
I am using Ubuntu 18.04.

So which version of Netgen was integrated in FreeCAD, the one available through PPA or the one that needs to be compiled manually?

Also, what about the solvers?
Are they also integrated or separately installed along with the workbench?
User avatar
bernd
Posts: 8232
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Felt in FEM Workbench

Postby bernd » Sun Apr 07, 2019 2:24 pm

calculix needs to be installed. The binary will than be ccx. Set the path ot ccx in FEM preferences.
https://launchpad.net/~freecad-communit ... ubuntu/ppa


Do you compile FreeCAD yourself?

For meshing the easieast would be to install the gmesh for ubuntu and set the path to gmsh in FEM prefereces.

This both should do the trick for you.
User avatar
Sudhanshu
Posts: 50
Joined: Mon Oct 15, 2018 5:22 am

Re: Felt in FEM Workbench

Postby Sudhanshu » Sun Apr 07, 2019 2:38 pm

bernd wrote:
Sun Apr 07, 2019 2:24 pm
calculix needs to be installed. The binary will than be ccx. Set the path ot ccx in FEM preferences.
https://launchpad.net/~freecad-communit ... ubuntu/ppa


Do you compile FreeCAD yourself?
I have compiled it once, it was 0.16 version back then.
It was my first blog by the way.
But the one that I am using currently was installed via apt.

bernd wrote:
Sun Apr 07, 2019 2:24 pm

For meshing the easiest would be to install the gmesh for ubuntu and set the path to gmsh in FEM prefereces.

This both should do the trick for you.
Is there any difference between gmesh and netgen?
I had seen this topic being discussed in two threads by you, but wasn't able to understand it much.

I just want to compare the input and output of corduroy with either of the meshers in FreeCAD.
User avatar
bernd
Posts: 8232
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Felt in FEM Workbench

Postby bernd » Sun Apr 07, 2019 6:20 pm

To get started with FEM it does not matter if you use Gmsh or Netgen. If your FreeCAD does not inlcude Netgen just install Gmsh from ubuntu repo.
vocx
Posts: 1029
Joined: Thu Oct 18, 2018 9:18 pm

Re: Felt in FEM Workbench

Postby vocx » Sun Apr 07, 2019 7:18 pm

Sudhanshu wrote:
Sun Apr 07, 2019 2:38 pm
Is there any difference between gmesh and netgen?
Of course there is a difference. Gmsh and Netgen are two different programs. They basically do the same thing, create a mesh of a solid object; however, since they are different programs, they have their own ways of working. It's like asking "Is there a difference between Arch and Ubuntu?"
I had seen this topic being discussed in two threads by you, but wasn't able to understand it much.

I just want to compare the input and output of corduroy with either of the meshers in FreeCAD.
There is a lot of confusing information that has transpired over the years in the forum and wiki, so I will try to summarize it as follows:
  • Netgen was previously included with FreeCAD, and you could use it directly within the FEM Workbench. However, because FreeCAD changed OpenCascade libraries two years ago, Netgen stopped working, so it was removed. In theory, you could select a solid, and with a single button (FEM MeshNetgenFromShape), you'd get a mesh.
  • The same thing is possible with Gmsh. If you install this program, you can select a solid, and with a single button (FEM MeshGmshFromShape), you can get a mesh.
  • However, independently of that button being present in the FEM Workbench or not, you can install and use Netgen and Gmsh outside FreeCAD, just like any other pre-processor that you have used. See FEM Install and FEM Mesh for more information.
If you just want to obtain a mesh, and compare it against the mesh produced by "corduroy", I suggest you install Netgen and Gmsh and try to work with them outside of FreeCAD. They accept Step or Brep files, and can output .unv or .inp files for you to import into FreeCAD.

Set up the personal package repositories and

Code: Select all

sudo apt install gmsh
sudo apt install netgen
Currently, it seems that Gmsh 4.x, provided by freecad-community, isn't working with the current FreeCAD stable 0.18.1 (OpenCascade linking dependencies). But that doesn't matter much. You can install Gmsh 3.0.6 instead.

At the end of the day, a mesher has a ton of options to produce a mesh. All of them work more or less the same if you know what parameters you need to tweak.
User avatar
bernd
Posts: 8232
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Felt in FEM Workbench

Postby bernd » Sun Apr 07, 2019 8:27 pm

vocx wrote:
Sun Apr 07, 2019 7:18 pm
There is a lot of confusing information that has transpired over the years in the forum and wiki, so I will try to summarize it as follows:
  • Netgen was previously included with FreeCAD, and you could use it directly within the FEM Workbench. However, because FreeCAD changed OpenCascade libraries two years ago, Netgen stopped working, so it was removed. In theory, you could select a solid, and with a single button (FEM MeshNetgenFromShape), you'd get a mesh.
Just to make clear. Netgen was never included in FreeCAD source. FreeCAD needs to be compiled and linked against Netgen to make Netgen mesher inside FreeCAD working. May be, may be not, the provided FreeCAD binaries for various operating systems include netgen mesher or not!

As stated, to get started just use gmsh.