  We study the impact of an exchange-reducing defect on a skyrmion for a thin
film of finite thickness. Attraction of the skyrmion to a defect is
demonstrated in a lattice model by computing the micromagnetic energy
accounting for the exchange, Dzyaloshinskii-Moriya interaction, magnetic
anisotropy, and dipole-dipole coupling. The spiraling dynamics of the skyrmion
towards the defect is illustrated by solving numerically the full
Landau-Lifshitz-Gilbert equations on a lattice and, independently, the Thiele
equation, with the two methods in agreement with each other. We find that the
skyrmion deforms when approaching the defect. Deformation is small in the
parameter space far from the phase boundary that determines stability of
skyrmions. It increases dramatically near the phase boundary, leading to the
transformation of the skyrmion by the defect into a snake-like magnetic domain.
