Getting Started With Fenics 1. Fenics Overview
Getting Started With Fenics 1. Fenics Overview
1. FEniCS overview
FEniCS is a powerful, open-source suite of tools for automated solution of PDEs using finite elements.
Part of the power for FEniCS is the ease with which one can create FE solvers by describing PDEs
using weak forms in nearly-mathematical notation. The FEniCS software, in addition to extensive
documentation and examples, can be found at the FEniCS Project website, http://fenicsproject.
org/.
FEniCS includes a number of powerful features, which are described at http://fenicsproject.
org/about/features.html. These include:
• Automated solution of variational problems
• Automated error control and adaptivity
• An extensive library of finite elements
• High performance linear algebra through backends to such libraries as PETSc and Trilinos.
• Visualization via a simple interactive plotting function, as well as output in VTK format
• FEniCS can be used from both Python and C++
• Extensive documentation
2. FEniCS resources
• Quick Programmer’s References. Some of the classes and functions in DOLFIN are
more frequently used than others. The Python implementations are described in http://
fenicsproject.org/documentation/dolfin/1.5.0/python/quick_reference.html. See
also http://fenicsproject.org/documentation/dolfin/1.5.0/python/genindex.html
for the Complete Programmer’s References.
• Getting Help. See: http://fenicsproject.org/support/
Other resources, although a little outdated and not fully compatible with the latest versions of
FEniCS, include
• FEniCS Tutorial: This is the best starting point; it describes the Python interface to FEniCS:
http://fenicsproject.org/documentation/tutorial/index.html
The tutorial is also available as a PDF document:
http://fenicsproject.org/_static/tutorial/fenics_tutorial_1.0.pdf
All of the Python codes described in the tutorial can be downloaded as a tarball from:
http://fenicsproject.org/_static/tutorial/fenics_tutorial_examples.tar.gz
• The FEniCS Book: All 732 pages of the FEniCS book (Automated Solution of Differential
Equations by the Finite Element Method) can be downloaded (legally!) from here:
http://launchpad.net/fenics-book/trunk/final/+download/fenics-book-2011-10-27-final.
pdf
This is the comprehensive reference to FEniCS, along with many examples of the applications of
FEniCS to problems in science and engineering. You will notice that the first chapter of the book
is just the FEniCS Tutorial (with some minor editorial differences).
• The FEniCS Manual. This is a 200-page excerpt from the FEniCS Book, including the FEniCS
Tutorial, an introduction to the finite element method, and documentation of DOLFIN and UFL:
http://launchpad.net/fenics-book/trunk/final/+download/fenics-manual-2011-10-31.
pdf
Since it’s an excerpt from the FEniCS Book, you probably won’t need it.
3. Installing FEniCS
All of the Python codes for the examples and supporting materials for the exercises in this course
require FEniCS version 1.5.0. Previous versions of FEniCS are not supported, and minor modifications
are required to run the materials using FEniCS 1.6.0. The following steps will get you up and running
with FEniCS on your system.
module purge
module load sl6 gcc/4.8 python cmake mpich2/1.4.1p1 mkl vtk petsc fenics
Note: you will have to run the above commands each time you open a new shell. If you
would like to run FEniCS without having to type these commands each time you open a new
shell, you can add the commands in your default shell profile (e.g. .bashrc if your default shell
is bash).
WARNING: The ICES Linux Desktop does not support ipython notebooks at this time.
We have sent a support request to Sysnet to address this issue.
FEniCS demo programs are located under
/usr/share/dolfin/demo/
You should copy this folder to your home directory if you wish to run any of the examples.
• Any other OSes, including Windows, MacOS 10.11, and other Linux distributions:
You can download a Linux virtual machine running Ubuntu 14.04 and FEniCS 1.5 from
http://users.ices.utexas.edu/~uvilla/hippylib.ova
(Warning: this file is 3.1GB!) To run the virtual machine you should use VirtualBox from here:
https://www.virtualbox.org/wiki/Downloads
Instructions on how to import and run the virtual machine can be found at:
https://docs.oracle.com/cd/E26217_01/E26796/html/qs-import-vm.html
The username and password for the virtual machine are both hippylib.
To check the FEniCS installation on your system, go to the demo folder (see above for the exact location
of this folder in your system) and run demo poisson.py by typing the following at the command lines:
cd documented/poisson/python/
python demo poisson.py
4. Additional help
If you have questions regarding FEniCS or have problems running with the FEniCS examples provided
in this class, please feel free to contact Umberto Villa ([email protected]).