Optimum design of double-layer grids