func meshS buildmeshS(meshL & TL,int orientation,int minsurf) { int withp=0; if(withp) plot(TL,wait=1); // calcul du barycentre de TL; real lg=int1d(TL)(1.); R3 B(int1d(TL)(x)/lg, int1d(TL)(y)/lg, int1d(TL)(z)/lg); if(verbosity>2) cout <<" Barycenter: " << B << endl; R3 NL(int1d(TL,qforder=1)((Tl^(P-B)).x),int1d(TL)((Tl^(P-B)).y),int1d(TL)((Tl^(P-B)).z)); NL /= NL.l2; if(verbosity) cout << " NL = "<< NL << endl; R3 U0 = (B-TL(0).P); R3 V = U0^NL; V /=V.l2; R3 U = V^NL ; if(verbosity>5) cout << " det = " << det(U,V,NL) << " == " << 1 << endl; assert(abs(det(U,V,NL)-1)< 1e-6); if(verbosity>2) cout << " New Frame : "<< U << " , " << V << " , " << NL << endl; real bu = U'*B, bv=V'*B, bn = NL'*B; meshL TLm = movemeshL(TL,transfo=[U'*P-bu,V'*P-bv,NL'*P-bn]); meshL TL0 = movemeshL(TL,transfo=[U'*P-bu,V'*P-bv,0]); fespace VLm(TLm,P1); VLm zLm = z; fespace VL0(TL0,P1); VL0 zL0; zL0[]= zLm[]; mesh Th = buildmesh(TL0,fixeborder=1); real[int] bb(4); boundingbox(Th,bb); if(verbosity>5) cout << " bb = "<< bb << endl; real lTh = max(bb[1]-bb[0],bb[3]-bb[2]); // lg characteristic of Th if(withp) plot(Th,TLm,wait=1); fespace V2(Th,P1); V2 g=zL0; real ginf =g[].linfty; if(verbosity>5) cout << " ginf "<< ginf << " " << lTh << endl; real errf = 0.1*g[].linfty/lTh;// err fixe point real errN = 1e-6*g[].linfty/lTh;// err newton.. V2 u=0,v,up; macro grad(u) [dx(u),dy(u)]// int[int] labs=labels(Th); int nbiter = 100; if( minsurf == 0 || ginf < 1e-3*lTh) nbiter = 1; for(int i=0; i< nbiter; ++i) { up[]=u[]; solve Pb(u,v) = int2d(Th)( (dx(u)*dx(v) + dy(u)*dy(v) ) / sqrt( 1+ (dx(up)*dx(up) + dy(up)*dy(up) )) ) +on(labs,u=g); real area = int2d(Th)( sqrt(1+ (dx(u)*dx(u) + dy(u)*dy(u) ))); up[] -= u[]; real err= up[].linfty ; if(verbosity) cout << i << " fixed point, surface = "<< area<< " err infty = " << err << "/" << errf << endl; if(withp) plot(u, dim=3,fill=3, cmm=i+" area="+area+" err= "+err); if(err