I have a finite-difference 1-dimensional velocity field which I want to import to FreeFem. I perform the following task on FreeFem to record the velocity field in tempx.
Wh tempx;
{
ifstream file(“velfield.txt”);
file >> val;
};
real[int] xx(1000),yy(1000),ux(1000);
for (int i=0;i<yy.n;i++){
xx(i) = 0.;
yy(i) = val(i,0);
ux(i) = val(i,1);}
matrix Ixx = interpolate(Wh,xx,yy,op=0,composante=0);
tempx[] = Ixx*ux;
Now I create another mesh that is different from the one earlier and try to interpolate the velocity field using these lines.
Whr tempxx;
tempxx=tempx;
But the velocity field is not interpolated properly. Any suggestions?