By carefully choosing parameters and including more semi-core orbitals as valence electrons, we have constructed a high-quality projected augmented wave dataset that yields results comparable to existing full-potential linearized augmented plane-wave calculations. The dataset was then applied to BaFe2As2 to study the effects of different levels of structure optimization, as well as different choices of exchange-correlation functionals. It was found that the local density approximation exchange-correlation functional fails to find the correct spin-density-wave anti-ferromagnetic (SDW-AFM) ground state under full optimization, while the Perdew-Burke-Ernzerhof (PBE) exchange-correlation functional obtains the correct state but significantly overestimates the magnetism. The electronic structure of the SDW-AFM state is not very sensitive to structure optimizations with the PBE exchange-correlation functional because the positions of the As atoms are preserved under optimizations. We further investigated the Ba atom diffusion process on the BaFe2As2 surface using the nudged elastic bands method. The Ba atom was found to be stable above the center of the squares formed by the surface As atoms, and a diffusion barrier of 1.2 eV was found. Our simulated scanning tunneling microscopy image suggests an ordered surface Ba atom structure, in agreement with Massee et al (2009 Phys. Rev. B 80 140507; van Heumen E et al 2010 arXiv:1009.3493v1).