An Inverse Method for Analyzing Defects in Heterogeneous Materials