Fenics

From ScientificComputing
Jump to: navigation, search

Category

Differential equations, Finite elements

Description

FEniCS is a project for the development of concepts and tools for automated scientific computing, with a focus on automated solution of differential equations by finite element methods. It has a list of features for automated, efficient solution of differential equations, including automated solution of variational problems, automated error control and adaptivity, a comprehensive library of finite elements, high performance linear algebra and many more. FEniCS is organized as a collection of interoperable components that together form the FEniCS Project. These components include the problem-solving environment DOLFIN, the form compiler FFC, the finite element tabulator FIAT, the just-in-time compiler Instant, the code generation interface UFC, the form language UFL and a range of additional components.

Available versions

Legacy versions Supported versions New versions
1.6.0

Environment modules

Version Module load command Additional modules loaded automatically
1.6.0 module load new gcc/4.8.2 open_mpi/1.6.5 boost/1.59.0_py2.7.9 mpfr/3.1.2_gmp6 qt/4.8.4 netcdf/4.3.2 eigen/3.2.1 swig/3.0.5 suitesparse/4.4.4 fenics/1.6.0 openblas/0.2.13_seq python/2.7.9 szip/2.1 hdf5/1.8.12 gmp/6.0.0a

How to submit a job

You can submit a Python FEniCS job with the following command.
bsub [LSF options] python my_fenics_python_script.py
Here you need to replace [LSF options] with LSF parameters for the resource requirements of the job. Please find a documentation about the parameters of bsub on the wiki page about the batch system.

Example

As an example for using fenics, we are running a script that solves a differential equation:
[leonhard@euler01 ~]$ module load new gcc/4.8.2 open_mpi/1.6.5 boost/1.59.0_py2.7.9 mpfr/3.1.2_gmp6 qt/4.8.4 netcdf/4.3.2 eigen/3.2.1 swig/3.0.5 suitesparse/4.4.4 fenics/1.6.0
[leonhard@euler01 ~]$ ls -ltr
total 4
-rwxr-xr-x 1 leonhard T0000 219 Sep 14 08:20 test.py
[leonhard@euler01 ~]$ cat test.py
#!/usr/bin/env python

from dolfin import *
mesh = UnitSquareMesh(10, 10)
V = FunctionSpace(mesh, 'CG', 1)
f = Function(V)
u, v = TrialFunction(V), TestFunction(V)
a = u*v*dx
L = f*v*dx
u = Function(V)
solve(a == L, u)
[leonhard@euler01 ~]$ bsub -n 1 -W 4:00 -R "rusage[mem=2048]" python ./test.py
Generic job.
Job <27435524> is submitted to queue <normal.4h>.
[leonhard@euler01 ~]$ bjobs
JOBID      USER        STAT  QUEUE      FROM_HOST   EXEC_HOST   JOB_NAME   SUBMIT_TIME
27435524   leonhard    PEND  normal.4h  euler01                 *./test.py Sep 14 08:51
[leonhard@euler01 ~]$ bjobs
JOBID      USER        STAT  QUEUE      FROM_HOST   EXEC_HOST   JOB_NAME   SUBMIT_TIME
27435524   leonhard    RUN   normal.4h  euler01     e1448       *./test.py Sep 14 08:51
[leonhard@euler01 ~]$ bjobs
No unfinished job found
[leonhard@euler01 ~]$ ls -ltr
total 8
-rwxr-xr-x 1 leonhard T0000  219 Sep 14 08:20 test.py
-rw-r--r-- 1 leonhard T0000 1127 Sep 14 08:53 lsf.o27435524
The resource usage summary as well as the job logs can be found in the LSF log file lsf.o27435524.

License information

All FEniCS core components are licensed under the GNU LGPL as published by the Free Software Foundation, either version 3 of the license, or (at your option) any later version. All other FEniCS components are licensed under either the GNU GPL or the GNU LGPL, either version 3 of the license, or (at your option) any later version. Authors and institutions have given their consent to licensing under these terms.

Links

https://fenicsproject.org/

http://hplgit.github.io/fenics-tutorial/doc/pub/ftut.html