Implicit yield function formulation for granular and rock-like materials