An energy method to analyze through thickness thin film fracture during indentation