You've probably found the answer by now, but you can always use the strain softening/hardening model that is built into the code. It is the "model ss". Information can be found in the Constitutive Models Manual from Itasca. This is applicable for FLAC 2D. I'm not sure about other Itasca codes.
This model uses the Mohr-Coulomb model as a basis, meaning it acts the same as the MC model, except for the strain dependent strengths. You can use it to change the friction, cohesion, dilation, and tensile strengths with strain. There is no need to write a whilestepping function or any other specialized FISH function for this to work properly.
Implementing the model is straight forward. Using the property command you assign the initial properties such as cohesion, density, et cetera. Using the property command you can also assign a table number for each strength property that will change with strain (ftab, ctab, dtab, and ttab). If you want to vary the cohesion with strain for instance, then the following commands would work:
model ss
prop s=1e6 b=1e7 d=3.5 ctab=1
In the above the G, K, rho are assigned, and then table 1 is assigned to the ctab variable. The strain versus strength function that is required, is assigned in table 1. This is done on a separate line using the table command, as follows:
table 1 0,1000 0.01,800 0.10 500
The above command assigns 1,000 psf at a strain of 0%, 800 psf at a strain of 1%, and 500 psf at a strain of 10%.
"The above command assigns 1,000 psf at a strain of 0%, 800 psf at a strain of 1%, and 500 psf at a strain of 10%. "
shall be changed as
"The above command assigns 1,000 psf at a plastic strain of 0% (starting failure), 800 psf at a plastic strain of 1%, and 500 psf at a plastic strain of 10%. "
The elastic strain up the failure point is ruled by E,v or K, G
If I understand your question, your problem is the reduction of phi, c to calculate FoS of an already implemented strain-softening model (which can be implemented as explained by Navead and Luca).
The strain-softening model implemented in itasca codes is simply a piecewise linear function of c, \phi (or tension strength) vs plastic shear strain (or tensile strain). If you want to reduce c and \phi for each linear segment, I'm not pretty sure if solve fos (method explained by Omar) accept a ss model. The solve fos command have other drawbacks: 1) the fos is searched by a simple bisection method, doing this procedure very slow; 2) the evaluation of convergence of itasca models is not so clear (as is clear in a FEM code which construct a stiffness matrix that can be ill-conditioned), then, a weird algorithm was implemented in solve fos, which also is very time consuming. At the end you can obtain 'curious' results.
Then, to implement your own strength reduction method you only need to iterate over zones (change depending of the version of software) and change the properties depending on the fs (I left below an example code for a MC material in flac). But in your case, you need to change the tables relating c, \phi - plastic strain, and also guaranty the continuity of the strain-softening piecewise function after the strength reduction, then you need to add some additional calculations.
For 3DEC or Udec, you need too iterate first in blocks, and an internal loop on zones)
Thanks very much, everyone for contributing to this thread.
Cristobal Valderrama: Yes, you got my problem right and you are also correct on the solve fos not working for SS material in the ITASCA Codes.
I am trying to implement my own strength reduction method for SS material. I have no problem with MC material. My challenge was on updating the strength properties which I finally managed to resolve but I am not sure the method will work for my problem. I was able to replicate a Slope Stability problem, but my problem is more complicated than that and the failure process in my case does not look right.