Discontinuous mechanical problems studied with a peridynamics-based approach