Use different test functions for different dof

Dear FreeFem community,
I am studying a contact problem, and it turns out that I have to solve a problem, which uses a particular fespace (i.e. different test functions for different dof). More precisely, the problem is as follows. I have:

  1. a domain D1, with mesh th1, nodes x1i, fespace V1 ,
  2. another domain D2, with mesh th2, nodes x2j, fespace V2 and
  3. (X1,Y1) in V1^2, which maps D1 to D2 and is compatible in the sense that transfers nodes to nodes.

Next, I note by v1i the test functions of V1, and by v2j the test functions of V2, and I consider the fespace W1 in (D1,th1) defined by:
W1=span{v1i, with x1i not a node of border 1, v2j(X1,Y1) with (X1,Y1)^{-1}(x2j) node of border 1}.

Can this space W1 be implemented? If not, I wonder what would be the technique for solving, for example,
-\Delta w1 = 1 in W1, with w1=0 on borders (2,3,4) ?

Thank you!

Hello,
The key point is to have a well-defined variational formulation. It doesn’t look to be the case with your statements.

Dear Francois,
Thank you for the comment. I have edited my original post with a clear description of my problem. I appreciate any comment/suggestion!

One could try to define directly the matrix of the system, building it by blocks corresponding to dofs on border 1, and all other dofs.