How Freefem++ assemble the forms with variable coefficient?


I want to make clear about how FreeFEM deal with the variable coefficient while assembling.

Here is an example:
$$ a(u, v) = \int c \nabla u \cdot \nabla v $$
where c = \cos (x) is a given function.

Is there an explicit step to interpolate c to a high order FE function first?

Or it is to apply numerical integral directly, namely c is evaluated at the quadrature points?


The complete expression inside the integral is evaluated at the quadrature points. If “c” is an explicitly-defined function of “x”, it is evaluated exactly at each point. If “c” is defined on a finite element basis, then it is a function of its finite element space. So it is evaluated through interpolation on that space (not a higher-order one).

Got it. Thank you Chris.

1 Like

Trivial, if just write
varf va(u,v) = int2d(Th)(cos(x) *grad(u)’*grad(v));
Frederic Hecht.