Goodmorning,
I am encountering a problem using dynamic groups and I am a bit lost in finding an explanation. It is possible that it is just a silly bug in my script, in case I apologize for the time loss (and for the long mail).
I have a configuration where I randomly pick atoms in a defined region and, eventually, delete them. I implement this in the following way (see attached script):
- I read the configuration, define the geometric region of interest for the sampling and put the atoms in a STATIC group (“GBat”)
- I defining a “compute chunk/atom” with the option “compress yes” to create a new set of identities sequentially numbered for the atoms in the static group and a random variable “c” that takes values between 1 and Ngb (number of atoms in the group)
- I define a dynamic group (“to_del”) in which I will put just one atom, the one with chunk_ID equal to the random number “c”. This is done by using the variable “id_GB”
The dynamic group is empty for the moment. What I do next:
-
I perform a first energy minimization, the group “to_del” is updated and now contains 1 atom (NB. it is possible that the atom has a low probability of being deleted. In that case, further random extractions adn update of the dynamic group are performed by using a “run 0”)
-
I delete the atom and the dynamic group “to_del” becomes empty
-
I perform a second energy minimization to calculate the system energy with (N-1) atoms. Automatically, the dynamic group is updated and contains a new atom after the minimization.
-
I decide if accepting the trial move or not and then iterate.
What happens is that sometimes after step 3) the dynamic group is still empty. What is strange is that if I print a dump file, THERE IS an atom with chunck_ID equal to the random number “c” (i.e. variable “id_GB”==1) and belonging to the group “GBat” (parent group on which the dynamic group “to_del” is defined). So it should be put in the dynamic group!
Moreover, if I print 2 dump files, with the same output but different parent groups (i.e. using “all” or using “GBat”), I found for the same atom a different value of the variable “id_GB” (in one case it is 1, in one case it is 0). This discrepancy in the dump output can explain why there is no assignment but I can not understand why it happens.
I attached the script, the potential file, and the initial configuration. I run it on the LAMMPS version 8Feb2019, in mpi using 5 processors (changing the number of processors change the result, I suppose because of the random variables). In this case , the atom showing the discrepancy in the output is the number 539 (see sump files 1.dump and 2.dump created when there is no update).
Thank you for your help, best regards
Carolina Baruffi
config.data (34.8 KB)
quasi_MC.in (5.28 KB)
SiC_Erhart-Albe.tersoff (1.65 KB)