Comparison of residual stress effects on the yielding and fracture of metal and glass composites