CFDFlow

Computational fluid dynamics News

FreeFEM

FreeFEM is a partial differential equation solver for non-linear multi-physics systems in 2D and 3D using the finite element method. Problems involving partial differential equations from several branches of physics such as fluid-structure interactions require interpolations of data on several meshes and their manipulation within one program. FreeFEM includes a fast interpolation algorithm and a language for the manipulation of data on multiple meshes. It is written in C++ and the FreeFEM language is a C++ idiom.

The project has evolved from MacFem, PCfem, written in Pascal. The first C version lead to freefem 3.4; it offered mesh adaptivity on a single mesh only.
https://freefem.org/

A thorough rewriting in C++ led to freefem+ (freefem+ 1.2.10 was its last release), which included interpolation over multiple meshes (functions defined on one mesh can be used on any other mesh); this software is no longer maintained but is still in use because it handles a problem description using the strong form of the PDEs. Implementing the interpolation from one unstructured mesh to another was not easy because it had to be fast and non-diffusive; for each point, one had to find the containing triangle. This is one of the basic problems of computational geometry (see [PREPARATA1985] for example). Doing it in a minimum number of operations was the challenge. Our implementation is O(nlogn)) and based on a quadtree. This version also grew out of hand because of the evolution of the template syntax in C++.

We have been working for a few years now on FreeFEM , entirely re-written again in C++ with a thorough usage of template and generic programming for coupled systems of unknown size at compile time. Like all versions of freefem, it has a high level user friendly input language which is not too far from the mathematical writing of the problems.

The freefem language allows for a quick specification of any partial differential system of equations. The language syntax of FreeFEM is the result of a new design which makes use of the STL [STROUSTRUP2000], templates, and bison for its implementation; more details can be found in [HECHT2002]. The outcome is a versatile software in which any new finite elements can be included in a few hours; but a recompilation is then necessary. Therefore the library of finite elements available in FreeFEM will grow with the version number and with the number of users who program more new elements. So far we have discontinuous P0 elements,linear P1 and quadratic P2 Lagrangian elements, discontinuous P1 and Raviart-Thomas elements and a few others like bubble elements.

FreeFEM is a software to solve these equations numerically, based on the Finite Element Method. As its name implies, it is a free software (see the copyrights for full detail) it is not a package, it is an integrated product with its own high level programming language, referred below as a :index freefem script. This software runs on all UNIX OS (with g++ 3.3 or later, and OpenGL), on Window XP, Vista and 7, 8, 10 and 11 and on MacOS 10 intel and arm.

Moreover FreeFEM is highly adaptive. Many phenomena involve several coupled systems, such as: Fluid-structure interactions, Lorentz forces for aluminum casting and ocean-atmosphere problems, etc. These require different finite element approximations and polynomial degrees, possibly on different meshes. Some algorithms like the Schwarz’ domain decomposition method also requires data interpolation on multiple meshes within one program. FreeFEM can handle these difficulties, i.e. arbitrary finite element spaces on arbitrary unstructured and adapted bi and three dimensional meshes.

The characteristics of FreeFEM are:

  • Problem description (real or complex valued) by their variational formulations, with access to the internal vectors and matrices if needed.
  • Multi-variables, multi-equations, bi and three-dimensional static or time dependent, linear or nonlinear coupled systems; however the user is required to describe the iterative procedures which reduce the problem to a set of linear problems.
  • Easy geometric input by analytic description of boundaries by pieces; however this part is not a CAD system; for instance when two boundaries intersect, the user must specify the intersection points.
  • Automatic mesh generator, based on the Delaunay-Voronoi algorithm; the inner point density is proportional to the density of points on the boundaries [GEORGE1996].
  • Metric-based anisotropic mesh adaptation. The metric can be computed automatically from the Hessian of any FreeFEM function [HECHT1998].
  • High level user friendly typed input language with an algebra of analytic and finite element functions.
  • Multiple finite element meshes within one application with automatic interpolation of data on different meshes and possible storage of the interpolation matrices.
  • A large variety of triangular finite elements: linear, quadratic Lagrangian elements and more, discontinuous P1 and Raviart-Thomas elements, elements of a non-scalar type, the mini-element,… (but no quadrangles).
  • Tools to define discontinuous Galerkin finite element formulations P0, P1dc, P2dc and keywords: jump, mean, intalledges.
  • A large variety of linear direct and iterative solvers (LU, Cholesky, Crout, CG, GMRES, UMFPACK, MUMPS, SuperLU, …) and eigenvalue and eigenvector solvers (ARPARK) .
  • Near optimal execution speed (compared with compiled C++ implementations programmed directly).
  • Online graphics, generation of ,.txt,.eps,.gnu, mesh files for further manipulations of input and output data.
  • Many examples and tutorials: elliptic, parabolic and hyperbolic problems, Navier-Stokes flows, elasticity, fluid structure interactions, Schwarz’s domain decomposition method, eigenvalue problem, residual error indicator, …
  • A parallel version using MPI

Updated: 19 January 2024 — 16:11

Leave a Reply

Your email address will not be published. Required fields are marked *

CFDFlow © 2015 Frontier Theme