Crystal structure of ionic compounds