Stress-assisted formation of surface gratings on polymer films