Study of the compressive failure of a semi-infinite elastic material with a harmonic potential