Frequently asked questions

From The FEniCS project

Contents

General

Where is the manual?

There is some documentation in the documentation section. The manuals for UFC, FFC and SyFi are fairly complete and accurate, but the DOLFIN manual is in a sorry state. During its development, DOLFIN has undergone several major changes (improvements) to its interface which has made it challenging to keep the manual updated and accurate. However, as DOLFIN comes closer to a 1.0 release, the interfaces have stabilized considerably with the 0.7.x release series, which improves the forecasts for a manual in the near future.

Until then, DOLFIN is fairly well documented through a large number of demo programs available in both C++ and Python. These can all be found in the directory src/demo in the DOLFIN source tree.

Does it run in parallel?

Yes, almost. The latest release of DOLFIN (0.7.2) adds experimental support for mesh partitioning and parallel assembly. This is still in an experimental state, but you may try it out by running the DOLFIN demo in src/demo/fem/assembly.

Building, installation

I get strange error messages when compiling DOLFIN after pulling an update.

The chance is that the interface has change and you need to regenerate the Python bindings. Automake does not know it needs to rebuild the Python bindings after a header file has changed so you need to do

 touch src/pydolfin/dolfin.i
 make install

This is a bug in the autotools build system (or our application of it) and will be fixed in a future Scons-based build system for DOLFIN.

What are the system requirement for FEniCS?

It has been known to compile and run on most GNU/Linux platforms, Mac OSX and Windows (with Cygwin). The safest and easiest choice (and what most developers of FEniCS use) is Ubuntu GNU/Linux.

Do you provide packages for Debian or Ubuntu?

Yes! But we are currently learning how to build packages properly so you may experience some glitches. Any feedback (positive or negative) on the packages is appreciated. Send comments to deb-dev@fenics.org.

Can I use FEniCS with MS Visual Studio?

Here you can find a short introduction on how to build your code against dolfin and the linear algebra packages uBLAS and UMFPACK using MS Visual Studio 2005.

How should I configure, and build, DOLFIN for optimal performance and which external libraries should I install?

Howtos

How do I compute the difference between two functions (like the error in an approximation)

You need to define a form for the norm of the difference. As an example, to compute the L2 norm of the difference of two functions u_h (approximate solution) and u (exact solution) define the following form:

u_h = Function(element)
u   = Function(element)
e   = u_h - u

M = e*e*dx

Then assemble the value of the functional M (a scalar) and take the square root to obtain the error in the L2 norm.

Other norms, like the H1 norm can be computed similarly:

M = e*e*dx + dot(grad(e), grad(e))*dx

However, it's important to note here that what gets computed is the norm of the difference between the approximate solution and the interpolation of the exact solution into the finite element space. This might not be what you want and you may be fooled when computing convergence rates etc. So to be on the safe side, use a higher order approximation for the exact solution:

k  = <suitable value of k here, say k = 5>
Pk = FiniteElement("Lagrange", shape, k)
u = Function(Pq)

FFC

How can I speed up FFC compilation?

Try compiling the form using quadrature representation e.g.

 ffc -r quadrature foo.form

You can also reduce the number of quadrature points being used for form evaluation e.g.

 ffc -r quadrature -fquadrature_points=2 foo.form

How can I reduce the size of the generated header file?

Use quadrature as described above.

You can also switch off code generation for functions you don't intend to use e.g.

 ffc -fno-evaluate_basis -fno-evaluate_basis_derivatives foo.form

The functions evaluate_basis() and evaluate_basis_derivatives() can be quite large for higher order and mixed elements.

Why can't FFC take the inverse of a sum?

Because FFC assumes that every form can be written as a linear combination of products of basis functions or their derivatives (which is not the case for the inverse of a sum). You may compute the inverse of individual functions/coefficients, which FFC approximates by taking the inverse of the nodal basis expansion coefficients (see the FFC manual for details).

Miscellaneous, offtopic

What is that WikiMedia skin you are using?

It is a hack based on the "Tango" theme from the Tango Desktop Project.

Personal tools