generate grid from input files