load "msh3"

// Parameters
int nn = 20; // Mesh quality

// Mesh
int[int] labs = [1, 2, 2, 1, 1, 2]; // Label numbering
mesh3 Th = cube(nn, nn, nn, label=labs);
// Remove the ]0.5,1[^3 domain of the cube
Th = trunc(Th, (x < 0.5) | (y < 0.5) | (z < 0.5), label=1);

// Fespace
fespace Vh(Th, P1);
Vh u, v;

// Macro
macro Grad(u) [dx(u), dy(u), dz(u)] //

// Define the weak form and solve
solve Poisson(u, v, solver=CG)
    = int3d(Th)(
          Grad(u)' * Grad(v)
          1 * v
    + on(1, u=0)

// Plot
plot(u, nbiso=15);

A high level multiphysics finite element software

FreeFEM offers a fast interpolation algorithm and a language for the manipulation of data on multiple meshes.

Easy to use PDE solver

FreeFEM is a popular 2D and 3D partial differential equations (PDE) solver used by thousands of researchers across the world.

It allows you to easily implement your own physics modules using the provided FreeFEM language. FreeFEM offers a large list of finite elements, like the Lagrange, Taylor-Hood, etc., usable in the continuous and discontinuous Galerkin method framework.

Pre-built physics

Strong mesh and parallel capabilities

FreeFEM has it own internal mesher, called BAMG, and is compatible with the best open-source mesh and visualization software like Tetgen, Gmsh, Mmg and ParaView.

Written in C++ to optimize for speed, FreeFEM is interfaced with the popular mumps, PETSc and HPDDM solvers.

HPC in the cloud integration

7 lines of python code and a Qarnot Computing Logo account is all you need to run a FreeFEM simulation in the cloud.

Thanks to a partnership with Qarnot's advanced HPC platform, you won't have to worry about deploying FreeFEM on the cloud, everything is automated.

Learn how to run FreeFEM with Qarnot's sustainable HPC platform on Qarnot's blog.

Latest Articles

December 13, 2019 | Lèye Babacar, Tine Léon Matar, Sy Mamadou

Optimal Control of Thermal Pollution Emitted by Power Plants

The coastal areas near thermal or nuclear plants are subject to hot water discharges produced by cooling processes. These activities induce an increase of the temperature near the outlet vicinity, which can extend for miles. The temperature variation affects the metabolic rate of organisms and the level of dissolved oxygen. Cooling by cold water from an additional discharge can be considered in order to limit this thermal pollution. This paper present a methodology based on the implementation of a two-dimensional numerical model to study the dynamic of the temperature originated from the industrial discharges. Moreover the optimal injection rate of cold water is sought to keep the water temperature as close as possible to the survival of the ecosystem. Numerical simulations are performed to illustrate the efficiency approach.

December 12, 2019 | Niall Bootland, Victorita Dolean

On the Dirichlet-to-Neumann coarse space for solving the Helmholtz problem using domain decomposition

We examine the use of the Dirichlet-to-Neumann coarse space within an additive Schwarz method to solve the Helmholtz equation in 2D. In particular, we focus on the selection of how many eigenfunctions should go into the coarse space. We find that wave number independent convergence of a preconditioned iterative method can be achieved in certain special cases with an appropriate and novel choice of threshold in the selection criteria. However, this property is lost in a more general setting, including the heterogeneous problem. Nonetheless, the approach converges in a small number of iterations for the homogeneous problem even for relatively large wave numbers and is robust to the number of subdomains used.

December 11, 2019 | Ryadh Haferssas, Pierre-Henri Tournier, Frédéric Nataf, Stéphane Cotin

Simulation of soft tissue deformation in real-time using domain decomposition

Non-linear models used in dynamic simulations usually re- quire the solution of multiple large and sparse linear systems in a succes- sive manner. In this paper, we conduct a study of numerical solvers in the framework of real-time soft tissue deformation. Domain Decomposition paradigm has the potential of providing parallelism at both levels of equa- tion assembling and linear system solving. In our case domain decompo- sition is employed to solve a non-linear model in a dynamic simulation in order to meet real-time computation by using parallel architecture. Nu- merical test on liver deformations using a non-linear deformation model is presented to evaluate the acceleration impact of the domain decompo- sition paradigm. Performances tests clearly show the efficiency of using a domain decomposition approach for real-time feedback.


11-13 MAY 2020


Des outils libres et puissants de prototypage pour la simulation multiphysique avec freefem++!
Paris, France

17-19 DECEMBER 2019

FreeFEM Days

Join us for the FreeFEM Days 2019 edition !
Paris, France

16-20 SEPTEMBER 2019


Workshop - Parallel Solution Methods for Systems Arising from PDE!
Marseille, France

You are in good company

Sorbonne université INRIA ANR Genci CNRS