load "distance"
mesh Th=square(10,10);
Th=adaptmesh(Th,0.03,IsMetric=1);
fespace Vh(Th,P1);
varf vong(u,v)= on(1,u=1);
real[int] ong=vong(0,Vh);
Vh u =1,v, e=y;
u[] = ong ? 0 : u[]; 
//plot(u,wait=1);
//verbosity = 10000; 
//savemesh(Th,"Th.msh"); 
distance(Th,u,v[]);
//for (int i=0;i<v[].n; ++i)
// cout << i << " " << v[][i] << " "<< e[][i] <<  endl;  
e = v-y;
cout << "err = "<< e[].linfty << endl; 
plot(e, wait=1);
assert( e[].linfty < 1e-5);// not really exact F. Hecht but small 
