Influence of magnetic field on microstructural and dynamic properties of sodium, magnesium and calcium ions