Calculate grid points

Calculate grid points