thresholdings_edp.edp

load "thresholdings" 
mesh Th = square(2,2); 
fespace Xh(Th,P1); 
Xh u,v; 
macro grad(u)[dx(u),dy(u)] // EOM 
func f=1; 

varf Lapl(u,v) = int2d(Th)( grad(u)'*grad(v) ) + int2d(Th)( f*v );   // ' for emacs 

matrix M=Lapl(Xh,Xh); 

cout << M << endl; 
M.thresholding(0.7);// remove all term less then 0.7 
cout << M << endl;