Defects in materials or Thermodynamics