load "msh3" include "test.idp" cout << functionDEFINITION << "on" << endl; real t; border C(t=0, 2*pi){x=cos(t); y=sin(t);} mesh Th = buildmesh(C(5)); fespace Vh(Th, P1); Vh u, v; func f = x*y; t = clock(); solve Poisson (u, v) = int2d(Th)( dx(u)*dx(v) + dy(u)*dy(v) ) - int2d(Th)( f*v ) + on(C, u=1); t = clock() - t; cout << timeELAPSED << t << endl; test(u(1., 0.) == 1); t = clock(); varf vBound(u, v) = on(C, u=1); real[int] bound = vBound(0, Vh); t = clock() - t; cout << timeELAPSED << t << endl; for (int i = 0; i < Vh.ndof; i++) test(bound[i] == tgv); { mesh3 Th3 = buildlayers(Th, 5, zbound=[0, 1]); fespace Vh3(Th3, P1); Vh3 u3, v3; t = clock(); solve Poisson3 (u3, v3) = int3d(Th3)( dx(u3)*dx(v3) + dy(u3)*dy(v3) + dz(u3)*dz(v3) ) - int3d(Th3)( f*v3 ) + on(C, u3=1); t = clock() - t; cout << timeELAPSED << t << endl; test(u(1., 0.) == 1); t = clock(); varf vBound(u3, v3) = on(C, u3=1); real[int] bound = vBound(0, Vh3); t = clock() - t; cout << timeELAPSED << t << endl; for (int i = 0; i < Vh3.ndof; i++) test(bound[i] == tgv); }