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

August 05, 2019 | Houédanou Koffi Wilfrid

A new unified stabilized mixed finite element method of the Stokes-Darcy coupled problem: Isotropic discretization

In this paper we develop an a priori error analysis of a new unified mixed finite element method for the coupling of fluid flow with porous media flow in ℝN, N∈{2,3} on isotropic meshes. Flows are governed by the Stokes and Darcy equations, respectively, and the corresponding transmission conditions are given by mass conservation, balance of normal forces, and the Beavers-Joseph-Saffman law. The approach utilizes a modification of the Darcy problem which allows us to apply a variant nonconforming Crouzeix-Raviart finite element to the whole coupled Stokes-Darcy problem. The well-posedness of the finite element scheme and its convergence analysis are derived. Finally, the numerical experiments are presented, which confirm the excellent stability and accuracy of our method.

July 30, 2019 | J. R. Sauer, C. Rodriguez-Quijada, J. Cohen, M. Kalashnikov, J. Campbell, A. K. Boardman, K. Vossough, H. Wirz, F. Hecht, and A. F. Sauer-Budge

Finite Element Simulation, Fabrication and Characterization of Vertical Field Effect Transistors in Narrowing Nanopores for Biomolecule Detection

To enable the high-throughput study of single molecules in solution phase, we have been developing a semiconductor nanopore sensor array for biomolecule analysis. Our silicon-based nanopores have embedded vertical field effect transistors (FETs) in the walls of an inverted pyramidal nanopore (npFETs). This geometry was chosen in part because etching allows small pore exit dimensions with length tolerances largely controlled by the surface etch mask while epitaxial growth enables well-defined field effect transistor axial dimensions. This design is fundamentally different from other nanopore detection schemes, which measure current flowing through or across an occupied pore. Other FET detection methods require the adsorption of analytes onto coated surfaces to measure binding, whereas our sensors are designed to respond to the charges present on a passing protein. Molecules are moved through the pore by electro-osmosis force (EOF). Biomolecule analysis is performed as the variations in the charge structure of molecules passing near the FET gate regions cause detectable variations in source-drain current that can be used to characterize the passing molecule. This is possible because the EOF partially descreens the molecules, permitting sensing from distances greater than several Debye lengths. We undertook simulation efforts to better understand the potential of this nanopore design. The finite element simultaneous solution of the Poisson-Nernst-Plank ion transport and Navier-Stokes fluid flow equations was achieved by alternating between iterative Newton solutions until quantities common to both sets of equations were consistent. According to our simulations, the flow dynamics through the pore's constricting geometry force biomolecules of both charges close enough to the sensor surface for detection. In this paper, we present a finite element simulation of narrowing nanopores, the fabrication of such nanopore arrays, and electrical characterization of the embedded npFETs. This work lays the foundation for the future study of individual protein measurements.

July 23, 2019 | Samuele Rubino

Numerical analysis of a projection-based stabilized POD-ROM for incompressible flows

In this paper, we propose a new stabilized projection-based POD-ROM for the numerical simulation of incompressible flows. The new method draws inspiration from successful numerical stabilization techniques used in the context of Finite Element (FE) methods, such as Local Projection Stabilization (LPS). In particular, the new LPS-ROM is a velocity-pressure ROM that uses pressure modes as well to compute the reduced order pressure, needed for instance in the computation of relevant quantities, such as drag and lift forces on bodies in the flow. The new LPS-ROM circumvents the standard discrete inf-sup condition for the POD velocity-pressure spaces, whose fulfillment can be rather expensive in realistic applications in Computational Fluid Dynamics (CFD). Also, the velocity modes does not have to be neither strongly nor weakly divergence-free, which allows to use snapshots generated for instance with penalty or projection-based stabilized methods. The numerical analysis of the fully Navier-Stokes discretization for the new LPS-ROM is presented, by mainly deriving the corresponding error estimates. Numerical studies are performed to discuss the accuracy and performance of the new LPS-ROM on a two-dimensional laminar unsteady flow past a circular obstacle.


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