  We show how residual stresses emerge in a visco-elastic material as a
signature of its past flow history, through an interplay between flow-modified
microscopic relaxation and macroscopic features of the flow. Long-lasting
temporal-history dependence of the microscopic dynamics and nonlinear rheology
are incorporated through the mode-coupling theory of the glass transition
(MCT). The theory's integral constitutive equation (ICE) is coupled to
continuum mechanics in a finite-element method (FEM) scheme that tracks the
flow history through the Finger tensor. The method is suitable for a
calculation of residual stresses from a "first-principles" starting point
following well-understood approximations. As an example, we calculate within a
schematic version of MCT the stress-induced optical birefringence pattern of an
amorphous solid cast into the shape of a slab with a cylindrical obstacle and
demonstrate how FEM-MCT can predict the dependence of material properties on
the material's processing history.

Soft Condensed Matter;Fluid Dynamics