Energy analysis of crack-damage interaction