Stacking faults in materials: principles and methods