A Variational principle for nonlocal plasticity