A relaxation method for calculating detonation in condensed explosives