Structure and properties of defects in materials