Transient analysis of 1D inhomogeneous media by dynamic inhomogeneous finite element method