Smart repair of various materials