verbosity=2;
border aaa(t=0,1){x=t;y=0;};
border bbb(t=0,0.5){x=1;y=t;};
border ccc(t=0,0.5){x=1-t;y=0.5;};
border ddd(t=0.5,1){x=0.5;y=t;};
border eee(t=0.5,1){x=1-t;y=1;};
border fff(t=0,1){x=0;y=1-t;};
mesh Th = buildmesh (aaa(6) + bbb(4) + ccc(4) +ddd(4) + eee(4) + fff(6));
fespace Vh(Th,P1);

Vh u,v,zero;

u=0;
u=0;
zero=0;
func f= 1;
func g= 0;
int i=0;
real error=0.1, coef= 0.1^(1./5.);
problem Probem1(u,v,solver=CG,eps=-1.0e-6) =
    int2d(Th)(  dx(u)*dx(v) + dy(u)*dy(v)) 
  + int2d(Th) ( v*f ) 
  + on(aaa,bbb,ccc,ddd,eee,fff,u=g)  ;
  
real cpu=clock();

for (i=0;i< 5;i++)
{ 
  
  real d = clock();
  Probem1; 
  plot(u,zero,wait=1,ps="Lm"+i+".eps");
  plot(u,zero,wait=1,ps="Lu"+i+".eps");
  Th=adaptmesh(Th,u,inquire=1,err=error);
  cout << " CPU = " << clock()-d << endl;
  error = error * coef;
} ;

 cout << " CPU = " << clock()-cpu << endl;
//  for regtest 
real regvalue=int2d(Th)(u*u);
cout<<"regvalue="<<regvalue<<endl;
