Application of shakedown theory to damaging inelastic material under mechanical and thermal loads