Flux pinning in a superconducting film by a regular array of magnetic dots