Continuous and discrete modelling of failure in geomechanics