Spontaneous pattern formation in superconducting films