'SIMD: don't know how I shall evaluate in Assemble BilinearForm' error

I used the solution of a problem to be an input of another problem.

When I tried with an exact solution (a CoefficientFunction), the code worked well.

When I tried with an computed solution (a GridFunctioN), there is an error as follows.

NgException: GridFunctionCoefficientFunction: SIMD: don't know how I shall evaluatein Assemble BilinearForm 'biform_from_py'

The error was disappeared when I deleted line 248 (But I need this line in the discrete formulation.):

a += (u*n)*wbar.Trace()*cbar.Trace()*ds

So I guess the error maybe come from u.

Please see the attached file for details.

Can I convert a gridfunction to a similar form of a coefficient function? Could you please tell me how to fix that error?
Thank you so much.

Attachment: Untitled22.ipynb

Hi dong,

u is a VectorL2 GridFunction, which you want to evaluate at the boundary.
L2 (and therefore VectorL2) has no well defined Trace (the L2 space returns a “DummyFE” which seems to cause an exception).

Further, in the definition of the space

V1 = VectorL2(mesh, order=order, dirichlet="gammaS|gammaD")

the dirichlet flag will be ignored (the number of dofs and number of free dofs coincide).

Best
Michael