Plot of diplacement field

Hi! I’ll try to explain my problem as briefly as possible. The setting is this:

fespace Vh(Th,[P1,P1]);
macro u [u0,u1] //
Vh u;

I find the displacement u as a solution of an elasticity problem. I’ve done the following plot:

plot(Th,[u0,u1], ps=“displ.eps”,wait=false,fill=true);

and the one with the deformed mesh using movemesh, and everything was perfect.
But I would like to plot the displaced configuration: ruffly speaking, I would like to plot the field defined by x+u(x) instead of the one defined by u(x).
At every attempt such us plot(Th,[x,y]+[u0,u1],…) (I think this makes no sense, but I don’t know how to do better) the following error occurs:

Compile error : plot of array with wrong number of components (!= 2 or 3)

and I have no idea how to fix the problem and traslate the displacement field. I would be incredibly grateful if someone could help be. Thank you very much!

mesh Th = square(10, 10);
fespace Vh(Th,[P1,P1]);
macro u [u0,u1] //
macro v [v0,v1] //
Vh u;
Vh v;
v = [u0 + x, u1 + y];
1 Like

Thank you so much!!!