An efficient thermal-structural numerical solver for Additive Manufacturing has been developed based on a modified Lagrangian approach to solve the energy conservation equations in differential form. The heat transfer is modeled using the finite difference method applied to a deforming Lagrangian mesh. The structural solver has been enhanced with the proposed effective quasi-elastic differential approach for modeling the elastoplastic behavior of materials. The algorithm is relatively simple to implement yet is highly effective. The solver can predict shape deformations of metal parts printed using the laser powder bed fusion technique. The second key capability of the solver is the auto-compensation of distortions of 3D-printed parts by proposing a corrected geometry of a surface to be printed, in order to ensure minimal deviation of the actual printed part from the desired one, even under non-optimal operating conditions or for complex shapes. All the simulation results have been verified in real-life experiments for 3D parts of sizes ranging from 10 to 15 mm up to 40 mm.