Add option to generate torus grids