Simulation Of Residual Stress Generation In Additive Manufacturing Of Complex Lattice Geometries