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

With Qarnot's HPC platform, 7 lines of python code is all you need to run a FreeFEM simulation in the cloud. Learn how to run FreeFEM with Qarnot's sustainable HPC platform on Qarnot's blog.

FreeFEM is also available on Rescale's ScaleX® Pro. Rescale offers academic users up to 500 core hours on their HPC cloud.

Latest Articles

November 02, 2020 | Luis Benetti Ramos, Olivier Marquet, Michel Bergmann, Angelo Iollo

Fluid-solid Floquet stability analysis of self-propelled heaving foils

We investigate the role of linear mechanisms in the emergence of nonlinear horizontal self-propelled states of a heaving foil in a quiescent fluid. Two states are analyzed: a periodic state of unidirectional motion and a quasi-periodic state of slow back & forth motion around a mean horizontal position. The states emergence is explained through a fluid-solid Floquet stability analysis of the non-propulsive symmetric base solution. Unlike a purely-hydrodynamic analysis, our analysis accurately determine the locomotion states onset. An unstable synchronous mode is found when the unidirectional propulsive solution is observed. The obtained mode has a propulsive character, featuring a mean horizontal velocity and an asymmetric flow that generates a horizontal force accelerating the foil. An unstable asynchronous mode, also featuring flow asymmetry and a non-zero velocity, is found when the back & forth state is observed. Its associated complex multiplier introduces a slow modulation of the flapping period, agreeing with the quasi-periodic nature of the back & forth regime. The temporal evolution of this perturbation shows how the horizontal force exerted by the flow is alternatively propulsive or resistive over a slow period. For both modes, an analysis of the velocity and force perturbation time-averaged over the flapping period is used to establish physical instability criteria. The behaviour for large solid-to-fluid density ratio of the modes is thus analyzed. The asynchronous fluid-solid mode converges towards the purely-hydrodynamic one, whereas the synchronous mode becomes marginally unstable in our analysis not converging to the purely-hydrodynamic analysis where it is never destabilised.

November 01, 2020 | Jun Kuroda, Yasuhiro Oikawa

Parametric speaker consisting of small number of transducers with sonic crystal waveguide

In this paper, we discuss methods of designing parametric speakers consisting of a small number of transducers. The developed parametric speaker unit includes peripheral acoustic structures, such as radial cones and a waveguide comprising a sonic crystal. The purpose of this study is to fabricate small parametric speakers that can be installed in various equipment. To achieve this purpose, it is essential to minimize the sizes and numbers of transducers. Parametric speakers must fulfill two goals: (1) high sound pressure levels of ultrasonic waves and (2) narrow directivities of ultrasonic waves. These two design goals are accomplished by two measures: (1) two close resonant frequencies and resonant mode control function and (2) an external adapter to obtain narrow directivities and high sound pressure. The first measure was achieved equipping the piezoelectric transducer with double-linked diaphragms and two radial cones. The second measure was embodied by the waveguide consisting of a sonic crystal, which was named the loop horn in this paper. Details of the design and experimental data of a four-transducer parametric speaker unit including the loop horn were presented.

October 30, 2020 | Vladimir Ivchenko

Beyond the model of conductor with fixed cross-section and length: Exactly and numerically solvable problems

In this paper we present an overview of methods of resistance finding for the conductor with variable cross-section or (and) length. First, we consider the cases of the finite size resistors and an infinite homogeneous weakly conducting medium with two electrodes. Next, we continue the Romano and Price analysis about the truncated cone problem by means of comprehensive numerical calculations done for the trapezoid plates. We conclude that in general case of a conductor with variable cross-section the homogeneous electric field approximation gives only the lower limit estimation for the resistance value. This fact can be explained on the basis of the minimum electric power principle. The issues outlined in this article will be useful for advanced undergraduates, who study methods for solving electrostatic problems.Keywords: problem solving, electrical resistance, trapezoid plate problem.



JSIAM 2020

FreeFEM tutorial: Fluid-Structure interaction problem in a monolithic form and its implementation are shown.
Zoom webinar, Japan

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

You are in good company

Sorbonne université INRIA ANR Genci CNRS