border Gamma1(t=0,2*pi) { x = 2*cos(t); y = sin(t); } mesh Th=buildmesh(Gamma1(300)); //mesh Th=square(40,40); fespace Vh(Th,P1); // P1 FE space Vh uh,vh ; // unkown and test function. func f=0; // right hand side function func g=0.; // boundary condition function Vh fh=f ; real eps=1e-10; // in order to have only one solution problem laplace(uh,vh,solver=GMRES,tgv=1e5) = // definion of the problem int2d(Th)(eps*uh*vh+ dx(uh)*dx(vh) + dy(uh)*dy(vh) ) // bilinear form - int2d(Th)(fh*vh) - int1d(Th,Gamma1)( vh*(y*N.x - x*N.y)) ; laplace; // solve the problem plot(uh); // to see the result plot(uh,value=true); cout << "Diff min = "<< uh[].min << " max=" << uh[].max << endl ; // calcul de l'integrale cout << int2d(Th)((dy(uh)+x)^2+(dx(uh)-y)^2) << endl;