Thermal stress
In mechanics and thermodynamics, thermal stress is mechanical stress created by any change in temperature of a material. These stresses can lead to fracturing or plastic deformation depending on the other variables of heating, which include material types and constraints. Temperature gradients, thermal expansion or contraction and thermal shocks are things that can lead to thermal stress. This type of stress is highly dependent on the thermal expansion coefficient which varies from material to material. In general, the greater the temperature change, the higher the level of stress that can occur. Thermal shock can result from a rapid  change in temperature, resulting in cracking or shattering. Temperature gradients. When a material is rapidly heated or cooled, the surface and internal temperature will have a difference in temperature. Quick heating or cooling causes thermal expansion or contraction respectively, this localized movement of material causes thermal stresses. Imagine heating a cylinder, first the surface rises in temperature and the center remains the same initial temperature. After some time the center of the cylinder will reach the same temperature as the surface. During the heat up the surface is relatively hotter and will expand more than the center. An example of  this is dental fillings can cause thermal stress in a person's mouth. Sometimes dentists use dental fillings with different thermal expansion coefficients than tooth enamel, the fillings will expand faster than the enamel and cause pain in a person's mouth. Thermal expansion and contraction. Material will expand or contract depending on the material's thermal expansion coefficient. As long as the material is free to move, the material can expand or contract freely without generating stresses. Once this material is attached to a rigid body at multiple locations, thermal stresses can be created in the geometrically constrained region . This stress is calculated by multiplying the change in temperature, material's thermal expansion coefficient and material's Young's modulus (see formula below). formula_1 is Young's modulus, formula_2 is thermal expansion coefficient, formula_3 is initial temperature and formula_4 is the final temperature. When formula_4 is greater than formula_3, the constraints exert a compressive force on the material. The opposite happens while cooling; when formula_4 is less than formula_3, the stress will be tensile. A welding example involves heating and cooling of metal which is a combination of thermal expansion, contraction, and temperature gradients. After a full cycle of  heating and cooling, the metal is left with residual stress around the weld. Thermal shock. This is a combination of a large temperature gradient due to low thermal conductivity, in addition to rapid change in temperature on brittle materials. The change in temperature causes stresses on the surface that are in tension, which encourages crack formation and propagation. Ceramics materials are usually susceptible to thermal shock. An example is when glass is heated up to a high temperature and then quickly quenched in cold water. As the temperature of the glass falls rapidly, stresses are induced and causes fractures in  the body of the glass which can be seen as cracks or even shattering in some cases.