Exchange energies with forces in density-functional theory.