Non-overlapping mesh

Hi to all,

I created in FF+ a domain which is a square [0,3]x[0,3], using the command “square”, then I add a subdomain [0.9,2.1]x[0.9,2.1] using the “+” operator. Finally a subtracted a subdomain [1.05,1.95]x[1.05,1.95] using the “trunc” command.
I would like to ask please,
how can I generate to this domain with a hole a non-overlapping mesh in FF++?
I’m attaching my code.
If one “zoom” the plot of the mesh the overlapping between the domains can be seen.

Best Regards,
Mordechai.

Backward EG.edp (4.0 KB)

You have tons of possibility.

  1. just use trance,
  2. use border with internal border like in https://github.com/FreeFem/FreeFem-sources/blob/master/examples/tutorial/mesh.edp at line 43.

Hello professor Hecht,
Thank you for your reply,

  1. Did you mean just use “trunc” command instead of trance?
  2. I would like to use a uniform mesh where the partitions of the domain in x and y directions are equal. If I use the" border" and the “buildmesh” commands, then FF++ will not generate a uniform mesh on the domain.

Best Regards,
Mordechai.

Yes I mean trunc

like in

mesh Th=square(20,10,[x*2,y]);
mesh Th1= trunc(Th,x<1.2);
mesh Th2= trunc(Th,x>0.8);
// I do a small movemesh tp seee smoe thing on a plot
plot(Th1,movemesh(Th2,[x+0.01,y]),wait=1,cmm=“Th1”);

Thank you very much, Professor Hecht.