A computational method to predict elastic-plastic fracture