Effect of Heterogeneity on the Failure of Rock with an Initial Crack under Uniaxial Compressions: A Numerical Study