The particle-in-cell model for ab initio thermodynamics: implications for the elastic anisotropy of the Earth's inner core