I have a sparse values of the velocity field at the inlet of channel. I would like to interpolate the velocity field at the inlet over the fine grid mesh. I am using the interpolate command from FreeFem++ to use the information at a particular value of x (=0 at Inlet) and different values of y and interpolate that onto the fine grid defined on Wh space.

real[int] xx=[0., 0., 0., 0., 0., 0.,0.];

real[int] yy=[0.2, 0.4, 0.6, 0.8, 1.0, 1.2, 1.4];

matrix Ixx = interpolate(Wh,xx,yy,op=0,composante=0);

And then use for velocity, u[]=Ixx*usp; where usp is of size 7 representing the sparse velocity values. So for the inlet velocity conditions I use on 1, ux=u, where 1 represents label for inlet. Is this the right way of implementing the boundary condition or there is an easy way of doing this?