Multi-scale nonlinear stress analysis of superconducting magnets