Auto-determination of grid parameters