Seol mar théacs é seo: Variational determination of eigenstrain sources of residual stress