fixing the borders

special cases for i,j,k = 0 or n_r,n_phi,n_z