Introduction . . Installation . . Getting Started . . An example

INTRODUCTION FreeFEM is an implementation of the Gfem language dedicated to the finite element method. It provides you a way to solve Partial Differential Equations (PDE). Quite complicated problems and systems of equations can be solved also.

Gfem is a language to help you solve Partial Differential Equations in 2 dimensions; it assumes a basic knowledge and understanding of the Finite Element Method and of the Operating System used.

The actual version of FreeFEM is 3.4. It is available at

The home page of FreeFEM is

The FreeFEM team is:

Dominique Bernardi (Paris 6) : developper of the inital version of the language

Frederic Hecht (INRIA) : developper of the mesh generation tools

Manual J. Castro (INRIA/Malyga's universitey) : developper of the mesh adaptation tool

Pascal Parole (Most) : developper of the Windows part

O. Pironneau (Paris 6/INRIA/ASCI) : Leader of the project, Mac programming, Bug tracking, New developments)

C. Prud'homme (LIMSI/ANSI) : X programming, Bug tracking, New developments, Web maintainer and lots of other minor things.

Kohji Ohtsukanew : Windows interface

<go back>

INSTALLATION It is strongly recommended to use the configure script. It is much easier and should be platform independent, you don't have to know anything about your system. Everything is done for you. However one suggests the use of make for the GNU Project: it is the best make utility and will work without problems with freefem. This utility is available at several ftp sites in France or in the USA.

Configure script


    % configure

    % make

    % make install #if you want to install the software on a site

normally everything should compile correctly

The binary freefem will be in the directory src.

We use autoconf and automake in conjunction in order to be as general as possible. These tools are not required to use or compile freeFEM but if you want to change the code you will need these.

Mesh adaptation library

If you want to compile the mesh adaptation library type:

    % configure --with-adapt

    % make

    % make install #if you want to install the software on a site

It will enable the mesh adaptation features in freeFEM. Note that you have to recompile almost everything.

FreeFEM and Gfem

XGfem is a commercial product. You can use FreeFEM and XGfem together. If you want to do it (i.e. so you have purchased XGfem, congratulations) do the following thing:

    % configure --with-gfem

    % make

    % make install #if you want to install the software on a site

Note that it will enable the mesh adaptation library also.


There is an optional flag for configure which enables optimization flags for the compiler:

    % configure --with-optimization

It can be used with the others flags without problems. It guesses the optimization flags according to the compiler.

Without the configure script

edit the makefile.x and make the changes

check and change the name of your C++ compiler

X11 directories for include files and libraries

add -DADAPT if you want to use the adaptation mesh facilities in freefem

add -DDEBUG if you want 'adapt' to be in debugging mode

then type

    % configure

    % make

    % make -f makefile.x

normally everything should compile correctly

I have made the following changes in makefile.x

        CXX = CC

        CXXFLAGS = -O2 -g

        CXXINC = -I./ -I/usr/openwin/include

        CXXLIBS = -L/usr/openwin/lib -lX11 -lm

Attention:  You should omit export

<go back>

GETTING STARTED The examples are in exampl.pde

try for example

        % freefem convhill.pde

To set up your own application:

1. Copy the directory for the application most similar to yours to a new directory.

2. Modify the files as needed. See the descriptions in amrclaw/doc/userfiles.doc for an overview of what each subroutine should do. You may need to modify the Makefile if you add new routines, change names, or copy some library routines into this directory for modification.

<go back>

AN EXAMPLE A very small example of what you can do:

      /* describe the mesh with analytic functions*/



      x:=cos(t); y:=sin(t);


      buildmesh(200); /* let's create the mesh now */

      solve(u) begin /* describe the problem */

      onbdy(1) u =0; /* dirichlet condition */

      pde(u) -laplace(u) = x*y ;


      plot(u); /* plot the solution */

<go back>