Zero boundary condition on the test space

I try to implement the variational form where both trial and test function have zero boundary condition, i.e, u,v \in H^1_0(\Omega)

varf mainmatrix (u,v) = 
 ...
+ on(1,2,3,4, u=0, v=0) ;

The error: We expected an unknown u=… of the problem

Is there discrete H^1_0 space in FreeFem++ or alternative way to write?

You have to write just u=0 !

But, it is not the same with u=0 only

On my continuous setting u,v \in H^1_0
With trial space in u \in H^1_0 you can simply set +(…, u=0).
But with test space v \in H^1_0 you can not do the same.

Or did you said that if you impose 0 on BC of u, it automatically impose on BC of v?


In details,
u,v \in H^1_0(\Omega) and sigma,psi \in H^1(\Omega). How can I impose H^1_0 on v?. (Note that if I choose v \in H^1(\Omega) I get the wrong solution)

fespace Vh(Omega, P1);
Vh u, v, sigma,psi;
varf mainmatrix ([u,sigma], [v,psi]) = 
 int2d(Omega) ((dy(u) + sigma) * (dy(v)+psi ))
+?;

Writing +on(1,2,3,4,u=0); does not “exactly” impose v=0, but it is equivalent to that (up to some small error), it is done by penalty.
If you set tgv=-1 then it really sets u=0 and v=0 on the boundary.