1. Interpolation
Feel++ has a very powerful interpolation framework which allows to:
-
transfer functions from one mesh to another
-
transfer functions from one space type to another.
this is done seamlessly in parallel. The framework provides a set of C++ classes and C++ free-functions enabled short, concise and expressive handling of interpolation.
1.1. Using interpolation operator
using MeshType = Mesh<Simplex<2>>;
auto mesh = loadMesh( _mesh=new MeshType );
auto P1h = Pch<1>( mesh );
auto P0h = Pdh<0>( mesh );
auto Ih = I( _domain=P1h, _image=P0h );
1.2. De Rahm Diagram
The De Rahm diagram reads as follows: the range of each of the operators coincides with the null space of the next operator in the sequence below, and the last map is a surjection.
An important result is that the diagram transfers to the discrete level
The diagram above is commutative which means that we have the following properties:
The diagram can be restricted to functions satisfying the homogeneous Dirichlet boundary conditions |
Interpolation operators are provided as is or as shared pointers. The table below presents the alternatives.
C++ object |
C++ Type |
C++ shared object |
C++ Type |
Mathematical operator |
|
|
|
|
\(I: X_h \rightarrow Y_h \) |
|
|
|
|
\(\nabla: X_h \rightarrow W_h \) |
|
|
|
|
\(\nabla \times : W_h \rightarrow V_h \) |
|
|
|
|
\(\nabla \cdot: V_h \rightarrow Z_h \) |
auto mesh = loadMesh( _mesh=new Mesh<Simplex<Dim>>());
auto Xh = Pch<1>(mesh);
auto Gh = Ned1h<0>(mesh);
auto Ch = Dh<0>(mesh);
auto P0h = Pdh<0>(mesh);
auto Igrad = Grad( _domainSpace = Xh, _imageSpace=Gh );
auto Icurl = Curl( _domainSpace = Gh, _imageSpace=Ch );
auto Idiv = Div( _domainSpace = Ch, _imageSpace=P0h );
auto u = Xh->element(<expr>);
auto w = Igrad(u); // w in Gh
auto x = Icurl(w); // z in Ch
auto y = Idiv(x); // y in P0h