The study of the structure of crystals and other solid materials, including lattice structures and defects.