real om=50; int n =4; border a(t=0,1) {x=5; y=1+2*t;} border b(t=0,1) {x=5-2*t; y=3;} border c(t=0,1) {x=3-2*t; y=3-2*t;} border d(t=0,1) {x=1-t; y=1;} border f(t=0,1) {x=0; y=1-t;} border g(t=0,1) {x=t; y=0;} border h(t=0,1) {x=1+4*t; y=t;} border e1(t=2*pi, 0) {x=1.5+0.08*cos(t); y=0.1+0.3 +0.14*sin(t);} border e2(t=2*pi, 0) {x=2.5+0.08*cos(t); y=0.1+0.6 +0.14*sin(t);} border e3(t=2*pi, 0) {x=3.5+0.08*cos(t); y=0.1+0.85+0.14*sin(t);} border e4(t=2*pi, 0) {x=4.5+0.08*cos(t); y=0.1+1.1 +0.14*sin(t);} mesh th=buildmesh(a(3*n) + b(3*n) + c(6*n) + d(2*n) + f(2*n) + g(2*n) + h(6*n) + e1(2*n) + e2(2*n) + e3(2*n) + e4(2*n)); plot(th, wait=1); fespace Vh(th, P1); fespace Ph(th, P0); Ph ff = (sin(x-0.45)^2 + cos(y-0.45)^2)<0.45; Vh u, v; problem concert(u, v) = int2d(th)(om*u*v - dx(u)*dx(v)-dy(u)*dy(v)) + int2d(th)(-ff*v) + on(a,b,c,d,f,g,h,e1,e2,e3,e4,u=0); concert; plot(u,wait=1); th=adaptmesh(th,u,err=0.01); plot(th, wait=1); concert; plot(u,wait=1);