Impact damage simulation in elastic and viscoelastic media