# Questions of mapu and mapt

**URL:** https://community.freefem.org/t/questions-of-mapu-and-mapt/3899
**Category:** General Discussion
**Created:** [May 5, 2025, 2:39pm UTC](https://community.freefem.org/t/questions-of-mapu-and-mapt/3899 "2025-05-05T14:39:46Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![pi.3.141](https://avatars.discourse-cdn.com/v4/letter/p/ecccb3/32.png) [@pi.3.141](https://community.freefem.org/u/pi.3.141)
#### Post date: [May 5, 2025, 2:39pm UTC](https://community.freefem.org/t/questions-of-mapu-and-mapt/3899/1 "2025-05-05T14:39:46Z")

</div>

Dear Freefemers,  
I am trying to understand the use of mapu and mapt features. I follow a few examples from the forum, but the results I obtain are not great.

I have attached a piece of code, demonstrating how I use mapt. It solves the problem **(u2,u2h)\_V2= (f1,u2h(X,Y))\_V1.** For the choices made, **u2 = (x+y)/8**.

The result is just ok for P1 fe space. It is not good at all for other fe spaces.

Anyone can tell what is wrong with this example?  
Thank you!

// example for using mapt  
border b1(t=0,4) {  
if (t\<=1) {x=1; y=t;} else if (t\<=2) {x=2-t; y=1;}  
else if (t\<=3) {x=0; y=3-t;} else {x=t-3; y=0;}  
}  
mesh Th1=buildmesh(b1(40)); // [0,1]x[0,1]  
border b2(t=4,10) {  
if (t\<=5) {x=t-3; y=0;} else if (t\<=7) {x=2; y=t-5;}  
else if (t\<=9) {x=9-t; y=2;} else {x=0; y=11-t;}  
}  
mesh Th2=buildmesh(b1(40)+b2(60)); // [0,2]x[0,2]

fespace V1(Th1,P1);  
V1 u1, u1h, f1=x+y, X=2_x, Y=2_y;

fespace V2(Th2,P1);  
V2 u2, u2h;  
//  
// use mapt to solve: (u2,u2h)\_V2=(f1,u2(X,Y))\_V1.  
// the solution is u2=(x+y)/8.  
//  
varf ma(u2,u2h)= int2d(Th2) (u2_u2h);  
varf ra(u2,u2h)= int2d(Th1,qforder=10,mapt=[X,Y])(f1_u2h);  
matrix M=ma(V2,V2);  
real[int] R=ra(0,V2);  
set(M,solver=LU,master=-1);  
real[int] sol=M^-1\*R;  
u2=sol;   
// we should have u2 = (x+y)/8  
// the result is just ok for P1 fe; it is wrong for other fe spaces  
plot(Th2, u2, value=1, fill=1, wait=1);
