Simulation of transient temperature and stress field in the polymer extrusion additive manufacturing processes