
This document is under active development and discussion!
If you find errors or omissions in this document, please don’t hesitate to submit an issue or open a pull request with a fix. We also encourage you to ask questions and discuss any aspects of the project on the Feel++ Gitter forum. New contributors are always welcome! |
This book is available on Github.
Slack (recommended) and Gitter are used to announce and discuss book modifications. Don’t hesitate to participate to the discussions
This book is the result of many contributions and in particular from:
Alexandre Ancel |
|
Denis Barbier |
|
Guillaume Dollé |
|
Vincent Huber |
|
Christophe Prud’homme [Leader] |
|
Ranine Tarabay |
|
Jean-Baptiste Wahl |
Feel++ is Copyright © 2010-2017 by Feel++ Consortium
Feel++ is Copyright © 2005-2015 by
Université Joseph Fourier (Grenoble, France)
University of Coimbra (Portugal)
Feel++ is Copyright © 2011-2015 by
Université de Strasbourg (France)
Feel++ is Copyright © 2011-2015 by CNRS (France)
Feel++ is Copyright © 2005-2006 by Ecole Polytechnique Fédérale de Lausanne (EPFL, Switzerland)
Feel++ was originaly created by Christophe Prud’homme, Professor of Mathematics and evolves fastly thanks to many developers and contributors. An up to date list of persons who contributes to Feel++ is available on GitHub website. To know who we are and what we do, rendez-vous at www.feelpp.org/team and www.cemosis.fr/team.
Christophe Prud’homme [Leader] |
|
Vincent Chabannes [Leader] |
|
Guillaume Dollé |
|
Romain Hild |
|
Mourad Ismail |
|
Pierre Jolivet |
|
Thibault Metivet |
|
Christophe Trophime |
|
Jean-Baptiste Wahl |
Abdoulaye Samake |
(former Phd student at U. Joseph Fourier, currently at NERSC in Norway) |
Stéphane Veys |
(former Phd student at U. Joseph Fourier, currently at CEA in France) |
Goncalo Pena |
(formerly at EPFL, currently at U. Coimbra in Portugal) |
Benjamn Stamm |
(formerly at EPFL, currently at UPMC in France) |
Gilles Steiner |
(formerly at EPFL) |
Christoph Winkelmann |
(formerly at EPFL) |
Ranine Tarabay |
|
Cecile Daversin |
|
Vincent Huber |
|
Alexandre Ancel |
|
Vincent Doyeux |
Feel++ benefits from the many discussions and close research collaborations with the following persons:
Zakaria Belhachmi |
|
Silvia Bertoluzza |
|
Micol Pennacchio |
|
Marcela Szopos |
Finally Feel++ also benefits from discussions within collaborative projects with many people (in no particular order):
Yannick Hoarau, Philippe Gilotte, Benjamin Surowiec, Romain Hild, Marion Spreng, Benjamin Vanthong, Thomas Lantz, Mamadou Camara, Camille Boulard, Pierre Gerhard, Frédéric Hecht, Michel Fouquembergh, Denis Barbier, Jean-Marc Gratien, Daniele Di Pietro.
Feel++ was initially developed at École Polytechnique Fédérale de Lausanne(Suisse) and is now a joint effort between Université de Strasbourg, Université Joseph Fourier (Grenoble), University of Coimbra (Portugal), CNRS and Cemosis.
Feel++ is supported by:
H2020 |
|
ANR |
* VIVABRAIN (MN call - 2013-2017) * CHORUS (MN call - 2013-2017) |
PRACE |
* HP-FEEL++ 2015-2016 * LABEX IRMIA |
ANR |
* HAMM - (Cosinus call - 2010-2014) * OPUS - (TLOG call - 2008-2011) |
IDEX |
* Funding for Cemosis |
FRAE |
* RB4FASTSIM - 2010-2014 |
PRACE |
* HP-FEEL++ 2013-2014 * HP-PDE{1,2} 2012-2014 |
The region Rhônes-Alpes thanks the cluster ISLE [fn:2] and the project CHPID since 2009
We’re always happy to help out with Feel++ or any other questions you might have. You can ask a question or signal an issue at the Slack support salon or previously used Gitter Feel++ salon.
If you find an bug or have a feature proposal, please check first the issue does not already exist in the issue list. If not, post a new issue on the github repository. If you want to go further, you can contribute to the code by forking the repository, then proposing a pull request (PR) into the develop branch.
For more information about PR, see github documentation.
The following typographical conventions are used in the book
Italic indicates new terms
typewriter
is used on program listings as well as when referring to
programming elements, e.g. functions, variables, statements, data types,
environment variables or keywords.
$ typewriter
or > typewriter
displays commands that the user types literally without the $
or >
.
this is a general note. |
this is a general warning. |
be cautious |
Sometimes difficulty is precised for a tutorial or a specific process. Four difficulty levels can be distinguished:
Difficulty: easy!
Difficulty: average!
Difficulty: advanced!
Difficulty: hard!
\(d=1,2,3\) geometrical dimension
\(\Omega \subset \mathbb{R}^d\)
\(K\) a cell or element of a mesh
\(h\) characteristic mesh size
\(k_{\mathrm{geo}}\) polynomial order of the geometrical transformation
\(\delta=(h,k_{\mathrm{geo}})\) discretization parameter pair for the geometrical transformation, default value \(k_{\mathrm{geo}}=1\) (straight cells or elements)
\(\varphi^K_\delta: \hat{K} \rightarrow K\), geometrical transformation
\(\mathcal{T}_{\delta}\) a triangulation, \(\mathcal{T}_\delta = \{ K\; | \; K=\varphi^K_\delta (\hat{K}) \} \)
\(\Omega_h \equiv \cup_K {K}\)
\(P^k_{c,h} = \{ v_h \in C^0(\bar{\Omega}); \forall K \in \mathcal{T}_h,\ v_h \circ T_K \in \mathbb{P}^k\}\) Space of continuous piecewise polynomial of total degree \(\leq k\).
Feel++ is a unified C++ implementation of Galerkin methods (finite and spectral element methods) in 1D, 2D and 3D to solve partial differential equations.
Feel++ is
a versatile mathematical kernel solving easily problems using different techniques thus allowing testing and comparing methods, e.g. cG versus dG.
a small and manageable library which nevertheless encompasses a wide range of numerical methods and techniques and in particular reduced order methods such as the reduced basis method.
a software that follows closely the mathematical abstractions associated with partial differential equations (PDE) and in particular the finite element mathematical framework and variational formulations.
a library that offers solving strategies that scales up to thousands and even tens of thousands of cores.
a library entirely in C++ allowing to create C++ complex and typically non-linear multi-physics applications currently in industry, physics and health-care.
We propose different way to install Feel++ with varying difficulty. We encourage new Feel++ user to follow the container method which is the simplest! Be aware that native installation might be a complex process as Feel++ require additional software depending on feature you desire to enable. Thus only advanced users should follow this path. |
Difficulty |
The recommended way to start learning Feel++ consists in using container technologies. Containers provide an all-in one programming environment to start directly using Feel++ skipping the complex installation process. Feel++ is provided with two containers solutions currently:
Depending on your usage and your operating system, you might prefere using one of these previous solutions. The next sub-sections describe how to obtain Feel++ images to begin with Feel++ programming.
Feel++ images provide either a compiling environment with all dependencies, executables or both. |
Before going further you might want to install one of the previous solution. install docker or install singularity. |
Using Feel++ inside Docker is the recommended and fastest way to use Feel++. The Docker is dedicated to Docker and Feel++ containers chapter is dedicated to Feel++ in Docker. We strongly encourage you to follow these steps if you begin with Feel++ in particular as an end-user. People who would like to develop with and in Feel++ should read through the remaining sections of this chapter.
To begin with Feel++ using docker, you need first to install docker to have a working docker environment on your machine following the official documentation with respect to your operating system. Then choose one of the Feel++ images available on the official repository dockerhub.
We provide currently four main images:
Component | Description | Built From |
---|---|---|
|
Execution and Programming environment |
<OS> |
|
Feel++ libraries and tools |
|
|
Feel++ base applications |
|
|
Feel++ toolboxes |
|
Each image is available with several tags depending on the Feel++ version,
but also other dependencies.
(e.g
toolbox images tag list )
In most case, you desire to use the latest
tag.
Via the commandline and using the Feel++ toolboxes. We get the image and create a new container.
docker pull feelpp/feelpp-toolboxes
docker run -it -v ${HOME}/feel:/feel feelpp/feelpp-toolboxes
The -it
option is used to place yourself inside the container in an interactive mode.
You can start using Feel++ commands directly.
Note that the -v
option is used to share a folder between the host and the container.
Each container can be seen as an instance for the choosen image. You can create as many instance as you desire! |
It is also possible to execute a Feel++ application or a command embedded in the container from the outside. For example
docker run feelpp/feelpp-toolboxes echo "Hello World!"
To keep your data in the container, you can use docker [start|stop] -i <container name> .
|
singularity is another container technology initially developed to work with HPC infrastructure and solve some security problems in multi-users environment. Latest Feel++ singularity images can be found on our data management server (recommended) in the Feel++ collection. Future public Feel++ images will also be available on the official singularity hub website. We provide currently the same main images as for docker, but the suffix naming might vary depending on the image version.
Singularity works in a similar way as for docker. For example, you can
download one of the image available on
girder under the collection
feelpp
→ singularity_images
→ ci
→ feelpp_feelpp-toolboxes-latest.simg
click on download button.
Once downloaded you can place yourself in the container in interactive as for docker using the commandline
singularity shell -B ${HOME}/feel:/feel feelpp_feelpp-toolboxes-latest.simg
You can retrieve an image from singularity hub directly
singularity pull shub://feelpp/singularity:feelpp-toolboxes-latest instead of girder
and as for docker.
Be aware that current images are currently older than the ones on girder!
|
Difficulty: |
For beginners, you can skip this section and go directly to containers section. |
We now turn to the installation of the Feel++ dependencies on Linux. Feel++ is currently support on Ubuntu (16.04, 16.10) and Debian (Sid, Testing).
Here is the suggested installation of the Feel++ dependencies on Ubuntu 16.10
$ sudo apt-get -qq update
$ sudo apt-get install automake autoconf libtool libboost-all-dev\
bash-completion emacs24 gmsh libgmsh-dev libopenturns-dev \
libbz2-dev libhdf5-openmpi-dev libeigen3-dev libcgal-dev \
libopenblas-dev libcln-dev libcppunit-dev libopenmpi-dev \
libann-dev libglpk-dev libpetsc3.7-dev libslepc3.7-dev \
liblapack-dev libmpfr-dev paraview python-dev libhwloc-dev \
libvtk6-dev libpcre3-dev python-h5py python-urllib3 xterm tmux \
screen python-numpy python-vtk6 python-six python-ply wget \
bison sudo xauth cmake flex gcc-6 g++-6 clang-3.9 \
clang++-3.9 git ipython openmpi-bin pkg-config
Here is the suggested installation of the Feel++ dependencies on Ubuntu LTS 16.04
$ sudo apt-get install autoconf automake bash-completion bison\
clang++-3.8 clang-3.8 cmake emacs24 flex g++-6 gcc-6 git gmsh\
ipython libann-dev libbz2-dev libcgal-dev libcln-dev \
libcppunit-dev libeigen3-dev libglpk-dev libgmsh-dev \
libhdf5-openmpi-dev libhwloc-dev liblapack-dev libmpfr-dev\
libopenblas-dev libopenmpi-dev libopenturns-dev libpcre3-dev \
libpetsc3.6.2-dev libproj-dev libslepc3.6.1-dev libtool \
libvtk6-dev openmpi-bin paraview pkg-config python-dev \
python-h5py python-numpy python-ply python-six \
python-urllib3 python-vtk6 screen sudo tmux wget xauth xterm
We are unfortunately stung by the ABI change in GCC 6 when using clang. You need to recompile the Boost C++ libraries to be able to use clang, see the section in the Annexes on Compiling Boost. |
At the time of writing there is little difference between Sid and Testing, here is the recommend dependencies installation command line:
$ apt-get -y install \
autoconf automake bash-completion bison cmake emacs24 \
flex git gmsh ipython libann-dev libboost-all-dev \
libbz2-dev libcgal-dev libcln-dev libcppunit-dev \
libeigen3-dev libglpk-dev libgmsh-dev \
libhdf5-openmpi-dev libhwloc-dev liblapack-dev \
libmpfr-dev libopenblas-dev libopenmpi-dev \
libopenturns-dev libpcre3-dev libtool libvtk6-dev \
openmpi-bin paraview petsc-dev pkg-config python-dev \
python-h5py python-numpy python-ply python-six \
python-urllib3 python-vtk6 screen slepc-dev sudo \
tmux wget xauth xterm zsh
Unfortunately the older distributions have the ABI GCC issue with clang, e.g. Debian/jessie, or they are too old to support a simple installation procedure.
Difficulty: |
For beginners, you can skip this section and go directly to containers section. |
Feel++ is supported on Mac OSX, starting from OS X 10.9 Mavericks to OS X 10.12 Sierra using Homebrew or MacPorts.
Xcode is required on Mac OSX to install Feel++.
The easiest way to do so is to go through the Apple Store application and to search for Xcode. Xcode will provide the programming environment, e.g clang, for the next steps.
Homebrew is a free/open source software introduced to simplify the installation of other free/open source software on MacOS X. Homebrew is distributed under the BSD 2 Clause (NetBSD) license. For more information, visit their website.
To install the latest version of Homebrew, simply visit their website and follow the instructions. Each new package Homebrew installs is built into an intermediate place called the Cellar (usually /usr/local/Cellar) and then the packages are symlinked into /usr/local (default).
Homebrew base command is brew
. Here is a list of base available commands:
brew doctor
: Check if the system has any problem with the current installation of Homebrew;
brew install mypackage
: This command installs the package mypackage;
brew install [--devel|--HEAD] mypackage
: These options respectively installs either the development version or the HEAD version of the package mypackage, if such versions are specified in the Formula file;
brew uninstall mypackage
: This command allows to uninstall the package mypackage.
A Formula is a Ruby script format specific to Homebrew. It allows to describe the installation process of a package. Feel++ uses specific Formulae that you can get in the Feel++ github repository: feelpp/homebrew-feelpp.
This section is aimed at users that do not have Homebrew already installed.
In order to build Feel++ from Homebrew, you have to do the following steps:
First install Homebrew
pass:[\( /usr/bin/ruby -e "\)](curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
then check your Homebrew installation and fix warnings/errors if necessary
$ brew doctor
Install Homebrew-science tap to get the scientific software recommended or suggested for Feel++.
$ brew tap homebrew/homebrew-science
you should see something like
==> Tapping homebrew/science
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-science'...
remote: Counting objects: 661, done.
remote: Compressing objects: 100% (656/656), done.
remote: Total 661 (delta 0), reused 65 (delta 0), pack-reused 0
Receiving objects: 100% (661/661), 591.93 KiB | 0 bytes/s, done.
Tapped 644 formulae (680 files, 1.9M)
Next you install Feel++ tap with
brew tap feelpp/homebrew-feelpp
you should read something like
==> Tapping feelpp/feelpp
Cloning into '/usr/local/Homebrew/Library/Taps/feelpp/homebrew-feelpp'...
remote: Counting objects: 5, done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 5 (delta 0), reused 4 (delta 0), pack-reused 0
Unpacking objects: 100% (5/5), done.
Tapped 1 formula (30 files, 60.7K)
The final step is to either install Feel++
$ brew install feelpp
or just Feel++ dependencies if you plan to build Feel++ from sources yourself
$ brew install --only-dependencies feelpp
Note If you encounter problems, you can fix them using
brew doctor
. A frequent issue is to forceopen-mpi
withbrew link --overwrite open-mpi
If Homebrew is already installed on your system, you might want to customize your installation for the correct dependencies to be met for Feel++.
You can browse Feel++ dependencies using the following command:
$ brew deps feelpp | column
you get the list of formulas Feel++ depends on for its installation
ann fftw libtool slepc
arpack gcc metis suite-sparse
autoconf glpk mumps sundials
automake gmp netcdf superlu
boost gmsh open-mpi superlu_dist
cln hdf5 parmetis szip
cmake hwloc petsc tbb
eigen hypre scalapack veclibfort
If you want to customize the compilation process for a dependency (Set debug mode, Remove checking steps, Remove the link with certain libraries, etc.), you can access to the building options with the info
flag. For exemple, with open-mpi:
$ brew info open-mpi
You get various information about the open-mpi
formula
open-mpi: stable 2.0.1 (bottled), HEAD
High performance message passing library
https://www.open-mpi.org/
Conflicts with: lcdf-typetools, mpich
/usr/local/Cellar/open-mpi/2.0.1 (688 files, 8.6M) *
Built from source on 2016-09-26 at 10:36:46 with: --c++11 --with-mpi-thread-multiple
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/open-mpi.rb
==> Dependencies
Required: libevent ✔
==> Requirements
Recommended: fortran ✔
Optional: java ✔
==> Options
--c++11
Build using C++11 mode
--with-cxx-bindings
Enable C++ MPI bindings (deprecated as of MPI-3.0)
--with-java
Build with java support
--with-mpi-thread-multiple
Enable MPI_THREAD_MULTIPLE
--without-fortran
Build without fortran support
--HEAD
Install HEAD version
Then, you then just have to pass the needed flags, when installing the dependency.
Important:
boost
has to be installed with mpi and c++11 support andmumps
needs to be installed with the following scotch5 support.
MacPorts is an open-source community projet which aims to design an easy-to-use system for compiling, installing and upgrading open-source software on Mac OS X operating system. It is distributed under BSD License and facilitate the access to thousands of ports (software) without installing or compiling open-source software. MacPorts provides a single software tree which includes the latest stable releases of approximately 17700 ports targeting the current Mac OS X release (10.9). If you want more information, please visit their website.
To install the latest version of MacPorts, please go
to Installing
MacPorts page and follow the instructions. The simplest way is to
install it with the Mac OS X Installer using the pkg
file
provided on their website. It is recommended that you install X11 (X Window System) which is normally used to display X11 applications.
If you have installed with the package installer (MacPorts-2.x.x.pkg
) that means MacPorts will be installed in
/opt/local
. From now on, we will suppose that macports has
been installed in /opt/local
which is the default MacPorts
location. Note that from now on, all tools installed by MacPorts will be installed in /opt/local/bin
or /opt/local/sbin
for example (that’s here you’ll find gcc4.7 or later e.g
/opt/local/bin/g++-mp-4.7
once being installed).
In your command-line, the software MacPorts is called by the command port
. Here is a list of key commands for using MacPorts, if you want more informations please go to MacPorts Commands.
sudo port -v selfupdate
: This action should be used regularly to update the local tree with the global MacPorts ports. The option -v
enables verbose which generates verbose messages.
port info mypackage
: This action is used to get information about a port. (description, license, maintainer, etc.)
sudo port install mypackage
: This action install the port mypackage.
sudo port uninstall mypackage
: This action uninstall the port mypackage.
port installed
: This action displays all ports installed and their versions, variants and activation status. You can also use the -v
option to also display the platform and CPU architecture(s) for which the ports were built, and any variants which were explicitly negated.
sudo port upgrade mypackage
: This action updgrades installed ports and their dependencies when a Portfile
in the repository has been updated. To avoid the upgrade of a port’s dependencies, use the option -n
.
A Portfile is a TCL script which usually contains simple
keyword values and TCL expressions. Each package/port has a
corresponding Portfile but it’s only a part of a port description.
Feel++ provides some mandatory Portfiles for its compilation which are either not available in MacPorts or are buggy but Feel++ also provides some Portfiles which are already available in MacPorts such as gmsh or petsc. They usually provide either some fixes to ensure Feel++ works properly or new version not yet available in MacPorts. These Portfiles are installed in ports/macosx/macports
.
To be able to install Feel++, add the following line in
/opt/local/etc/macports/source.conf
at the top of the file
before any other sources:
file:///<path to feel top directory>/ports/macosx/macports
Once it’s done, type in a command-line:
$ cd <your path to feel top directory>/ports/macosx/macports
$ sudo portindex -f
You should have an output like this:
Reading port index in pass:[\(<\)]your path to feel top directorypass:[\(>\)]/ports/macosx/macports
Adding port science/feel++
Adding port science/gmsh
Adding port science/petsc
Total number of ports parsed: 3
Ports successfully parsed: 3
Ports failed: 0
Up-to-date ports skipped: 0
Your are now able to type
$ sudo port install feel++
It might take some time (possibly an entire day) to compile all the requirements for Feel++ to compile properly. If you have several cores on your MacBook Pro, iMac or MacBook, we suggest that you configure macports to use all or some of them.
To do that uncomment the following line in the file
/opt/local/etc/macports/macports.conf
buildmakejobs 0 pass:[\(\#\)] all the cores
At the end of the sudo port install feel++
, you have all
dependencies installed. To build all the Makefile, \cmake
is
automatically launched but can have some libraries may not be found but they are not mandatory for build Feel++, only the features related to the missing libraries will be missing.
Missing ports
|
Difficulty: |
For beginners, you can skip this section and go directly to containers section. |
Feel is not packaged for Windows operating system. We recommend to windows users to use docker software. Another solution is to use cygwin and follow linux installation. In the future, the Linux Subsystem for windows 10 (WSL) should easier Feel installation using either ubuntu packages, or singularity native installation.
Difficulty: |
For beginners, you can skip this section and go directly to containers section. |
Once the steps to install on Linux or MacOS X has been followed, we explain, in this section, how to download and build Feel++ from source.
Unresolved directive in installation/build/prerequisites/README.adoc - include::../../../includes/header.adoc[]
Difficulty: |
For beginners, you can skip this section and go directly to containers section. |
Feel++ uses C++14 compilers such as GCC6 and Clang. Currently it is not mandatory to have a C++14 stantard library but it will be soon.
There used to be a major compatibility issue between llvm/clang and GCC compilers since GCC5 released the ABI tag which makes it impossible to compile Feel++ using llvm/clang with GCC5 or GCC6 standard libraries for a time. Please see the following table to understand the working C++ compiler / C++ standard library combinations. |
Compiler | Standard Library |
---|---|
clang (3.6, 3.7, 3.8) |
libstdc++ 4.9 |
clang |
libc++ (corresponding clang version) |
clang (3.8(requires patches), 3.9) |
libstdc++ 6 |
GCC 6 |
libstdc++ 6 |
GCC 6.2.1 seems to be problematic on debian/testing — the tests in the testsuite fail. — GCC 6.3.1 or GCC 6.2.0 don’t have any problems. |
Other than C++14 compilers, Feel++ requires only a few tools and libraries, namely CMake, Boost C++ libraries and an MPI implementation such as open-mpi or mpich. The table below provides information regarding the minimum and maximum version supported. A — means it has not necessarily been tested with the latest version but we do not expect any issues. Note that for MPI, an implementation with MPI-IO support would be best.
Name | Minimum Version | Maximum Version | Notes |
---|---|---|---|
CMake |
3.0 |
— |
|
MPI |
— |
— |
openmpi or mpich |
Boost |
1.61 |
1.63 |
Here is a list of libraries that we recommend to use jointly with Feel++.
Library | Minimum Version | Maximum Version | Notes |
---|---|---|---|
HDF5 |
1.8.6 |
1.8.16 |
Enables high performance I/O; Enables MED Support; Be careful on Debian/sid a more recent version of HDF5 breaks MED support |
PETSc |
3.2 |
3.8.2 |
Last is best; a requirement for parallel and high performance computing |
SLEPc |
3.2 |
3.8.1 |
last is best; a requirement for eigenvalue problem; depends on PETSc |
Gmsh |
2.8.7 |
2.16 |
last is best; a requirement if you want to be able to read many file formats; HDF5 version in Debian/sid currently breaks MED format support. |
Superlu |
superlu and superlu_dist |
||
Suitesparse |
umfpack (colamd,amd) |
||
OpenTURNS |
2.0 |
Uncertainty quantification |
|
Python Libs |
3.0 |
Python 3 libraries |
|
Python Sympy |
1.1 |
Python 3 module sympy |
Here is a list of tools that we recommend to use jointly with Feel++.
Tool | License | Notes |
---|---|---|
Computer Aided Design |
||
Gmsh |
Open Source |
|
Mesh Generation |
||
Gmsh |
Open Source |
|
MeshGems |
Commercial |
|
Post-Processing |
||
Paraview |
Open Source |
|
Ensight |
Commercial |
|
Octave |
Open Source |
|
Gmsh |
Open Source |
|
Scripting Languages |
||
Python |
Open Source |
Python 3 interpreter |
Note that all these packages are available under Debian GNU/Linux and Ubuntu. Once you have installed those dependencies, you can go to Compiling.
Here is a list of tools that we suggest to use jointly with Feel++.
Tool | License | Notes |
---|---|---|
Computer Aided Design (CAD) |
||
Freecad |
Open Source |
|
Salome |
Open Source |
HDF5 version in Debian/sid currently breaks MED format support. |
Modeling, Compilation and Simulation Environment |
||
Open Modelica |
Open Source |
|
Debugging and Profiling |
||
Google perftools |
Open Source |
|
Valgrind |
Open Source |
First retrieve the source
$ git clone https://github.com/feelpp/feelpp.git
Create a build directory
$ mkdir build
$ cd build
Configure Feel++
$ CXX=clang++ ../feelpp/configure -r
Compile the Feel++ library
$ make feelpp
you can speed up the make process by passing the option -j<N> where N is the number of concurrent make sub-processes. It compiles N files at a time and respect dependencies. For example -j4 compiles 4 C++ files at a time.
|
Be aware that Feel++ consumes memory. The Feel++ library compile with 2Go of RAM. But to be more comfortable, 4Go or more would be best. The more, the better. |
Compile your first Feel++ applications
$ make quickstart
Execute your first Feel++ application in sequential
$ cd quickstart
$ ./feelpp_qs_laplacian_2d --config-file qs_laplacian_2d.cfg
Execute your first Feel++ application using 4 mpi processes
$ mpirun -np 4 feelpp_qs_laplacian_2d --config-file qs_laplacian_2d.cfg
Feel is distributed as tarballs following each major release. The tarballs are available on the link:https://github.com/feelpp/feelpp/releases[Feel Releases] web page.
Download the latest tarball, then uncompress it with:
$ tar -xzf feelpp-X.YY.0.tar.gz
$ cd feelpp-X.YY.0
You can now move to the section Using cmake.
Alternatively, you can download the sources of Feel++ directly from the Git repository.
$ git clone https://github.com/feelpp/feelpp.git
You should read something like
Cloning into 'feelpp'...
remote: Counting objects: 129304, done.
remote: Compressing objects: 100% (18/18), done.
remote: Total 129304 (delta 6), reused 0 (delta 0), pack-reused 129283
Receiving objects: 100% (129304/129304), 150.52 MiB | 1.69 MiB/s, done.
Resolving deltas: 100% (94184/94184), done.
Checking out files: 100% (7237/7237), done.
$ cd feelpp
The first level directory tree is as follows
$ tree -L 1 -d | column
. ├── databases ├── research
├── applications ├── doc ├── testsuite
├── benchmarks ├── feel └── tools
├── cmake ├── ports 14 directories
├── contrib ├── projects
├── data ├── quickstart
For now on, we assume that clang++
has been installed in /usr/bin
. Yor mileage
may vary depending on your installation of course.
It is not allowed to build the library in the top source directory. |
It is recommended to have a directory (e.g.
|
The configuration step with cmake
is as follows
$ cd FEEL/feel.opt
$ cmake ../feelpp -DCMAKE_CXX_COMPILER=/usr/bin/clang++-3.6 -DCMAKE_C_COMPILER=/usr/bin/clang-3.6 -DCMAKE_BUILD_TYPE=RelWithDebInfo
CMake supports different build type that you can set with |
Alternatively you can use the configure
script which calls cmake
. configure --help
will provide the following help.
Options:
-b, --build build type: Debug, Release, RelWithDebInfo
-d, --debug debug mode
-rd, --relwithdebinfo relwithdebinfo mode
-r, --release release mode
--std=c++xx c++ standard: c++14, c++1z (default: c++14)
--stdlib=libxx c++ standard library: stdc++(GCC), c++(CLANG) (default: stdc++)
--max-order=x maximum polynomial order to instantiate(default: 3)
--cxxflags override cxxflags
--cmakeflags add extra cmake flags
--prefix=PATH define install path
-v, --verbose enable verbose output
-h, --help help page
--<package>-dir=PACKAGE_PATH define <package> install directory
--disable-<package> disable <package>
--generator=GENERATOR cmake generator
We display below a set of possible configurations:
Compile using Release build type, default c compiler and libstdc
$ ../feelpp/configure -r
Compile using Release build type, clang compiler and libstdc
$ CXX=clang++ ../feelpp/configure -r
Compile using Debug build type, clang compiler and libc
CXX=clang++ ../feelpp/configure -d -stdlib=c++
Once cmake
or configure
have done their work successfully, you are ready to compile Feel++
$ make
You can speed up the compilation process, if you have a multicore processor by specifying the number of parallel jobs make
will be allowed to spawn using the -j
flag:
$ make -j4 feelpp
From now on, all commands should be typed in build directory (e.g feel.opt ) or its subdirectories.
|
If you encounter issues with Feel++, you can run the testsuite and send the resulting report. Feel++ has more than 300 tests running daily on our servers. Most of the tests are run both in sequential and in parallel.
The testsuite is in the testsuite
directory.
$ cd testsuite
The following command will compile 10 tests at a time
$ make -j10
$ ctest -j4 -R .
It will run 4 tests at a time thanks to the option -j4
.
Using Feel++ inside Docker is the recommended and fastest way to use Feel++. The Docker chapter is dedicated to Docker and using Feel++ in Docker.
We strongly encourage you to follow these steps if you begin with Feel++ in particular as an end-user.
People who would like to develop with and in Feel++ should read through the remaining sections of this chapter.
Start the Docker container feelpp/feelpp-base
or feelpp/feelpp-toolboxes
as follows
> docker run -it -v $HOME/feel:/feel feelpp/feelpp-toolboxes
these steps are explained in the chapter on Feel++ containers. |
Then run e.g. the Quickstart Laplacian that solves the Laplacian problem in Quickstart Laplacian sequential or in Quickstart Laplacian on 4 cores in parallel.
> feelpp_qs_laplacian_2d --config-file Testcases/quickstart/laplacian/feelpp2d/feelpp2d.cfg
The results are stored in Docker in
/feel/qs_laplacian/feelpp2d/np_1/exports/ensightgold/qs_laplacian/
and on your computer
$HOME/feel/qs_laplacian/feelpp2d/np_1/exports/ensightgold/qs_laplacian/
The mesh and solutions can be visualized using e.g. Parariew or Visit.
|
> mpirun -np 4 feelpp_qs_laplacian_2d --config-file Testcases/quickstart/laplacian/feelpp2d/feelpp2d.cfg
The results are stored in a simular place as above: just replace np_1
by np_4
in the paths above. The results should look like
Solution |
Mesh |
Here are some excerpts from Quickstart Laplacian that solves the Laplacian problem. It shows some of the features of Feel++ and in particular the domain specific language for Galerkin methods.
First we load the mesh, define the function space define some expressions
tic();
auto mesh = loadMesh(_mesh=new Mesh<Simplex<FEELPP_DIM,1>>);
toc("loadMesh");
tic();
auto Vh = Pch<2>( mesh );
auto u = Vh->element("u");
auto mu = expr(soption(_name="functions.mu")); // diffusion term
auto f = expr( soption(_name="functions.f"), "f" );
auto r_1 = expr( soption(_name="functions.a"), "a" ); // Robin left hand side expression
auto r_2 = expr( soption(_name="functions.b"), "b" ); // Robin right hand side expression
auto n = expr( soption(_name="functions.c"), "c" ); // Neumann expression
auto solution = expr( checker().solution(), "solution" );
auto g = checker().check()?solution:expr( soption(_name="functions.g"), "g" );
auto v = Vh->element( g, "g" );
toc("Vh");
Second we define the linear and bilinear forms to solve the problem
tic();
auto l = form1( _test=Vh );
l = integrate(_range=elements(mesh),
_expr=f*id(v));
l+=integrate(_range=markedfaces(mesh,"Robin"), _expr=r_2*id(v));
l+=integrate(_range=markedfaces(mesh,"Neumann"), _expr=n*id(v));
toc("l");
tic();
auto a = form2( _trial=Vh, _test=Vh);
tic();
a = integrate(_range=elements(mesh),
_expr=mu*inner(gradt(u),grad(v)) );
toc("a");
a+=integrate(_range=markedfaces(mesh,"Robin"), _expr=r_1*idt(u)*id(v));
a+=on(_range=markedfaces(mesh,"Dirichlet"), _rhs=l, _element=u, _expr=g );
//! if no markers Robin Neumann or Dirichlet are present in the mesh then
//! impose Dirichlet boundary conditions over the entire boundary
if ( !mesh->hasAnyMarker({"Robin", "Neumann","Dirichlet"}) )
a+=on(_range=boundaryfaces(mesh), _rhs=l, _element=u, _expr=g );
toc("a");
More explanations are available in Learning by examples.
We are interested in this section in the conforming finite element approximation of the following problem:
Look for \(u\) such that
\(\partial \Omega_D\), \(\partial \Omega_N\) and \(\partial \Omega_R\) can be empty sets. In the case \(\partial \Omega_D =\partial \Omega_R = \emptyset\), then the solution is known up to a constant. |
In the implementation presented later, \(\partial \Omega_D =\partial \Omega_N = \partial \Omega_R = \emptyset\), then we set Dirichlet boundary conditions all over the boundary. The problem then reads like a standard laplacian with inhomogeneous Dirichlet boundary conditions: Laplacian Problem with inhomogeneous Dirichlet conditions
Look for \(u\) such that Inhomogeneous Dirichlet Laplacian problem
\[-\Delta u = f\ \text{ in } \Omega,\quad u = g \text{ on } \partial \Omega\]
|
We assume that \(f, h, l \in L^2(\Omega)\). The weak formulation of the problem then reads:
Look for \(u \in H^1_{g,\Gamma_D}(\Omega)\) such that
We now turn to the finite element approximation using Lagrange finite element. We assume \(\Omega\) to be a segment in 1D, a polygon in 2D or a polyhedron in 3D. We denote \(V_\delta \subset H^1(\Omega)\) an approximation space such that \(V_{g,\delta} \equiv P^k_{c,\delta}\cap H^1_{g,\Gamma_D}(\Omega)\).
The weak formulation reads:
Look for \(u_\delta \in V_\delta \) such that
from now on, we omit \(\delta\) to lighten the notations. Be careful that it appears both the geometrical and approximation level. |
In Feel++, \(V_{g,\delta}\) is not built but rather \(P^k_{c,\delta}\).
The Dirichlet boundary conditions can be treated using different techniques and we use from now on the elimination technique. |
We start with the mesh
Unresolved directive in learn_by_example/README.adoc - include::qs_laplacian.cpp[tag=mesh]
the keyword auto enables type inference, for more details see Wikipedia C++11 page.
|
Next the discretization setting by first defining Vh=Pch<k>(mesh)
\(\equiv P^k_{c,h}\), then elements of Vh
and expressions f
, n
and g
given by command line options or configuration file.
Unresolved directive in learn_by_example/README.adoc - include::qs_laplacian.cpp[tag=discr]
at the following line
|
the variational formulation is implemented below, we define the
bilinear form a
and linear form l
and we set strongly the
Dirichlet boundary conditions with the keyword on
using
elimination. If we don’t find Dirichlet
, Neumann
or Robin
in the
list of physical markers in the mesh data structure then we impose
Dirichlet boundary conditions all over the boundary.
Unresolved directive in learn_by_example/README.adoc - include::qs_laplacian.cpp[tag=vf]
We have the following correspondance:
|
next we solve the algebraic problem
Unresolved directive in learn_by_example/README.adoc - include::qs_laplacian.cpp[tag=solve]
next we compute the \(L^2\) norm of \(u_\delta-g\), it could serve as an \(L^2\) error if \(g\) was manufactured to be the exact solution of the Laplacian problem.
Unresolved directive in learn_by_example/README.adoc - include::qs_laplacian.cpp[tag=ug]
and finally we export the results, by default it is in the ensight gold format and the files can be read with Paraview and Ensight. We save both \(u\) and \(g\).
Unresolved directive in learn_by_example/README.adoc - include::qs_laplacian.cpp[tag=export]
The Feel++ Implementation comes with testcases in 2D and 3D.
circle
is a 2D testcase where \(\Omega\) is a disk whose boundary
has been split such that \(\partial \Omega=\partial \Omega_D \cup
\partial \Omega_N \cup \partial \Omega_R\).
Here are some results we can observe after use the following command
cd Testcases/quickstart/circle
mpirun -np 4 /usr/local/bin/feelpp_qs_laplacian_2d --config-file circle.cfg
This give us some data such as solution of our problem or the mesh used in the application.
Solution \(u_\delta\) |
Mesh |
This testcase solves the Laplacian problem in \(\Omega\) an quadrangle or hexadra containing the letters of Feel++
After running the following command
cd Testcases/quickstart/feelpp2d
mpirun -np 4 /usr/local/bin/feelpp_qs_laplacian_2d --config-file feelpp2d.cfg
we obtain the result \(u_\delta\) and also the mesh
../../../images//Laplacian/TestCases/Feelpp2d/meshfeelpp2d.png[] |
|
Solution \(u_\delta\) |
Mesh |
We can launch this application with the current line
cd Testcases/quickstart/feelpp3d
mpirun -np 4 /usr/local/bin/feelpp_qs_laplacian_3d --config-file feelpp3d.cfg
When it’s finish, we can extract some informations
Solution \(u_\delta\) |
Mesh |
You just finish to read the Feel++ user manual. Where to go now ? To go further with the Feel++ usage, you might want to read the different toolboxes documentation. If you want to know more about how to program with Feel++, consult the Feel++ programming book. To know more about the core of Feel++, you might want to read the {developer} manual.
Copyright © 2010-2017 by Feel++ Consortium
Copyright © 2005-2015 by Université Joseph Fourier (Grenoble, France)
Copyright © 2005-2015 by University of Coimbra (Portugal)
Copyright © 2011-2015 by Université de Strasbourg (France)
Copyright © 2011-2015 by CNRS (France)
Copyright © 2005-2006 by Ecole Polytechnique Fédérale de Lausanne (EPFL, Switzerland)
Free use of this software is granted under the terms of the L License.
See the LICENSE file for details
Feel++ is actively developed by Christophe Prud’homme, Vincent Chabannes, Christophe Trophime, Cécile Daversin, Thibaut Métivet, Guillaume Dollé, Jean-Baptiste Wahl, Romain Hild, Lorenzo Sala, and Thomas Lantz.
There are many other contributors.
Feel++ is currently managed by Christophe Prud’homme, Professor in applied mathematic and scientific computing at the University of Strasbourg, France.
Feel++ has been funded by various sources and especially
Feel++ benefits from the many discussions and close research collaborations with the following persons: Mourad Ismail, Zakaria Belhachmi, Silvia Bertoluzza, Micol Pennacchio, Marcela Szopos, Giovanna Guidoboni, Riccardo Sacco, Gonçalo Pena.
Finally Feel++ also benefits from discussions within collaborative projects with many people (in no particular order):
Yannick Hoarau, Philippe Gilotte, Benjamin Surowiec, Yoann Eulalie, Stephie Edwige, Marion Spreng, Benjamin Vanthong, Thomas Lantz, Mamadou Camara, Camille Boulard, Pierre Gerhard, Frédéric Hecht, Michel Fouquembergh, Denis Barbier, Jean-Marc Gratien, Daniele Di Pietro.
Feel++ was initially developed at École Polytechnique Fédérale de Lausanne(Suisse) and is now a joint effort between Université de Strasbourg, Université Grenoble-Alpes, CNRS, LNCMI and Cemosis.
Free-function to apply to a mesh to retrieve the iterators over elements touching the boundary of the mesh stored on the current processor with an face, edge or point.
Free-function to apply to a mesh to retrieve the iterators over boundary faces of the mesh stored on the current processor.
The tool that configures Feel++ build environment and generate Makefiles by default.
Free-function to apply to a mesh to retrieve the iterators over the edges of the mesh stored on the current processor
Eigen is a C++ template library for linear algebra: matrices, vectors, numerical solvers, and related algorithms.
Free-function to apply to a mesh to retrieve the iterators over the elements of the mesh stored on the current processor
Free-function to apply to a mesh to retrieve the iterators over the faces of the mesh stored on the current processor
MPI global rank of a data structure
Free-function to define integral expressions entering the definition of integrals, linear and bi-linear forms.
Free-function to apply to a mesh to retrieve the iterators over elements which are not touching with a point, edge or face the boundary of the mesh stored on the current processor
A tool that builds Feel++ code from Makefiles generated by Cmake.
Free-function to apply to a mesh to retrieve the iterators over marked elements (by a string or an integer id) with marker2 of the mesh stored on the current processor
Free-function to apply to a mesh to retrieve the iterators over marked elements (by a string or an integer id) with marker3 of the mesh stored on the current processor
Free-function to apply to a mesh to retrieve the iterators over marked edges (by a string or an integer id) of the mesh stored on the current processor
Free-function to apply to a mesh to retrieve the iterators over marked elements (by a string or an integer id) of the mesh stored on the current processor
Free-function to apply to a mesh to retrieve the iterators over marked faces (by a string or an integer id) of the mesh stored on the current processor
Marker for mesh element, faces, edges or point. Element marker are often associated to material properties
Marker for mesh element, faces, edges or point. It is used for example to iterate over element thanks to a particular piecewise constant field
Marker for mesh element, faces, edges or point. It is used for example to iterate over element thanks to a particular piecewise constant field
Free-function to compute the average value of a function.
A parallel sparse direct solvers
Free-function to compute the \(H^1\) norm of an expression
Free-function to compute the \(L^2\) norm of an expression
Free-function to compute the \(L^{\infty}\) norm of an expression
PaStiX (Parallel Sparse matriX package) is a scientific library that provides a high performance parallel solver for very large sparse linear systems based on direct methods. Numerical algorithms are implemented in single or double precision (real or complex) using LLt, LDLt and LU with static pivoting (for non symmetric matrices having a symmetric pattern). This solver provides also an adaptive blockwise iLU(k) factorization that can be used as a parallel preconditioner using approximated supernodes to build a coarser block structure of the incomplete factors. See http://pastix.gforge.inria.fr/.
A library for High Performance Computing providing parallel data structures and numerical methods linear and non-linear algebraic problems arising for example PDE discretisation. PETSc is the main solver strategy provider for FEEL++.
Free-function to project an expression \(e\) over a nodal function space \(X_h\). It would typically return the interpolant \(\Pi_h e \in X_h\) of the expression in the function space.
MPI local rank of a data structure
A library based on PETSc providing a framework to solve eigenvalue problems.
Symmetric Positive Definite
UMFPACK /ˈʌmfpæk/ is a set of routines for solving sparse linear systems of the form Ax=b, using the Unsymmetric MultiFrontal method (Matrix A is not required to be symmetric) [source: https://en.wikipedia.org/wiki/UMFPACK]