// Solve Poisson equation using matrix synta (18 liens, comments and blank lines included) int n=10; func f=1.; mesh Th=square(n,n); // Define variationnal formulation macro grad(u) [dx(u),dy(u)] // varf a(u,v)=int2d(Th)(grad(u)'*grad(v))+on(1,2,3,4,u=0); varf L(u,v)=int2d(Th)(f*v); // build matrix and seond member fespace Vh(Th,P1); matrix A=a(Vh,Vh); real[int] b=L(0,Vh); // Solve the problem Vh u=0;u[]=A^-1*b; plot(u,wait=1,cmm="Solution of Poisson equation");