splitmesh () cannot work for a region with a hole, for example:
border a1(t=0,1) {x=t; y=0 ;label=1;};
border a2(t=0,1) {x=1; y=t ;label=2;};
border a3(t=1,0) {x=t; y=1 ;label=3;};
border a4(t=1,0) {x=0; y=t ;label=4;};
//hole
real r=0.15, x0=0.5, y0=0.5;
border disc(t=0, 2*pi) {x=x0+r*cos(t); y=y0+r*sin(t); label=5;};
int m=30;
mesh Th = buildmesh(a1(10)+a2(10)+a3(10)+a4(10)+disc(-m));
plot(Th, wait=1);
func SplitRegion= x<0.15? 3:1;
Th = splitmesh(Th, SplitRegion);
plot(Th,wait=1);
The above code works perfectly well if there is not hole, such as
disc(m)
instead of
disc(-m)
Anyone ideas? Thanks a lot in advance.