FEM Install: Difference between revisions
(GMSH in lowercase; search the forum for gmsh) |
(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) |
||
Line 2: | Line 2: | ||
<translate> |
<translate> |
||
== Introduction == <!--T:1--> |
== Introduction == <!--T:1--> |
||
To be able to perform finite element analysis (FEA) |
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. |
||
=== FEM solver === <!--T:2--> |
=== FEM solver === <!--T:2--> |
||
The default solver to perform |
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'''. |
||
If the solver is correctly installed, you may run the single command {{incode|ccx}} in the terminal |
If the solver is correctly installed, you may run the single command {{incode|ccx}} in the terminal to obtain a simple response: |
||
{{SystemInput| |
{{SystemInput| |
||
User@PC:~$ ccx}} |
User@PC:~$ ccx}} |
||
{{Code|code= |
|||
{{SystemOutput| |
|||
Usage: CalculiX.exe -i jobname |
Usage: CalculiX.exe -i jobname |
||
}} |
}} |
||
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]]. |
|||
=== FEM mesh generator === <!--T:3--> |
=== FEM mesh generator === <!--T:3--> |
||
In order to create a [[FEM Mesh]], FreeCAD uses [ |
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. |
||
⚫ | |||
{{SystemInput| |
|||
User@PC:~$ gmsh -info}} |
|||
{{Code|code= |
|||
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 {{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. |
|||
{{Message|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 version 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 OCCT 7.1, so it was decided to drop Netgen support in the [[FEM Workbench]]. 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)] |
|||
== Installing on Windows == <!--T:4--> |
== Installing on Windows == <!--T:4--> |
Revision as of 01:17, 6 April 2019
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.
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.
In previous version 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 OCCT 7.1, so it was decided to drop Netgen support in the FEM Workbench. 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:
- (Ubuntu Daily PPA) Transitioning to OCCT7, VTK7...
- Ubuntu Daily Builds PPA now using OCC 7.1.0
- patching Netgen 5.3.1 to work with OCCT 7.1
- Troubles with gmsh in FEM wb (netgen nostalgy)
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 collect software in their own repositories. Look for netgen
, gmsh
, and calculix-ccx
or ccx
in your package manager.
Ubuntu PPA
The freecad-stable and freecad-daily personal package archives (PPA) provide a more recent version of FreeCAD than is available in the 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 the 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 will be migrated to the daily or stable builds.
For developers: 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 package from the repository.
Debian
- Debian 9 Buster: the packages in the repository are outdated, but you can use the packages from the Ubuntu PPA (
freecad-community
). See Gmsh 4 package available for testing in Community Extras PPA. - Debian 8 Stretch: the packages in the repository are outdated, but you can use the packages from the Ubuntu PPA (
freecad-community
). See Gmsh 4 package available for testing in Community Extras PPA. - Debian 7 Jessie: install the packages from Debian 8 Stretch using
dpkg
. See Debian source package for Calculix.
CalculiX binary
The CalculiX authors provide a pre-compiled generic Linux binary. It can be downloaded from the authors' website.
Since different Linux distributions have different library paths, most likely this binary will not work out of the box 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 it is linked against the proper libraries (libgfortran
, liblapack
, libblas
, etc.) as mentioned in the thread FEM WB.
Compile CalculiX
Since CalculiX is a standalone application, you either install a CalculiX binary or compile it yourself. Any CalculiX version from 2.7.x onwards works with FreeCAD. Since the code hasn't changed much, lower versions than 2.7.x might work as well.
Compiling CalculiX has proved problematic, requiring editing the Makefiles and build options in different platforms. See the following information:
- Debian: Debian source package for Calculix, Gmsh 4 package available for testing in Community Extras PPA, Compiling CalculiX ccx on fedora, ubuntu and debian.
- Fedora 27, 28, 29: Compiling CalculiX ccx on fedora, ubuntu and debian.
- There is a Cmake version of the source package on github, but at FreeCAD forums no one has reported if this package works.
Netgen
There have been mixed results with the Netgen mesher and compiling FreeCAD with Netgen support.
- ToDo
Installing on OSX
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:
- Materials: Solid, Fluid, Nonlinear mechanical, Reinforced (concrete); Material editor
- Element geometry: Beam (1D), Beam rotation (1D), Shell (2D), Fluid flow (1D)
Constraints
- Electromagnetic: Electrostatic potential, Current density, Magnetization
- Geometrical: Plane rotation, Section print, Transform
- Mechanical: Fixed, Displacement, Contact, Tie, Spring, Force, Pressure, Centrif, Self weight
- Thermal: Initial temperature, Heat flux, Temperature, Body heat source
- Overwrite Constants: Constant vacuum permittivity
- Solve: CalculiX Standard, Elmer, Mystran, Z88; Equations: Deformation, Elasticity, Electrostatic, Electricforce, Magnetodynamic, Magnetodynamic 2D, Flow, Flux, Heat; Solver: Solver control, Solver run
- Results: Purge, Show; Postprocessing: Apply changes, Pipeline from result, Warp filter, Scalar clip filter, Function cut filter, Region clip filter, Contours filter, Line clip filter, Stress linearization plot, Data at point clip filter, Filter function plane, Filter function sphere, Filter function cylinder, Filter function box
- Additional: Preferences; FEM Install, FEM Mesh, FEM Solver, FEM CalculiX, FEM Concrete; FEM Element Types
- Getting started
- Installation: Download, Windows, Linux, Mac, Additional components, Docker, AppImage, Ubuntu Snap
- Basics: About FreeCAD, Interface, Mouse navigation, Selection methods, Object name, Preferences, Workbenches, Document structure, Properties, Help FreeCAD, Donate
- Help: Tutorials, Video tutorials
- Workbenches: Std Base, Arch, Assembly, CAM, Draft, FEM, Inspection, Mesh, OpenSCAD, Part, PartDesign, Points, Reverse Engineering, Robot, Sketcher, Spreadsheet, Start, Surface, TechDraw, Test Framework, Web
- Hubs: User hub, Power users hub, Developer hub