Hi,
There are examples of surface FEM for a scalar function, such as LapEigenBeltrami.edp, however I haven’t found an example of “expressing the gradient of a vector on a surface mesh ThS”.
For a scalar u, the surface gradient is computed as follows:
meshS ThS=square3(nx,ny,[torex,torey,torez],removeduplicate=true) ;
fespace Vh(ThS,P1);
Vh u.
macro Grad3(u) [dx(u),dy(u),dz(u)] // EOM
real sigma = -1;
varf aS(u,v) = int2d(Th)(Grad3(u)'Grad3(v)- sigma uv);
varf mS(u,v) = int2d(Th)( uv);
But how to express the gradient of a vector (u1, u2) (intrinsic form: two components in the local coordinates)?
fespace VhS(Th, [P1, P1] );
Vh [u1, u2] .
My week form in the local coordinate evolves the computation of

where
![]()
with g_ij being the metric tensor, g^ij being its inverse, and " ; “ denotes the covariant derivative. Alternatively, the non-symmetric form may also be used if it’s easier:
How to express these expressions on the surface mesh?
For the following code,
fespace VhS(Th, [P1, P1] );
Vh [u1, u2] .
If we express u1 and u2 using the shape function \phi, the derivative ultimately acts on the shape function \phi (x, y, z). The relevant question is: how does FreeFEM compute dx(\phi)?
In some FEM software, it’s only meaningful to define the derivatives with respect to the local coordinates. Can I say
macro Grad3(u) [dx(u),dy(u),dz(u)] // EOM
has not been projected to the surface yet and the user has to do the projection?
If my assumption is true, then it seems the weak form in exmaple LapEigenBeltrami.edp has a problem: (Grad3(u)'Grad3(v) includes the normal component, which is wrong?