Mixed problems involving 2D meshes and 1D lineic meshes

Dear all
We are experimenting with the newly introduced 1d lineic meshes.
We have cases where we have to build matrix block where variable is lineic and test function is surfacic or vice versa.

The first situation works correctly but not the second one… see attached example.

 load "isoline"
load "msh3"

// Generating a 2D mesh for a half disk

real R = 1;
border axis(t=-R,R){x=t; y=0;label=6;};
border surface(t=0,pi){x=R*cos(t); y=R*sin(t);label=7;};
mesh Th = buildmesh(axis(20)+surface(30));
plot(Th);

// Extracting the 1D mesh corresponding to the half circle

int[int] l7=[7]; 
meshL Thlin = extract(Th,refedge=l7); //lineic mesh corresponding to boundary 7

// test of mixed problems

fespace Vh(Th,P1); 
fespace Vhlin(Thlin,P1); 

Vh f,g;
Vhlin flin,glin;

varf Test1(flin,g) =  int1d(Thlin)(flin*g); 
matrix Mtest1 = Test1(Vhlin,Vh); 

varf Test2(f,glin) =  int1d(Thlin)(f*glin);
matrix Mtest2 = Test2(Vh,Vhlin);

The error is as follows :
matrix Mtest2 = Test2(Vh,Vhlin) error operator <6C_args>, <PP5v_fes>, <PP6v_fesL>
List of choices
( <15Call_FormLinearIN5Fem2D4MeshE5v_fesE> : <6C_args>, , <PP5v_fes> )
( <17Call_FormBilinearIN5Fem2D5MeshSE6v_fesS5v_fesE> : <6C_args>, <PP6v_fesS>, <PP5v_fes> )
( <17Call_FormBilinearIN5Fem2D5MeshLE6v_fesL5v_fesE> : <6C_args>, <PP6v_fesL>, <PP5v_fes> )
( <17Call_FormBilinearIN5Fem2D5MeshLE6v_fesL6v_fesSE> : <6C_args>, <PP6v_fesL>, <PP6v_fesS> )
( <17Call_FormBilinearIN5Fem2D5MeshSE6v_fesS6v_fesLE> : <6C_args>, <PP6v_fesS>, <PP6v_fesL> )
( <17Call_FormBilinearIN5Fem2D5MeshLE6v_fesLS2_E> : <6C_args>, <PP6v_fesL>, <PP6v_fesL> )
( <15Call_FormLinearIN5Fem2D5MeshLE6v_fesLE> : <6C_args>, , <PP6v_fesL> )
( <17Call_FormBilinearIN5Fem2D5MeshSE6v_fesSS2_E> : <6C_args>, <PP6v_fesS>, <PP6v_fesS> )
( <15Call_FormLinearIN5Fem2D5MeshSE6v_fesSE> : <6C_args>, , <PP6v_fesS> )
( <17Call_FormBilinearIN5Fem2D5Mesh3E6v_fes3S2_E> : <6C_args>, <PP6v_fes3>, <PP6v_fes3> )
( <15Call_FormLinearIN5Fem2D5Mesh3E6v_fes3E> : <6C_args>, , <PP6v_fes3> )
( <17Call_FormBilinearIN5Fem2D4MeshE5v_fesS2_E> : <6C_args>, <PP5v_fes>, <PP5v_fes> )

 Error line number 29, in file Test_meshL_MixedFormulations.edp, before  token )

  current line = 29
Compile error : 
	line number :29, )
error Compile error : 
	line number :29, )
 code = 1 mpirank: 0

Thanks for help !
David & Nabil

Just for information. When we do :

varf Test2(f,glin) =  int1d(Th,7)(f*glin);
matrix Mtest2 = Test2(Vh,Vhlin);

We have the same error message.

Sorry, building matrices from two finite element spaces defined on different mesh types is currently not possible, although it is in the works.
What you can do however, is define a restriction matrix from the 2D to the 1D finite element space, and use that matrix to define the off-diagonal blocks of your coupled problem:

load "isoline"
load "msh3"

// Generating a 2D mesh for a half disk

real R = 1;
border axis(t=-R,R){x=t; y=0;label=6;};
border surface(t=0,pi){x=R*cos(t); y=R*sin(t);label=7;};
mesh Th = buildmesh(axis(20)+surface(30));
plot(Th);

// Extracting the 1D mesh corresponding to the half circle

int[int] l7=[7]; 
meshL Thlin = extract(Th,refedge=l7); //lineic mesh corresponding to boundary 7

// test of mixed problems

fespace Vh(Th,P1); 
fespace Vhlin(Thlin,P1); 

Vh f,g;
Vhlin flin,glin;

varf v(f,g) = int2d(Th)(f*g);
varf vlin(flin,glin) = int1d(Thlin)(flin*glin);

matrix A = v(Vh,Vh);
matrix Alin = vlin(Vhlin,Vhlin);

matrix M = interpolate(Vhlin,Vh);

matrix B = M'*Alin;

matrix Block = [[A, B], [B',Alin]];

display(Block);

Edit: Since the first situation works, you can also simply take the transpose of Mtest1 for the other off-diagonal block

Thanks for the tip !
I also realised that I can simply build it in the other way and transpose.
The ‘interpolate’ solution is fine too ! Some years ago we designed some ugly macros to build such interpolation matrices. Glad to see that it is now built-in.