First-principles modelling of Earth and planetary materials at high pressures and temperatures