Numerical simulation method for designing thermomechanical treatments, illustrated by bar rolling