SMS: A generic ionic potential for the alkaline-earth oxides and the anomalous crystal structure of ZnO