FEM Install/en: Difference between revisions

From FreeCAD Documentation
(Updating to match new version of source page)
(Updating to match new version of source page)
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
<languages/>
<languages/>
== Introduction ==
== Introduction ==
To be able to do a Finite Element Analysis (FEA) using the [[Fem_Workbench | FEM Worbench]] FreeCAD makes use of two external programs. One is used for generating the [[FEM Mesh]] and the other for solving the system of equations. If your FreeCAD is set up to do mechanical Finite Element Analysis’s could be checked easily by loading and analyzing an example file. See [[FEM CalculiX Cantilever 3D]]


{{TOCright}}
===== FEM Solver =====
For solving the system of equations, [http://www.calculix.de CalculiX] is used. FreeCAD writes a CalculiX input file, starts CalculiX and reads the output of CalculiX. This means CalculiX binary is standalone and independent from FreeCAD. Because of this and since there are more possibilities to get a valid [[FEM Mesh]] '''it is recommended to install the Solver first'''.


To be able to perform finite element analysis (FEA) within the {{KEY|[[Image:Workbench_FEM.svg|24px]] [[Fem_Workbench|FEM Workbench]]}}, FreeCAD makes use of two external programs: one is used for generating the [[FEM Mesh]], and the other for numerically solving the actual analysis. You can test if your FreeCAD installation is ready for FEA by running the [[FEM CalculiX Cantilever 3D]] example which is included with every installation of FreeCAD since v0.17.
===== FEM Mesh Generator =====
In respect to a meshing tool, in order to create a [[FEM Mesh]], FreeCAD uses [https://sourceforge.net/projects/netgen-mesher/ Netgen]. Using Netgen in the FEM Workbench, FreeCAD needs to be compiled against netgen libraries. Apart from Netgen a common way to create a FEM Mesh is the use FEM Gmsh mesh tool. For the use of this tool Gmsh has to be installed on your system. Check out [[FEM Mesh#Create a FEM Mesh]] for the various possibilities to create an FEM Mesh in FreeCAD.


[[Image:FEM_Workbench_workflow.svg|600px]]
== Installation of external FEM Module Software ==
=== Windows ===
If either a stable or development version from [[Download]] is used no further software needs to be installed. Netgen and CalculiX are included in the FreeCAD download package.


{{Caption|Workflow of the FEM Workbench; the workbench calls two external programs to perform meshing of a solid object, and perform the actual solution of the finite element problem}}
=== Linux ===
==== Ubuntu PPA ====
The easiest possibility to get an working FEM Workbench on Linux is the use of the Ubuntu PPA Version. Check out [[Install on Unix#Daily PPA with console]]. The netgen FEM Mesh Generator is already included in the PPA version. CalculiX is an extra package provided by the Ubuntu PPA Version as well. If the Ubuntu PPA repository is already added to your package manager install CalculiX by
apt-get install ccx


=== FEM solver ===
The following FreeCAD Ubuntu PPA packages have Netgen and CalculiX:
* Ubuntu 14.04 (Trusty Tahr)
* Ubuntu 14.10 (Utopic Unicorn)
* Ubuntu 15.04 (Vivid Vervet)


The default solver to perform finite element calculations is [[FEM CalculiX|CalculiX]], a simple solver for analysis of structures. FreeCAD writes a CalculiX input file, starts the solver, and reads the output, which can then be presented visually in the viewport; this means the CalculiX binary is standalone and independent from FreeCAD. Given that there are many programs that can generate a mesh, '''it is recommended to install the solver, and make sure it's working first'''.
For Developers: There is a huge [http://forum.freecadweb.org/viewtopic.php?f=18&t=10393 forum thread] in which the creation of the Ubuntu PPA packages was discussed. It may be useful if the Ubuntu PPA packages needs to be updated. On Launchpad there are more than one CalculiX packages. Only one CalculiX package should be installed and any of them should work. There is a simple reason for not taking the one which was already on Launchpad. We did not know about it (see http://forum.freecadweb.org/viewtopic.php?f=18&t=10393&start=90#p85498)


If the solver is correctly installed, you may run the single command {{incode|ccx}} in the terminal to obtain a simple response:
==== Other ====
On other Linux distributions you need to make sure to get the appropriate software and libraries installed yourself before using FEM workbench.


{{SystemInput|
==== CalculiX ====
User@PC:~$ ccx}}
Since CalculiX is a standalone software you either can install a CalculiX binary or compile CalculiX yourself. Any CalculiX version from 2.7.X works with FreeCAD. Since there hasn't been much changes in CalculiX resently lower versions than 2.7.X might work as well.


{{Code|code=
===== Install CalculiX Binary =====
Usage: CalculiX.exe -i jobname
There are only a few Linux Distributions which are known to have CalculiX Packages in their Repositories. Following a list:
}}
* Arch Linux --> https://aur.archlinux.org/packages/calculix/
* Debian Stretch --> https://packages.debian.org/stretch/calculix-ccx
* Debian Jessie --> The packages of Debian Stretch can be installed by dpkg see [http://forum.freecadweb.org/viewtopic.php?f=4&t=5975&p=110597#p110597 FreeCAD forum]


If the solver is installed, make sure the FEM Workbench is able to find the binary; go to {{MenuCommand|Edit → Preferences → FEM → CalculiX → Search in known binary directories}}. If you compiled the solver yourself, untick the option, and give the correct path to the binary. For other solvers that could be used with FreeCAD, see [[FEM Solver]].
On the CalculiX Website it is possible to download a generic Linux binary of CalculiX. Check out http://www.dhondt.de/ Since any Linux Distribution could have different library paths it is likely possible this binary will not work out of the box at your linux distribution. Check out the following FreeCAD forum threads for more infomation:
* Fedora 21 --> http://forum.freecadweb.org/viewtopic.php?f=18&t=10140
* Some bash commands that may help --> http://forum.freecadweb.org/viewtopic.php?f=3&t=11830&start=20#p95741


===== Compile CalculiX =====
=== FEM mesh generator ===
In order to create a [[FEM Mesh]], FreeCAD uses [http://gmsh.info/ Gmsh] as the default mesher. For this to work, Gmsh should be installed separately from FreeCAD.
Compiling CalculiX is not as easy as it is with many OpenSource software. There are many different resources at FreeCAD forum and the internet. Check out the following:
* Debian --> http://forum.freecadweb.org/viewtopic.php?f=4&t=5975&start=10
* There is a CMake Repository on github, but at FreeCAD forum noone has reported if this one works
** https://github.com/ricortiz/CalculiX-cmake


If the program is correctly installed, you may run the command {{incode|gmsh}} in the terminal to launch the graphical interface of the program. This interface is not used by FreeCAD but demonstrates that the program is installed.
==== Netgen ====
There have been mixed results with the Netgen mesher and the compilation of FreeCAD with Netgen support.
* ToDo


{{SystemInput|
==== Further Informations ====
User@PC:~$ gmsh -info}}
The [http://www.forum.freecadweb.org/ FreeCAD forum] is a very good resource for informations in this regard. Check out google search on FreeCAD forum page by :
* [https://www.google.ch/search?q=sys.append.path+site%3Aforum.freecadweb.org#q=calculix+site:forum.freecadweb.org calculix site:forum.freecadweb.org]
* [https://www.google.ch/search?q=sys.append.path+site%3Aforum.freecadweb.org#q=netgen+site:forum.freecadweb.org netgen site:forum.freecadweb.org]


{{Code|code=
=== OSX ===
Version : 3.0.6
The OSX development packages of FreeCAD 0.17.xxxxx do include Netgen [https://github.com/FreeCAD/FreeCAD/releases] but they do not include CalculiX.
License : GNU General Public License
Build OS : Linux64
Build date : 20171107
Build host : lgw01-amd64-034
Build options : 64Bit Ann Bamg Bfgs Blas(Generic) Blossom C++11 Cgns Chaco DIntegration Dlopen Fltk Gmm Jpeg Kbipack Lapack(Generic) LinuxJoystick MPI MathEx Med Mesh Mmg3d Mpeg NativeFileChooser Netgen ONELAB ONELABMetamodel OpenCASCADE OpenGL OptHom Parser Plugins Png Post Python Solver TetGen/BR Tetgen Voro3D Zlib
FLTK version : 1.3.4
OCC version : 6.9.1
MED version : 3.0.6
Packaged by : buildd
Web site : http://gmsh.info
Mailing list : gmsh@onelab.info
}}


If the mesher is installed, make sure the FEM Workbench is able to find the binary; go to {{MenuCommand|Edit → Preferences → FEM → Gmsh → Search in known binary directories}}. If you compiled the mesher yourself, untick the option, and give the correct path to the binary. See [[FEM Mesh]] for various possibilities of obtaining a valid mesh for analysis.
==== CalculiX ====
See this forum post [https://forum.freecadweb.org/viewtopic.php?f=18&t=10979&p=198652#p198642 FreeCAD Fem on OSX] how to install CalculiX on OSX
Following informations might be outdated:
* [http://forum.freecadweb.org/viewtopic.php?f=18&t=10979 forum]
* [http://forum.freecadweb.org/viewtopic.php?f=8&t=14497 forum]


=== Netgen ===
[[Category:User Documentation]]


{{Emphasis|Note: The Netgen mesher was disabled in March 2017, when FreeCAD transitioned to using OCCT 7.1. Please edit this information if Netgen is usable again with the stable release of FreeCAD.}}

In previous versions of FreeCAD, [https://sourceforge.net/projects/netgen-mesher/ Netgen] was the default mesher. For it to work with the FEM Workbench, FreeCAD had to be linked against the Netgen libraries at compile time. As FreeCAD transitioned from OCE 0.17 to OCCT 7.1, Netgen 4.9.13 failed to link against this version of OCCT, so it was decided to drop Netgen support in the [[FEM Workbench]] (the [[FEM MeshNetgenFromShape|Netgen button]] was removed). Nevertheless, shortly afterwards some users reported success in patching Netgen 5.3.1, so that it worked with OCCT 7.x and FreeCAD.

For historical reference, see the threads:
* [https://forum.freecadweb.org/viewtopic.php?f=4&t=17501 (Ubuntu Daily PPA) Transitioning to OCCT7, VTK7...]
* [https://forum.freecadweb.org/viewtopic.php?t=21246 Ubuntu Daily Builds PPA now using OCC 7.1.0]
* [https://forum.freecadweb.org/viewtopic.php?f=4&t=17501&start=200#p165769 patching Netgen 5.3.1] to work with OCCT 7.1
* [https://forum.freecadweb.org/viewtopic.php?t=28368 Troubles with gmsh in FEM wb (netgen nostalgy)]

Despite Netgen not being available from within the [[FEM Workbench]], it can still be used by itself to produce meshes that can then be imported.

If the program is correctly installed, you may run the command {{incode|netgen}} in the terminal to launch the graphical interface of the program.

{{SystemInput|
User@PC:~$ netgen -V}}


{{Code|code=
NETGEN-6.2-dev
Developed by Joachim Schoeberl at
2010-xxxx Vienna University of Technology
2006-2010 RWTH Aachen University
1996-2006 Johannes Kepler University Linz
Including OpenCascade geometry kernel
Run parallel Netgen with 'mpirun -np xy netgen'
NETGENDIR = .
Tcl header version = 8.6.8
Tcl runtime version = 8.6.8
using internal Tcl-script
optfile ./ng.opt does not exist - using default values
togl-version : 2
OCC module loaded
}}

== Installing on Windows ==
The FreeCAD packages available from the [[download]] page already include Netgen and CalculiX, so no additional software needs to be installed.
<div class="mw-collapsible mw-collapsed toccolours">
== Installing on Linux ==

Linux distributions have different ways of installing software. Many distributions have software repositories and package managers; before compiling source code, look in your package manager for {{incode|netgen}}, {{incode|gmsh}}, {{incode|calculix-ccx}} or {{incode|ccx}}, and install them following the instructions of your own distribution.
<div class="mw-collapsible-content">
=== Ubuntu PPA ===
The [https://launchpad.net/~freecad-maintainers/+archive/ubuntu/freecad-stable freecad-stable] and [https://launchpad.net/~freecad-maintainers/+archive/ubuntu/freecad-daily freecad-daily] personal package archives (PPA) provide a more recent version of FreeCAD than is available in the official Ubuntu repositories. These PPAs include the most recent {{incode|netgen}}, {{incode|gmsh}}, and {{incode|calculix-ccx}} packages as well. See [[Install on Linux|Install on Linux]] for more information on setting up the repositories.

If a PPA is already added to your system, install the packages as follows
{{Code|code=
sudo apt-get install netgen
sudo apt-get install gmsh
sudo apt-get install calculix-ccx
}}

The [https://launchpad.net/~freecad-community/+archive/ubuntu/ppa freecad-community] PPA also provides {{incode|netgen}}, {{incode|gmsh}}, and {{incode|calculix-ccx}} packages for testing. If they are stable enough, they may be added to the daily or stable repositories. The binaries for ccx 2.14 work on Debian Stretch, but not on Debian Buster due to dependency problems.

{{Emphasis|Note:}} the thread [http://forum.freecadweb.org/viewtopic.php?f=18&t=10393 Ubuntu Repository] discusses the creation of the Ubuntu PPA packages. At the time it was written, CalculiX was not included in the Debian repositories, so there were several personal packages in Launchpad. Only one package should be installed.

=== Arch Linux ===
Get the CalculiX package from the [https://aur.archlinux.org/packages/calculix/ AUR repository].

=== Debian ===
* Debian 9 Buster: the packages in the [https://packages.debian.org/buster/calculix-ccx repository] are outdated, but you can use the packages from the Ubuntu PPA ({{incode|freecad-community}}). See [https://forum.freecadweb.org/viewtopic.php?f=18&t=31360&start=10#p279925 Gmsh 4 package available for testing in Community Extras PPA] (forum post).
* Debian 8 Stretch: the packages in the [https://packages.debian.org/stretch/calculix-ccx repository] are outdated, but you can use the packages from the Ubuntu PPA ({{incode|freecad-community}}). See [https://forum.freecadweb.org/viewtopic.php?f=18&t=31360&p=279925#p260872 Gmsh 4 package available for testing in Community Extras PPA] (forum post).
* Debian 7 Jessie: install the packages from Debian 8 Stretch using {{incode|dpkg}}. See [http://forum.freecadweb.org/viewtopic.php?f=4&t=5975&p=110597#p110597 Debian source package for Calculix] (forum post).

=== CalculiX binary ===
The CalculiX authors provide a pre-compiled Linux binary of the solver; it can be downloaded from the [http://www.dhondt.de/ authors' website]. However, since different Linux distributions have different library paths, most likely this binary will not work without making some adjustments.

To use the binary with Fedora 21, see the thread [http://forum.freecadweb.org/viewtopic.php?f=18&t=10140 Making FEM run on linux fedora 21]. For newer Fedora versions, you should compile CalculiX yourself.

If you use this binary, check that the binary is executable, that it is in the executable {{incode|$PATH}} of your system, and that you have the necessary version of the libraries ({{incode|libgfortran}}, {{incode|liblapack}}, {{incode|libblas}}, etc.) against which it was compiled. This is mentioned in the forum post [http://forum.freecadweb.org/viewtopic.php?f=3&t=11830&start=20#p95741 FEM WB].

Use the command {{incode|ldd}} to see the libraries that are linked by the binary. Install any missing dependency.

{{SystemInput|
User@PC:~$ ldd /usr/bin/ccx
}}


{{Code|code=
linux-vdso.so.1 (0x00007fffbabdc000)
libspooles.so.2.2 => /usr/lib/x86_64-linux-gnu/libspooles.so.2.2 (0x00007fe9bd042000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fe9bce23000)
libarpack.so.2 => /usr/lib/x86_64-linux-gnu/libarpack.so.2 (0x00007fe9bcbd9000)
liblapack.so.3 => /usr/lib/x86_64-linux-gnu/liblapack.so.3 (0x00007fe9bc353000)
libgfortran.so.4 => /usr/lib/x86_64-linux-gnu/libgfortran.so.4 (0x00007fe9bbf74000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fe9bbbd6000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fe9bb7e5000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fe9bb5cd000)
libmpi.so.20 => /usr/lib/x86_64-linux-gnu/libmpi.so.20 (0x00007fe9bb2db000)
/lib64/ld-linux-x86-64.so.2 (0x00007fe9bdaa9000)
libblas.so.3 => /usr/lib/x86_64-linux-gnu/libblas.so.3 (0x00007fe9bb080000)
libopenblas.so.0 => /usr/lib/x86_64-linux-gnu/libopenblas.so.0 (0x00007fe9b8dda000)
libquadmath.so.0 => /usr/lib/x86_64-linux-gnu/libquadmath.so.0 (0x00007fe9b8b9a000)
libopen-rte.so.20 => /usr/lib/x86_64-linux-gnu/libopen-rte.so.20 (0x00007fe9b8912000)
libopen-pal.so.20 => /usr/lib/x86_64-linux-gnu/libopen-pal.so.20 (0x00007fe9b8660000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fe9b8458000)
libhwloc.so.5 => /usr/lib/x86_64-linux-gnu/libhwloc.so.5 (0x00007fe9b821b000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fe9b8017000)
libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007fe9b7e14000)
libnuma.so.1 => /usr/lib/x86_64-linux-gnu/libnuma.so.1 (0x00007fe9b7c09000)
libltdl.so.7 => /usr/lib/x86_64-linux-gnu/libltdl.so.7 (0x00007fe9b79ff000)
}}

=== Compile CalculiX ===

Since CalculiX is a standalone application, you can either install a binary packaged for your distribution, or compile it yourself. Any CalculiX version from 2.7.x onwards should work with FreeCAD, and since the code hasn't changed much in years, lower versions than 2.7.x may work as well.

Compiling CalculiX is a task for experienced users, requiring editing the Makefiles and build options in different platforms. See the following information:
* Debian: [http://forum.freecadweb.org/viewtopic.php?f=4&t=5975&start=10 Debian source package for Calculix], [https://forum.freecadweb.org/viewtopic.php?f=18&t=31360&start=10#p260506 Gmsh 4 package available for testing in Community Extras PPA], [https://forum.freecadweb.org/viewtopic.php?f=18&t=34024 Compiling CalculiX ccx on fedora, ubuntu and debian].
* Fedora 27, 28, 29: [https://forum.freecadweb.org/viewtopic.php?f=18&t=34024 Compiling CalculiX ccx on fedora, ubuntu and debian].
* There is a CMake version of the source package in a [https://github.com/ricortiz/CalculiX-cmake github repository], but at the FreeCAD forums no one has reported if this package works.

=== Compile Netgen ===

Netgen was originally linked by FreeCAD when FreeCAD used OCE, the community fork of OpenCascade (OCCT). As OCE lagged in development behind OCCT, FreeCAD switched back to OCCT. This broke the linking of Netgen, which could only link against OCCT 6.9 or OCE 0.18 and below. As OCCT 7.x versions improved the core funcitonality of FreeCAD, it was decided to drop Netgen support in favor of Gmsh.

Since then some success has been achieved patching and linking newer versions of Netgen against OCCT 7.x. Nevertheless, the inclusion of Netgen with FreeCAD is still problematic.
</div> <!-- End of 'Installing on Linux' collapsible div. Do no remove. -->
</div> <!-- End of 'Installing on Linux' collapsible div. Do no remove. -->

== Installing on MacOSX ==

{{VeryImportantMessage|This information may be out of date. If you are an OSX user, please test and clean up this section}}
The OSX [https://github.com/FreeCAD/FreeCAD/releases development packages] of FreeCAD may include Netgen but may not include CalculiX.

See this forum post [https://forum.freecadweb.org/viewtopic.php?f=18&t=10979&p=198652#p198642 FEM on Mac OSX] for information on installing CalculiX, and an [https://forum.freecadweb.org/viewtopic.php?f=18&t=10979&start=90#p273746 updated post] for more recent information.

The following posts may be outdated:
* [http://forum.freecadweb.org/viewtopic.php?f=18&t=10979 FEM on Mac OSX, post 1]
* [http://forum.freecadweb.org/viewtopic.php?f=8&t=14497 MacPorts users: CalculiX port test request]

== Further information ==

The [[FEM Workbench]] is under constant development. The most recent information is found in the [http://www.forum.freecadweb.org/ FreeCAD forum].

If you have problems installing Netgen, Gmsh, or CalculiX, or another external tool, please search the forum first:
* [https://www.google.ch/search?q=sys.append.path+site%3Aforum.freecadweb.org#q=netgen+site:forum.freecadweb.org netgen site:forum.freecadweb.org]
* [https://www.google.ch/search?q=sys.append.path+site%3Aforum.freecadweb.org#q=gmsh+site:forum.freecadweb.org gmsh site:forum.freecadweb.org]
* [https://www.google.ch/search?q=sys.append.path+site%3Aforum.freecadweb.org#q=calculix+site:forum.freecadweb.org calculix site:forum.freecadweb.org]


{{FEM Tools navi{{#translation:}}}}
{{Userdocnavi{{#translation:}}}}
{{clear}}
{{clear}}

Revision as of 08:39, 5 June 2020

Introduction

To be able to perform finite element analysis (FEA) within the FEM Workbench, FreeCAD makes use of two external programs: one is used for generating the FEM Mesh, and the other for numerically solving the actual analysis. You can test if your FreeCAD installation is ready for FEA by running the FEM CalculiX Cantilever 3D example which is included with every installation of FreeCAD since v0.17.

Workflow of the FEM Workbench; the workbench calls two external programs to perform meshing of a solid object, and perform the actual solution of the finite element problem

FEM solver

The default solver to perform finite element calculations is CalculiX, a simple solver for analysis of structures. FreeCAD writes a CalculiX input file, starts the solver, and reads the output, which can then be presented visually in the viewport; this means the CalculiX binary is standalone and independent from FreeCAD. Given that there are many programs that can generate a mesh, it is recommended to install the solver, and make sure it's working first.

If the solver is correctly installed, you may run the single command ccx in the terminal to obtain a simple response:

User@PC:~$ ccx

Usage: CalculiX.exe -i jobname

If the solver is installed, make sure the FEM Workbench is able to find the binary; go to Edit → Preferences → FEM → CalculiX → Search in known binary directories. If you compiled the solver yourself, untick the option, and give the correct path to the binary. For other solvers that could be used with FreeCAD, see FEM Solver.

FEM mesh generator

In order to create a FEM Mesh, FreeCAD uses Gmsh as the default mesher. For this to work, Gmsh should be installed separately from FreeCAD.

If the program is correctly installed, you may run the command gmsh in the terminal to launch the graphical interface of the program. This interface is not used by FreeCAD but demonstrates that the program is installed.

User@PC:~$ gmsh -info

Version          : 3.0.6
License          : GNU General Public License
Build OS         : Linux64
Build date       : 20171107
Build host       : lgw01-amd64-034
Build options    : 64Bit Ann Bamg Bfgs Blas(Generic) Blossom C++11 Cgns Chaco DIntegration Dlopen Fltk Gmm Jpeg Kbipack Lapack(Generic) LinuxJoystick MPI MathEx Med Mesh Mmg3d Mpeg NativeFileChooser Netgen ONELAB ONELABMetamodel OpenCASCADE OpenGL OptHom Parser Plugins Png Post Python Solver TetGen/BR Tetgen Voro3D Zlib
FLTK version     : 1.3.4
OCC version      : 6.9.1
MED version      : 3.0.6
Packaged by      : buildd
Web site         : http://gmsh.info
Mailing list     : gmsh@onelab.info

If the mesher is installed, make sure the FEM Workbench is able to find the binary; go to Edit → Preferences → FEM → Gmsh → Search in known binary directories. If you compiled the mesher yourself, untick the option, and give the correct path to the binary. See FEM Mesh for various possibilities of obtaining a valid mesh for analysis.

Netgen

Note: The Netgen mesher was disabled in March 2017, when FreeCAD transitioned to using OCCT 7.1. Please edit this information if Netgen is usable again with the stable release of FreeCAD.

In previous versions of FreeCAD, Netgen was the default mesher. For it to work with the FEM Workbench, FreeCAD had to be linked against the Netgen libraries at compile time. As FreeCAD transitioned from OCE 0.17 to OCCT 7.1, Netgen 4.9.13 failed to link against this version of OCCT, so it was decided to drop Netgen support in the FEM Workbench (the Netgen button was removed). Nevertheless, shortly afterwards some users reported success in patching Netgen 5.3.1, so that it worked with OCCT 7.x and FreeCAD.

For historical reference, see the threads:

Despite Netgen not being available from within the FEM Workbench, it can still be used by itself to produce meshes that can then be imported.

If the program is correctly installed, you may run the command netgen in the terminal to launch the graphical interface of the program.

User@PC:~$ netgen -V


NETGEN-6.2-dev
Developed by Joachim Schoeberl at
2010-xxxx Vienna University of Technology
2006-2010 RWTH Aachen University
1996-2006 Johannes Kepler University Linz
Including OpenCascade geometry kernel
Run parallel Netgen with 'mpirun -np xy netgen'
NETGENDIR = .
Tcl header version = 8.6.8
Tcl runtime version = 8.6.8 
using internal Tcl-script
optfile ./ng.opt does not exist - using default values
togl-version : 2
OCC module loaded

Installing on Windows

The FreeCAD packages available from the download page already include Netgen and CalculiX, so no additional software needs to be installed.

Installing on Linux

Linux distributions have different ways of installing software. Many distributions have software repositories and package managers; before compiling source code, look in your package manager for netgen, gmsh, calculix-ccx or ccx, and install them following the instructions of your own distribution.

Ubuntu PPA

The freecad-stable and freecad-daily personal package archives (PPA) provide a more recent version of FreeCAD than is available in the official Ubuntu repositories. These PPAs include the most recent netgen, gmsh, and calculix-ccx packages as well. See Install on Linux for more information on setting up the repositories.

If a PPA is already added to your system, install the packages as follows

sudo apt-get install netgen
sudo apt-get install gmsh
sudo apt-get install calculix-ccx

The freecad-community PPA also provides netgen, gmsh, and calculix-ccx packages for testing. If they are stable enough, they may be added to the daily or stable repositories. The binaries for ccx 2.14 work on Debian Stretch, but not on Debian Buster due to dependency problems.

Note: the thread Ubuntu Repository discusses the creation of the Ubuntu PPA packages. At the time it was written, CalculiX was not included in the Debian repositories, so there were several personal packages in Launchpad. Only one package should be installed.

Arch Linux

Get the CalculiX package from the AUR repository.

Debian

CalculiX binary

The CalculiX authors provide a pre-compiled Linux binary of the solver; it can be downloaded from the authors' website. However, since different Linux distributions have different library paths, most likely this binary will not work without making some adjustments.

To use the binary with Fedora 21, see the thread Making FEM run on linux fedora 21. For newer Fedora versions, you should compile CalculiX yourself.

If you use this binary, check that the binary is executable, that it is in the executable $PATH of your system, and that you have the necessary version of the libraries (libgfortran, liblapack, libblas, etc.) against which it was compiled. This is mentioned in the forum post FEM WB.

Use the command ldd to see the libraries that are linked by the binary. Install any missing dependency.

User@PC:~$ ldd /usr/bin/ccx


linux-vdso.so.1 (0x00007fffbabdc000)
 libspooles.so.2.2 => /usr/lib/x86_64-linux-gnu/libspooles.so.2.2 (0x00007fe9bd042000)
 libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fe9bce23000)
 libarpack.so.2 => /usr/lib/x86_64-linux-gnu/libarpack.so.2 (0x00007fe9bcbd9000)
 liblapack.so.3 => /usr/lib/x86_64-linux-gnu/liblapack.so.3 (0x00007fe9bc353000)
 libgfortran.so.4 => /usr/lib/x86_64-linux-gnu/libgfortran.so.4 (0x00007fe9bbf74000)
 libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fe9bbbd6000)
 libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fe9bb7e5000)
 libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fe9bb5cd000)
 libmpi.so.20 => /usr/lib/x86_64-linux-gnu/libmpi.so.20 (0x00007fe9bb2db000)
 /lib64/ld-linux-x86-64.so.2 (0x00007fe9bdaa9000)
 libblas.so.3 => /usr/lib/x86_64-linux-gnu/libblas.so.3 (0x00007fe9bb080000)
 libopenblas.so.0 => /usr/lib/x86_64-linux-gnu/libopenblas.so.0 (0x00007fe9b8dda000)
 libquadmath.so.0 => /usr/lib/x86_64-linux-gnu/libquadmath.so.0 (0x00007fe9b8b9a000)
 libopen-rte.so.20 => /usr/lib/x86_64-linux-gnu/libopen-rte.so.20 (0x00007fe9b8912000)
 libopen-pal.so.20 => /usr/lib/x86_64-linux-gnu/libopen-pal.so.20 (0x00007fe9b8660000)
 librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fe9b8458000)
 libhwloc.so.5 => /usr/lib/x86_64-linux-gnu/libhwloc.so.5 (0x00007fe9b821b000)
 libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fe9b8017000)
 libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007fe9b7e14000)
 libnuma.so.1 => /usr/lib/x86_64-linux-gnu/libnuma.so.1 (0x00007fe9b7c09000)
 libltdl.so.7 => /usr/lib/x86_64-linux-gnu/libltdl.so.7 (0x00007fe9b79ff000)

Compile CalculiX

Since CalculiX is a standalone application, you can either install a binary packaged for your distribution, or compile it yourself. Any CalculiX version from 2.7.x onwards should work with FreeCAD, and since the code hasn't changed much in years, lower versions than 2.7.x may work as well.

Compiling CalculiX is a task for experienced users, requiring editing the Makefiles and build options in different platforms. See the following information:

Compile Netgen

Netgen was originally linked by FreeCAD when FreeCAD used OCE, the community fork of OpenCascade (OCCT). As OCE lagged in development behind OCCT, FreeCAD switched back to OCCT. This broke the linking of Netgen, which could only link against OCCT 6.9 or OCE 0.18 and below. As OCCT 7.x versions improved the core funcitonality of FreeCAD, it was decided to drop Netgen support in favor of Gmsh.

Since then some success has been achieved patching and linking newer versions of Netgen against OCCT 7.x. Nevertheless, the inclusion of Netgen with FreeCAD is still problematic.

Installing on MacOSX

This information may be out of date. If you are an OSX user, please test and clean up this section

The OSX development packages of FreeCAD may include Netgen but may not include CalculiX.

See this forum post FEM on Mac OSX for information on installing CalculiX, and an updated post for more recent information.

The following posts may be outdated:

Further information

The FEM Workbench is under constant development. The most recent information is found in the FreeCAD forum.

If you have problems installing Netgen, Gmsh, or CalculiX, or another external tool, please search the forum first: