Variational fracture mechanics to model compressive splitting of masonry-like materials