FEM Install: Difference between revisions

From FreeCAD Documentation
(Correct file name for the image with the extension)
No edit summary
(8 intermediate revisions by 6 users not shown)
Line 1: Line 1:
<languages/>
<languages/>

{{TOCright}}
<translate>
<translate>
== Introduction == <!--T:1-->
== Introduction == <!--T:1-->
To be able to perform finite element analysis (FEA) within the [[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.
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.


</translate>
</translate>
Line 8: Line 10:
<translate>
<translate>


<!--T:19-->
{{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}}
{{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}}


=== FEM solver === <!--T:2-->
=== FEM solver === <!--T:2-->


<!--T:20-->
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'''.
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'''.


<!--T:21-->
If the solver is correctly installed, you may run the single command {{incode|ccx}} in the terminal to obtain a simple response:
If the solver is correctly installed, you may run the single command {{incode|ccx}} in the terminal to obtain a simple response:


<!--T:22-->
{{SystemInput|
{{SystemInput|
User@PC:~$ ccx}}
User@PC:~$ ccx}}


<!--T:23-->
{{Code|code=
{{Code|code=
Usage: CalculiX.exe -i jobname
Usage: CalculiX.exe -i jobname
}}
}}


<!--T:24-->
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]].
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]].


Line 28: Line 36:
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.
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.


<!--T:25-->
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.
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.


<!--T:26-->
{{SystemInput|
{{SystemInput|
User@PC:~$ gmsh -info}}
User@PC:~$ gmsh -info}}


<!--T:27-->
{{Code|code=
{{Code|code=
Version : 3.0.6
Version : 3.0.6
Line 48: Line 59:
}}
}}


<!--T:28-->
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.
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.


=== Netgen ===
=== Netgen === <!--T:29-->


<!--T:30-->
{{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.}}
{{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.}}


<!--T:31-->
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.
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.


<!--T:32-->
For historical reference, see the threads:
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?f=4&t=17501 (Ubuntu Daily PPA) Transitioning to OCCT7, VTK7...]
Line 62: Line 77:
* [https://forum.freecadweb.org/viewtopic.php?t=28368 Troubles with gmsh in FEM wb (netgen nostalgy)]
* [https://forum.freecadweb.org/viewtopic.php?t=28368 Troubles with gmsh in FEM wb (netgen nostalgy)]


<!--T:33-->
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.
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.


<!--T:34-->
If the program is correctly installed, you may run the command {{incode|netgen}} in the terminal to launch the graphical interface of the program.
If the program is correctly installed, you may run the command {{incode|netgen}} in the terminal to launch the graphical interface of the program.


<!--T:35-->
{{SystemInput|
{{SystemInput|
User@PC:~$ netgen -V}}
User@PC:~$ netgen -V}}


<!--T:36-->
{{Code|code=
{{Code|code=
NETGEN-6.2-dev
NETGEN-6.2-dev
Line 91: Line 110:
== Installing on Linux == <!--T:5-->
== Installing on Linux == <!--T:5-->


<!--T:37-->
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.
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.


=== Ubuntu PPA ===
=== Ubuntu PPA === <!--T:38-->
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 Unix]] for more information on setting up the repositories.
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 Unix]] for more information on setting up the repositories.


<!--T:39-->
If a PPA is already added to your system, install the packages as follows
If a PPA is already added to your system, install the packages as follows
</translate>
</translate>
Line 105: Line 126:
<translate>
<translate>


<!--T:40-->
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 [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.


<!--T:7-->
<!--T:7-->
{{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.
{{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 ===
=== Arch Linux === <!--T:41-->
Get the CalculiX package from the [https://aur.archlinux.org/packages/calculix/ AUR repository].
Get the CalculiX package from the [https://aur.archlinux.org/packages/calculix/ AUR repository].


=== Debian ===
=== Debian === <!--T:42-->
* 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 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 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).
Line 121: Line 143:
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.
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.


<!--T:43-->
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.
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.


<!--T:44-->
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].
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].


<!--T:45-->
Use the command {{incode|ldd}} to see the libraries that are linked by the binary. Install any missing dependency.
Use the command {{incode|ldd}} to see the libraries that are linked by the binary. Install any missing dependency.


<!--T:46-->
{{SystemInput|
{{SystemInput|
User@PC:~$ ldd /usr/bin/ccx
User@PC:~$ ldd /usr/bin/ccx
}}
}}


<!--T:47-->
{{Code|code=
{{Code|code=
linux-vdso.so.1 (0x00007fffbabdc000)
linux-vdso.so.1 (0x00007fffbabdc000)
Line 158: Line 185:
=== Compile CalculiX === <!--T:16-->
=== Compile CalculiX === <!--T:16-->


<!--T:48-->
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.
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.


<!--T:49-->
Compiling CalculiX is a task for experienced users, requiring editing the Makefiles and build options in different platforms. See the following information:
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].
* 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].
Line 167: Line 196:
=== Compile Netgen === <!--T:17-->
=== Compile Netgen === <!--T:17-->


<!--T:50-->
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.
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.


<!--T:51-->
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.
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.


Line 178: Line 209:
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.
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.


<!--T:52-->
The following posts may be outdated:
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=18&t=10979 FEM on Mac OSX, post 1]
Line 184: Line 216:
== Further information == <!--T:18-->
== Further information == <!--T:18-->


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


<!--T:54-->
If you have problems installing Netgen, Gmsh, or CalculiX, or another external tool, please search the forum first:
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=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=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]
* [https://www.google.ch/search?q=sys.append.path+site%3Aforum.freecadweb.org#q=calculix+site:forum.freecadweb.org calculix site:forum.freecadweb.org]

<!--T:12-->
{{FEM Tools navi}}
{{Userdocnavi}}


</translate>
</translate>
{{FEM Tools navi{{#translation:}}}}
{{Userdocnavi{{#translation:}}}}
{{clear}}
{{clear}}

Revision as of 22:35, 22 February 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 Unix 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 OSX

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: