  Starting from the orthorhombic magnetically ordered phase, we investigate the
effects of uniaxial tensile and compressive stresses along a, b, and the
diagonal a+b directions in BaFe2As2 and CaFe2As2 in the framework of ab initio
density functional theory (DFT) and a phenomonological Ginzburg-Landau model.
While -contrary to the application of hydrostatic or c-axis uniaxial pressure-
both systems remain in the orthorhombic phase with a pressure-dependent nonzero
magnetic moment, we observe a sign-changing jump in the orthorhombicity at a
critical uniaxial pressure, accompanied by a reversal of the orbital occupancy
and a switch between the ferromagnetic and antiferromagnetic directions. Our
Ginzburg-Landau analysis reveals that this behavior is a direct consequence of
the competition between the intrinsic magneto-elastic coupling of the system
and the applied compressive stress, which helps the system to overcome the
energy barrier between the two possible magneto-elastic ground states. Our
results shed light on the mechanisms involved in the detwinning process of an
orthorhombic iron-pnictide crystal and on the changes in the magnetic
properties of a system under uniaxial stress.
