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.

Numerous physics are pre-built :

  • Incompressible Navier-Stokes (using the P1-P2 Taylor Hood element)
  • Lamé equations (linear elasticity)
  • Neo-Hookean, Mooney-Rivlin (nonlinear elasticity)
  • Thermal diffusion
  • Thermal convection
  • Thermal radiation
  • Magnetostatics
  • Electrostatics
  • Fluid-structure interaction (FSI)

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.

Latest Articles

July 03, 2019 | Jian Li, Pengzhan Huang, Jian Su and Zhangxin Chen

A linear, stabilized, non-spatial iterative, partitioned time stepping method for the nonlinear Navier–Stokes/Navier–Stokes interaction model

In this paper, a linear, stabilized, non-spatial iterative, partitioned time stepping method is developed and studied for the nonlinear Navier–Stokes/Navier–Stokes interaction. A backward Euler scheme is utilized for the temporal discretization while a linear Oseen scheme for the trilinear term is used to affect the spatial discretization approximated by the equal order elements. Therefore, we only solve a linear Stokes problem without spatial iterative per time step for each individual domain. Then, the method exploits properties of the Navier–Stokes/Navier–Stokes system to establish the stability and convergence by rigorous analysis. Finally, numerical experiments are presented to show the performance of the proposed method.

July 02, 2019 | Simone Camarri, Giacomo Mengali

Stability properties of the mean flow after a steady symmetry-breaking bifurcation and prediction of the nonlinear saturation

In this paper, it is shown that when a flow undergoes a steady bifurcation breaking one reflection symmetry, the mean flow obtained by averaging the two possible asymmetric flow fields resulting from the instability remains marginally stable in the postcritical regime. This property is demonstrated rigorously through an asymptotic analysis which closely follows that proposed in Sipp and Lebedev (J Fluid Mech 792:620–657, 2007) for a Hopf bifurcation with focus on wakes. In the case of wakes, the marginal stability of the mean flow is well known and had several consequences documented in the literature. To the authors’ knowledge, the marginal stability of mean flows after a symmetry-breaking pitchfork bifurcation is demonstrated here for the first time. As an example of possible consequences of marginal stability, the self-consistent model proposed for wakes in Mantič-Lugo et al. (Phys Rev Lett 113:084501, 2014) and relying on marginal stability is also applied here to the symmetry-breaking instability of the flow in a channel with a sudden expansion. For this specific case, the marginal stability of the mean flow is first demonstrated by dedicated direct numerical simulations; successively, it is shown that the resulting self-consistent model predicts the nonlinear saturation of the instability with remarkable accuracy.

June 11, 2019 | Gonçalo Mendonça, Frederico Afonso, Fernando Lau

Model order reduction in aerodynamics: Review and applications

The need of the aerospace industry, at national or European level, of faster yet reliable computational fluid dynamics models is the main drive for the application of model reduction techniques. This need is linked to the time cost of high-fidelity models, rendering them inefficient for applications like multi-disciplinary optimization. With the goal of testing and applying model reduction to computational fluid dynamics models applicable to lifting surfaces, a bibliographical research covering reduction of nonlinear, dynamic, or steady models was conducted. This established the prevalence of projection and least mean squares methods, which rely on solutions of the original high-fidelity model and their proper orthogonal decomposition to work. Other complementary techniques such as adaptive sampling, greedy sampling, and hybrid models are also presented and discussed. These projection and least mean squares methods are then tested on simple and documented benchmarks to estimate the error and speed-up of the reduced order models thus generated. Dynamic, steady, nonlinear, and multiparametric problems were reduced, with the simplest version of these methods showing the most promise. These methods were later applied to single parameter problems, namely the lid-driven cavity with incompressible Navier–Stokes equations and varying Reynolds number, and the elliptic airfoil at varying angles of attack for compressible Euler flow. An analysis of the performance of these methods is given at the end of this article, highlighting the computational speed-up obtained with these techniques, and the challenges presented by multiparametric problems and problems showing point singularities in their domain.


16-19 DECEMBER 2019

FreeFEM Days - Paris, France

Join us for the FreeFEM Days 2019 edition !

16-20 SEPTEMBER 2019

CIRM - Marseille, France

Workshop - Parallel Solution Methods for Systems Arising from PDEs

03-13 JULY 2019

CIMPA 2019 - Kenitra, Morocco

Scientific calculation in the context of household waste management

19-21 JUNE 2019

Rencontre Mathématiques de Rouen

Introduction to FreeFEM version 4

You are in good company

Sorbonne université INRIA ANR Genci CNRS