Discretization effects in the finite element simulation of seismic waves in elastic and elastic-plastic media