Surface gradient of Vector field

Hello,

  • Surface gradient of a scalar H1 finite function u:

math syntax: (I - nn^T)Grad(u)

mesh = Mesh(unit_square.GenerateMesh(maxh=0.2))
fes = Compress(H1(mesh, order=2, definedon=mesh.Boundaries("top")))
u = GridFunction(fes)
Grad(u).Trace()  # Surface gradient of scalar H1 finite element function.
  • How about the surface gradient of a vector-valued H1 finite element function U?

math syntax: (I - nn^T)Grad(U)(I - nn^T)
(refer to (2.2) in the link paper)

However, Do the following codes work?

fesvec = Compress(VectorValued(H1(mesh, order=2, definedon=mesh.Boundaries("top") , 2) ) # same as VectorH1
U = GridFunction(fesvec)
Grad(U).Trace()    # I don't believe this is correct for  surface gradient of a  **vector-valued** H1 finite element function **U**

Does the Trace() Operator work well also for vector valued function? If not, what should I do to code the the surface gradient of a vector-valued H1 finite element function U correctly?

Best,
Coulson