function uave=ave(u,i,j);
%function uave=ave(u,i,j);
%             u is 2-d, and i and j are index arrays of length size(u)-1;
uave=(u(i,j)+u(i+1,j)+u(i,j+1)+u(i+1,j+1))/4;
