Computing integrals over mesh

The next step is to compute integrals over the mesh ( See this for detailed methods ).

Step by step explanations

We start by loading a Mesh in 2D

then we define the Feel++ expression that we are going to integrate
using the soption function that retrieves the command line option
string functions.g. We then transform this string into a Feel++
expression using expr().

then we compute two integrals over the domain and its boundary respectively

\$\int_\Omega g\$

\$\int_{\partial \Omega} g\$

and we print the results to the screen.

Only the rank 0 process (thanks to Environment) isMasterRank()
prints to the screen as the result is the same over all mpi processes
if the application was run in parallel. Note also that the code
actually prints the expression passed by the user through the command
line option functions.g.

Some results

We start with the following function \$g=1\$. Recall that by default
the domain is the unit square, hence the \$\int_\Omega g\$ and
\$\int_{\partial\Omega} g\$ should be equal to 1 and 4 respectively.

Note that we don’t get the exact results due to the fact that
[stem]:[\Omega_h = \cup_{K \in \mathcal{T}_h} K] which we use for the numerical integration is different from the exact domain \$\Omega = \{ (x,y)\in \mathbb{R}^2 | x^2+y^2 < 1\}\$.