Optimal choice of grid points in multidimensional pseudospectral Fourier methods