Thermo-structural modeling and optimization of metal additive manufacturing.