Bugfix from John after #51. TODO note for myself. I will soon update the code
I think that there is something missing from your patch: you evaluate k_rel correctly, but this term should then be multiplied with mat[i], like this:
for (size_t i = 0; i < dim * dim; i++)
{
mat[i] = tensor[i] / mat_fac * perm_effstress; // AS:perm. dependent eff stress.
mat[i] *= k_rel; //JNEP
}
break;
With this change the nonlinear term is activated properly, according to my first tests.
Bugfix from John after #51. TODO note for myself. I will soon update the code