For developing and running some topology optimization test cases, you will need to be able to run FreeFEM on your machine. The installation is a bit delicate depending on your configuration. You can either:
use binary packages (the easiest way), in that case follow the instructions on https://doc.freefem.org/introduction/installation.html
compile FreeFEM directly (harder but more flexible, especially on linux). I made an installation script, you can try to use it: here.
sudo dnf install g++ gfortran bison flex gdb cmake autoconf automake m4 freeglut freeglut-devel scotch patch
On Ubuntu:
sudo apt-get install cpp freeglut3-dev g++ gcc gfortran m4 make patch pkg-config wget python unzip libgsl-dev autoconf automake autotools-dev bison flex gdb git cmake
git clone https://gitlab.com/florian.feppon/software-recipes.git
cd software-recipes
sh install_freefem_linux.sh
If you encounter some bugs, I encourage you to try to run the steps of the recipe sequentially to find the problem (maybe some missing dependencies).
~/software
. Add the following lines to your ~/.bashrc
:export SOFTWARE="$HOME/software"
export PATH="$SOFTWARE/bin:$PATH"
You will then need to open a new terminal to be able to run FreeFEM.
Once you have a working FreeFEM installation, you can check it by running
$ FreeFem++
FreeFem++ - version 4.1 (Tue 22 Feb 2022 10:08:09 AM CET - git v4.10) 64bits
License: LGPL 3+ (https://www.gnu.org/licenses/lgpl-3.0.en.html)
Usage: FreeFem++ [FreeFEM arguments] filename [script arguments]
FreeFEM arguments:
-f: [filename] script file name
-v: [verbosity] level of FreeFEM output (0 - 1000000)
-nw: no graphics
-wg: with graphics
-ne: no edp script output
-cd: change directory to script directory
-cdtmp: change directory to /tmp
-jc: just compile
-ns: same as -ne
-nowait: do not wait graphics at the end
-nc: without console (MS Windows only)
-log: with console (MS Windows only)
-wait: wait graphics at the end
-fglut: [filename] redirect graphics in file
-glut: [command] use custom glut
-gff: [command] use custom glut (with space quoting)
-check_plugin [filename] just try if the plugin is correct
-?: show help
with default ffglut: ffglut
FreeFEM website: https://freefem.org/
FreeFEM documentation: https://doc.freefem.org/
FreeFEM forum: https://community.freefem.org/
FreeFEM modules: https://modules.freefem.org/
Please cite us in your research papers and add a link to FreeFEM on your personal website
@article{FreeFEM,
AUTHOR = {Hecht, F.},
TITLE = {New development in FreeFem++},
JOURNAL = {J. Numer. Math.},
FJOURNAL = {Journal of Numerical Mathematics},
VOLUME = {20}, YEAR = {2012},
NUMBER = {3-4}, PAGES = {251--265},
ISSN = {1570-2820},
MRCLASS = {65Y15},
MRNUMBER = {3043640},
URL = {https://freefem.org/}
}
I then recommand the installation of a syntax coloring for your preferred editor, check the pages