Dear Lammps users,
I am using “chain.f” file to generate initial polymer configuration. However, I had to
modify it to suit my interest. I understood the program except for the part where
image flags are generated. The program has a comment “includes image flags in data file so chains can be unraveled later”.
And the chunk of code where the image flags are generated is a bit confusing for me
if (abs(x(n)-x(n-1)) < 2.0*bondlength(iset)) then
imagex(n) = imagex(n-1)
else if (x(n) - x(n-1) < 0.0) then
imagex(n) = imagex(n-1) + 1
else if (x(n) - x(n-1) > 0.0) then
imagex(n) = imagex(n-1) - 1
and similar chunks for y and z coordinates also. I don’t understand this part. Can anyone help me with this. Thanks in advance.