See basis functions using medit.
P0edge view with medit | P0edge view with plot | P2 view with medit | P2 view with plot |
Using on Th2 Finite elementes P0edge and P2
download example: FE-medit.edp or return to 2D examples
int n=20,nn=n+10; real[int] xx(nn),yy(nn); // build square $]-1,1[^2$ mesh Th2=square(2,2,[2*x-1,2*y-1]); mesh Th=square(100,100,[2*x-1,2*y-1]); fespace Wh(Th2,P0edge); Wh w=0; fespace Vh(Th,P1); w[]=0; w[][6]=1; Vh u=w; plot(u,Th2,wait=1); savemesh(Th,"mm",[x,y,u*.5]); // save mm.points and mm.faces file for medit // build a mm.bb file { ofstream file("mm.bb"); file << "2 1 1 "<< u[].n << " 2 \n"; int j; for (j=0;j<u[].n ; j++) file << u[][j] << endl; } // call ffmedit command exec("ffmedit mm"); // clean files exec("rm mm.bb mm.faces mm.points");