Temperature-induced morphology control in the polymer-foaming process