On the use of nonuniform grids in finite-difference equations