Reproducibility of GenGeo models

Asked by Michele Griffa

Dear ESyS-Particle developers/users,

I'm facing this issue related with multiple realizations of a GenGeo model.

First of all, the GenGeo model I have is a 2D bead pack made of three parts.
Two of them consist in assemblies of bonded particles, having the same features but located at different positions in space (one assembly at the top, the other at the bottom of the overall simulation domain).
The third part consists in an assembly of unbonded particles (in between the top and bottom layers).

In my GenGeo script I have 3 subroutines for the three respective assemblies.

I want to create multiple realizations of the same model. Only the central assembly/layer of particles should change randomly.
The top and bottom layers should remain the same across the multiple realizations.

The top and bottom layers' subroutines use the same packers, because they are essentially equal, mirroring each other.
The central layer uses its own packer.

To produce the different, random realizations of the model, I included the argument "seed", with value "True", for the central layer's packer, as suggested in thread #181896.
Indeed, the central bead packing changes across the multiple realizations.
However, the two other packings change too.

I can provide the code of the GenGeo script to anyone interested in this issue.

Is this issue arising because I'm forgetting something or because the top/bottom packing is made of bonded particles ?

As usual, thanks a lot for the support.

I take the occasion to wish to ESyS-Partickle's developers/users (and to anyone else reading this thread) Best Seasons Greetings.

Best regards.

Michele

Question information

Language:
English Edit question
Status:
Solved
For:
ESyS-Particle Edit question
Assignee:
No assignee Edit question
Solved by:
Michele Griffa
Solved:
Last query:
Last reply:
Revision history for this message
SteffenAbe (s-abe) said :
#1

Hi Michele,

the behaviour you're seeing is possibly due to the fact that all packers are using the same (system) random number generator, i.e. once you've re-seeded the RNG by calling a Packer with seed=True it stays re-seeded. An option to obtain "partially different" models _might_ be (i.e. I haven't tested this) to do the unchanged (seed=False) packing first and the changing (seed=True) afterwards.

Steffen

Revision history for this message
Michele Griffa (michele-griffa) said :
#2

Hello Steffen

Thanks for the suggestion.
You were right. I was calling first the packer that needed the member "seed = True", then the other two packers.
Swapping the order of the packer did the job properly.

I add here a few more details of other things that I did need to change, in case someone else reading this thread may encounter similar problems.

The three boxes corresponding to the three respective model's parts have a little bit of overlapping with each other.
The overlapping was originally needed to make sure that driving walls got perfectly bonded to the top and bottom parts, respectively.

In the original GenGeo script I was calling first the three packers, then the subroutines for the actual generation of the three particle assemblies, using the packers. The change of the initial seed of the random number generator for InsertGenerator2D(...), in the case of the central layer of particles, was producing changes of realization also for the other two parts.
I simply swapped the order of the definition of the packers and of the calls to the subroutine:

first the packers for the top and bottom layers, that have to remain identical, then the subroutines creating the respective particle assemblies, then the packer for the central layer, that has to change with the realization and finally the subroutine creating it.

This sorting of the script's different parts works fine in creating the model, as long as one can judge from the .vtk and .geo files produced as output.

Thanks a lot again and Best Season's Greetings

Revision history for this message
Gonzalo Tancredi (gonzalo) said :
#3

Hi Michele

Could you exchange the script with us?
I would like to have a look on how you implement it.

Regards

Gonzalo