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!

## 1. Preface

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

#### 1.1.1. Contributors

This book is the result of many contributions and in particular from:

 Alexandre Ancel alexandre.ancel@cemosis.fr Denis Barbier Guillaume Dollé gdolle@unistra.fr Vincent Huber vincent.huber@cemosis.fr Christophe Prud’homme [Leader] christophe.prudhomme@feelpp.org Ranine Tarabay tarabay@math.unistra.fr Jean-Baptiste Wahl wahl.jb@gmail.com

### 1.2. Credits

• Université Joseph Fourier (Grenoble, France)

• University of Coimbra (Portugal)

• Université de Strasbourg (France)

• Feel++ is Copyright © 2005-2006 by Ecole Polytechnique Fédérale de Lausanne (EPFL, Switzerland)

#### 1.2.2. Developers

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.

##### Current Developers
 Christophe Prud’homme [Leader] christophe.prudhomme@feelpp.org Vincent Chabannes [Leader] vincent.chabannes@feelpp.org Guillaume Dollé gdolle@unistra.fr Romain Hild wahl.jb@gmail.com Mourad Ismail Mourad.Ismail@ujf-grenoble.fr Pierre Jolivet Thibault Metivet thibaut.metivet@ujf-grenoble.fr Christophe Trophime christophe.trophime@lncmi.cnrs.fr Jean-Baptiste Wahl wahl.jb@gmail.com
##### Past Developers
 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 tarabay@math.unistra.fr Cecile Daversin daversin@math.unistra.fr Vincent Huber vincent.huber@cemosis.fr Alexandre Ancel alexandre.ancel@cemosis.fr Vincent Doyeux vincent.doyeux@ujf-grenoble.fr
##### More people

Feel++ benefits from the many discussions and close research collaborations with the following persons:

 Zakaria Belhachmi zakaria.belhachmi@uha.fr Silvia Bertoluzza silvia.bertoluzza@imati.cnr.it Micol Pennacchio Micol.Pennacchio@imati.cnr.it Marcela Szopos mszopos@math.unistra.fr

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.

### 1.3. Consortium

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.

#### 1.4.1. Current funding

Feel++ is supported by:

 H2020 * MSO4SC (H2020) ANR * VIVABRAIN (MN call - 2013-2017) * CHORUS (MN call - 2013-2017) PRACE * HP-FEEL++ 2015-2016 * LABEX IRMIA

#### 1.4.2. Past funding

 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

### 1.5. Contribute

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.

Join the Feel++ chat

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.

### 1.6. Conventions

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:

1. Difficulty: easy!

2. Difficulty: average!

4. Difficulty: hard!

#### 1.6.1. Mathematical Notations

##### Geometry and Meshes
• $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}$

##### Spaces
• $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$.

## 2. Introduction

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

1. a versatile mathematical kernel solving easily problems using different techniques thus allowing testing and comparing methods, e.g. cG versus dG.

2. 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.

3. 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.

4. a library that offers solving strategies that scales up to thousands and even tens of thousands of cores.

5. a library entirely in C++ allowing to create C++ complex and typically non-linear multi-physics applications currently in industry, physics and health-care.

## 3. Installation

 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.

#### 3.1.1. Docker

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:

Table 1. Table of the current components of the FCS
Component Description Built From

feelpp-env

Execution and Programming environment

<OS>

feelpp-libs

Feel++ libraries and tools

feelpp-env

feelpp-base

Feel++ base applications

feelpp-libs

feelpp-toolboxes

Feel++ toolboxes

feelpp-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.

##### Usage example

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 . #### 3.1.2. Singularity 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 feelppsingularity_imagescifeelpp_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!

### 3.2. Linux

 Difficulty: average!
 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).

#### 3.2.1. Ubuntu

##### Ubuntu 16.10 Yaketti Yak

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
##### Ubuntu 16.04

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. #### 3.2.2. Debian ##### Debian Sid and Testing 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
##### Older distributions

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.

### 3.3. MacOS

 Difficulty: average!
 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.

#### 3.3.1. First step

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.

#### 3.3.2. Homebrew

##### Introduction to HomeBrew

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.

###### Installation

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).

###### Key commands

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.

###### Formulas

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.

##### Installation

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

==> 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 force open-mpi with brew 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++.

###### Feel++ Dependencies

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 ###### Customizing builds 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

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
--without-fortran
Build without fortran support

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 and mumps needs to be installed with the following scotch5 support.

#### 3.3.3. MacPorts

##### Introduction

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.

###### MacPorts Installation

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).

###### Key commands

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.

###### Portfile

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.

##### Installation

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

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 cmake can build Makefiles even if some packages are missing (latex2html, VTK …​). It’s not necessary to install them but you can complete the installation with MacPorts, cmake will find them by itself once they have been installed. ### 3.4. Windows  Difficulty: average!  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. ### 3.5. From source  Difficulty: advanced!  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. #### 3.5.1. System requirements Unresolved directive in installation/build/prerequisites/README.adoc - include::../../../includes/header.adoc[]  Difficulty: advanced!  For beginners, you can skip this section and go directly to containers section. ##### Compilers 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. Table 2. Table C++ compilers and standard libraries 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. ##### Required tools and libraries 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. Table 3. Table required tools to compile Feel++ 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++. Table 4. Table optional external libraries 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++. Table 5. Table of recommended tools 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. ##### Suggested tools Here is a list of tools that we suggest to use jointly with Feel++. Table 6. Table of suggested tools 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 #### 3.5.2. For the impatient 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 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.

$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

##### Using Tarballs

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.

$tar -xzf feelpp-X.YY.0.tar.gz$ cd feelpp-X.YY.0

You can now move to the section Using cmake.

##### Using Git

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 #### 3.5.4. Configuring Feel++ 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. FEEL) in which you have both the sources and build directories, as follows$ ls FEEL feelpp/ # Sources feel.opt/ # Build directory feelpp is the top directory where the source have been downloaded, using git or tarballs.
##### Using cmake

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 -DCMAKE_BUILD_TYPE (case insensitive) : * None * Debug : typically -g * Release : typically -O3 -DNDEBUG * MinSizeRel : typically -Os * RelWithDebInfo : typically -g -O2 -DNDEBUG
##### Using configure

Alternatively you can use the configure script which calls cmake. configure --help will provide the following help.

Listing Configure 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
--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

Listing compiling using default compilers
$../feelpp/configure -r Compile using Release build type, clang compiler and libstdc Listing compiling using clang++$ CXX=clang++ ../feelpp/configure -r

Compile using Debug build type, clang compiler and libc

Listing compiling using clang/libc in Debug mode
CXX=clang++ ../feelpp/configure -d -stdlib=c++

#### 3.5.5. Compiling Feel++

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: Listing build Feel++ library using 4 concurrent jobs$ make -j4 feelpp
 From now on, all commands should be typed in build directory (e.g feel.opt) or its subdirectories.

#### 3.5.6. Running the Feel++ Testsuite

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
Listing: Running the Feel++ testsuite
$ctest -j4 -R . It will run 4 tests at a time thanks to the option -j4. ## 4. Quick Starts ### 4.1. Installation Quick Start 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. ### 4.2. Usage Start 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.

Quickstart Laplacian sequential
> 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/

\$HOME/feel/qs_laplacian/feelpp2d/np_1/exports/ensightgold/qs_laplacian/

The mesh and solutions can be visualized using e.g. Parariew or Visit.

 ParaView (recommended) is an open-source, multi-platform data analysis and visualization application. Visit is a distributed, parallel visualization and graphical analysis tool for data defined on two- and three-dimensional (2D and 3D) meshes
Quickstart Laplacian on 4 cores in parallel
> 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

### 4.3. Syntax Start

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();

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

Laplacian problem in an arbitrary geometry, defining forms and solving
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),
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.

## 5. Learn By Example

### 5.1. Problem statement: Laplacian

We are interested in this section in the conforming finite element approximation of the following problem:

Laplacian problem

Look for $u$ such that

$\left\{\begin{split} -\Delta u &= f \text{ in } \Omega\\ u &= g \text{ on } \partial \Omega_D\\ \frac{\partial u}{\partial n} &=h \text{ on } \partial \Omega_N\\ \frac{\partial u}{\partial n} + u &=l \text{ on } \partial \Omega_R \end{split}\right.$
 $\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$

### 5.2. Variational formulation

We assume that $f, h, l \in L^2(\Omega)$. The weak formulation of the problem then reads:

Laplacian problem variational formulation

Look for $u \in H^1_{g,\Gamma_D}(\Omega)$ such that

Variational formulation
$\displaystyle\int_\Omega \nabla u \cdot \nabla v +\int_{\Gamma_R} u v = \displaystyle \int_\Omega f\ v+ \int_{\Gamma_N} g\ v + \int_{\Gamma_R} l\ v,\quad \forall v \in H^1_{0,\Gamma_D}(\Omega)$

### 5.3. Conforming Approximation

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)$.

Laplacian problem weak formulation

Look for $u_\delta \in V_\delta$ such that

$\displaystyle\int_{\Omega_\delta} \nabla u_{\delta} \cdot \nabla v_\delta +\int_{\Gamma_{R,\delta}} u_\delta\ v_\delta = \displaystyle \int_{\Omega_\delta} f\ v_\delta+ \int_{\Gamma_{N,\delta}} g\ v_\delta + \int_{\Gamma_{R,\delta}} l\ v_\delta,\quad \forall v_\delta \in V_{0,\delta}$
 from now on, we omit $\delta$ to lighten the notations. Be careful that it appears both the geometrical and approximation level.

### 5.4. Feel++ Implementation

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.

 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.

 at the following line Unresolved directive in learn_by_example/README.adoc - include::qs_laplacian.cpp[tag=v] v is set to the expression g, which means more precisely that v is the interpolant of g in Vh.

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.

We have the following correspondance:

Element sets Domain

elements(mesh)

$\Omega$

boundaryfaces(mesh)

$\partial \Omega$

markedfaces(mesh,"Dirichlet")

$\Gamma_D$

markedfaces(mesh,"Neumann")

$\Gamma_R$

markedfaces(mesh,"Robin")

$\Gamma_R$

next we solve the algebraic problem

Listing: solve algebraic system

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.

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$.

Listing: export Laplacian results

### 5.5. Testcases

The Feel++ Implementation comes with testcases in 2D and 3D.

#### 5.5.1. circle

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

#### 5.5.2. feelpp2d and feelpp3d

This testcase solves the Laplacian problem in $\Omega$ an quadrangle or hexadra containing the letters of Feel++

##### feelpp2d

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
##### feelpp3d

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

## 6. Conclusion

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.

## 7. Ressources

Free use of this software is granted under the terms of the L License.

See the LICENSE file for details

### 7.2. Authors

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.

### 7.3. Funding

Feel++ has been funded by various sources and especially

#### 7.3.1. Current funding

EU E-INFRA H2020
ANR projects
PlasticOmnium
• Contract (2016-2017)

Holo3
• Contract (2016-2017)

AMIES
• PEPS Holo3

• PEPS Solodem

• PEPS NS2++

IRMIA
• Hifimagnet (2012-2018)

• 4fastsim (2016-2017)

#### 7.3.2. Past funding

ANR
• HAMM - (Cosinus call - 2010-2014)

• OPUS - (TLOG call - 2008-2011)

• Funding for Cemosis

FRAE
• RB4FASTSIM - 2010-2014

PRACE projects
• HP-FEEL++ 2015-2016

• HP-FEEL++ 2013-2014

• HP-PDE{1,2} 2012-2014

Rhônes-Alpes region
• cluster ISLE [fn:2] and the project CHPID (2009-2011)

### 7.4. Contributors

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.

### 7.5. Consortium

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.

## Glossary

boundaryelements

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.

boundaryfaces

Free-function to apply to a mesh to retrieve the iterators over boundary faces of the mesh stored on the current processor.

Cmake

The tool that configures Feel++ build environment and generate Makefiles by default.

edges

Free-function to apply to a mesh to retrieve the iterators over the edges of the mesh stored on the current processor

Eigen3

Eigen is a C++ template library for linear algebra: matrices, vectors, numerical solvers, and related algorithms.

elements

Free-function to apply to a mesh to retrieve the iterators over the elements of the mesh stored on the current processor

faces

Free-function to apply to a mesh to retrieve the iterators over the faces of the mesh stored on the current processor

globalRank

MPI global rank of a data structure

integrate

Free-function to define integral expressions entering the definition of integrals, linear and bi-linear forms.

internalelements

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

Make

A tool that builds Feel++ code from Makefiles generated by Cmake.

marked2elements

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

marked3elements

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

markededges

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

markedelements

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

markedfaces

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

Marker for mesh element, faces, edges or point. Element marker are often associated to material properties

marker2

Marker for mesh element, faces, edges or point. It is used for example to iterate over element thanks to a particular piecewise constant field

marker3

Marker for mesh element, faces, edges or point. It is used for example to iterate over element thanks to a particular piecewise constant field

mean

Free-function to compute the average value of a function.

MUMPS

A parallel sparse direct solvers

normH1

Free-function to compute the $H^1$ norm of an expression

normL2

Free-function to compute the $L^2$ norm of an expression

normLinf

Free-function to compute the $L^{\infty}$ norm of an expression

Pastix

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/.

PETSc

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++.

project

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.

rank

MPI local rank of a data structure

SLEPc

A library based on PETSc providing a framework to solve eigenvalue problems.

SPD

Symmetric Positive Definite

UMFPACK

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]