Finite element method for viscoelastic medium with damage and the application to structural analysis of solid rocket motor grain