Core formation, mantle differentiation and core-mantle interaction within Earth and the terrestrial planets