What are the conditions necessary for a terrestrial planet to have a strong magnetic field?.