Magnetostriction of a hard ferromagnetic and elastic thin-film structure