Dmoreno
Dmoreno

Reputation: 31

Adaptive mesh in FreeFem++

I'm trying to improve my FreeFem++ code by adapting my initial mesh at certain time steps but FreeFem++ comes up with this error message:

Exec error : Try to get unset x,y, ...

after the mesh is indeed adapted. The problems seems to appear when computing the solution in the new mesh, but I haven't had this problem in other cases though. This is how I adapt the mesh in FreeFem++ and update the variables:

Th = adaptmesh(Th,[u1,u2]);
plot(Th);
u1 = u1;
u2 = u2;
p  = p;

but now I'm confused on how to proceed after the warning message.

Does anybody know how to solve this? Any piece of advice will be appreciated.

Thanks!

Upvotes: 3

Views: 1598

Answers (1)

Anh-Thi DINH
Anh-Thi DINH

Reputation: 2374

I know this is a very old question, but my following answer is for those who still want to.

I ran into the same error when trying to output (cout) a FE variable uh, it's solved if we try uh[] instead. In this case, it's an array.

Vh uh = x;
cout << uh << endl; // error
cout << uh[] << endl; // good

Hope you can check the same thing for your problem.

Upvotes: 5

Related Questions