Hello everyone,

I have compiled the developer version of FreeFem to have my hands on mmg2d function and created the attached mesh where the flower like geometry is defined by a level set function as:

A = x^2 + y^2;

ls = sqrt(A) - 0.27 - 0.27 * 2*cos(3*atan2(x, y));

Now what I want is to rotate the flower counterclockwise and see the deformed mesh after this rotation. When I use movemesh function, the square mesh is rotated rather than the flower gometry, hence no deformation occurs, as seen in attached figure.

Can anyone know how to rotate the level set defined flower geometry and create a deformed mesh while keeping the square mesh stable?

Here is the code I use:

load “mmg”

real x0 = -1.0;

real x1 = 1.0;

real y0 = -1.0;

real y1 = 1.0;

int n = 100;

real m = 100;

mesh Th = square(n, m, [x0+(x1-x0)x, y0+(y1-y0)atan2(x, y));y]);cos(3

fespace Vh(Th, P1);

Vh A = x^2 + y^2;

Vh ls = sqrt(A) - 0.27 - 0.27 * 2

Th = mmg2d(Th, iso = 1, ls = 0.0, metric = ls[ ], hmax = 0.1);

func phi1=x * cos(10) + y * sin(10);

func phi2=-x * sin(10) + y * cos(10);

Th = movemesh(Th, [phi1, phi2]);

Th = trunc(Th, region == 2);

plot(Th);

Thank you