0001 function arrowplot(p,wnr,cnr)
0002
0003
0004 figure(wnr);n0=(cnr-1)*p.np+1; n1=cnr*p.np;
0005 pdeplot(p.points,p.edges,p.tria,'xydata',p.u(n0:n1));
0006
0007
0008 nx=20; ny=10; x=p.points(1,:)'; y=p.points(2,:)';
0009 xmin=min(x); xmax=max(x); ymin=min(y); ymax=max(y);
0010 xg=linspace(xmin,xmax,nx);yg=linspace(ymin,ymax,ny);
0011 ug=tri2grid(p.points,p.tria,p.u(1:p.np),xg,yg);
0012 [DX,DY] = gradient(ug);
0013
0014 figure(wnr); hold on;
0015 quiver(xg,yg,-DY,DX,1,'LineWidth',1,'Color','black');
0016 axis tight; hold off;