C++ UDM Output in FLAC

Hello all,
I have modified “FLAC Constitutive Model” into a simple strain softening model and tried to run a basic UCS Test using this constitutive model.
For the basic understand of what is happening inside,
I created a variable check which stores the value of iteration for each of the grid.
The part of the code I wrote after
/* — plastic padRameter incrementation and properties update — */ is as follows:
Double dAux = 1.0 / s->getZoneVolume();
if (s->overlay_ == 2) dAux *= 0.5;
sHP_ += s->working_[Dqs] * dAux;
check_ = iteration;
iteration = iteration + 1;
iteration = 0;
I used a Grid of 5 10 so I suppose the values that check_ should take must vary from 0 to 49 for each step and then as iteration value equals 50 it is initialised to 0
So for every step the values for all 50 values should be from 0 to 49.
When I make a DLL file, send it into FLAC plugin and then start the FLAC code of UCS Test using model example.
These are few examples of printing check which I get:
You can see that many times the values are not even incremented.
Due to this issue, I am not able to modify my desired model further. Please look over this issue if it is a bug.

Thanking You

I’m not sure how it is handled in FLAC2D and what exactly the scope of your variables is (e.g. is iteration registered as a property or a global variable?), but you seem to have some general misconceptions about how those constitutive model DLLs work, so maybe these comments help:

  • Usually there are multiple sub-zones per zone, which means that for any given FLAC zone the constitutive model is called multiple times. Therefore your “counting” might be misleading.
  • maybe there is also a conflict in multithreaded environments, since multiple instances may try to increase the parameter, not necessarily ordered (check by calculating single-threaded)

If you want to find out what happens exactly, you should simply debug the DLL, going step by step as the code calculates. In visual studio you can do this by Debug → Link to Process and select your FLAC code. Now you can add breakpoints and then go through your code line by line and see, how these values change. (Never done the for FLAC2D, though).

I hope this helps.