Groups with cylinder problem

Dear LAMMPS users,

I have some misunderstanding about how groups are working lammps.
Below is the description of my experiment and explanation of what
exactly I can't understand.

I use two regions:
region intube cylinder z 0.0 0.0 5.0 -10 10
region outtube cylinder z 0.0 0.0 5.0 -10 10 side out

And 3 groups:
group freeatoms region intube
group frozenatoms region outtube
group inter intersect freeatoms frozenatoms

I checked 2 cases:
Case 1. I f I use particles generated on regular grid (create_atoms)
than inter group is empty (as expected)
Case 2. If I use restart file with randomized particles then inter
group contains 500 elements.

I could not find why these two cases produces different results.
I thought that it might be accuracy problem of RegCylinder::inside
method (but 5% is too big) and changed it to get rid of sqrt and
introduced epsilon but it didn't help.
I attached the script I wrote for this case, tar file contains restart
file which contains randomly distributed particles.

in.emptyTube (1.15 KB)

emptyTube.restart.tar (314 KB)

You should make sure you understand the difference between
lattice and box units when defining a region in both your runs.
This confuses people sometimes.

I would simply dump the initial coords of the atoms in
the intersection group. It should then be simple
to verify they are indeed in both of the other groups.

Steve

Dear Steve Plimpton,

Thank you for the answer. I have scale 1.0 (I defined the custom
lattice, see script attached). I dumped intersection - it is not
empty. I don't understand why the intersection of two groups based on
regions which must not intersect each other may have not empty
intersection:

region intube cylinder z 0.0 0.0 5.0 -10 10
region outtube cylinder z 0.0 0.0 5.0 -10 10 side out
group freeatoms region intube
group frozenatoms region outtube
group inter intersect freeatoms frozenatoms

I can, of course, define frozenatoms groups as following:

group frozenatoms subtract all freeatoms

and in this case intersection is empty. Yet in this case freeatoms
group will have 10% more particles that I would expect taking into
account cylinder volume and density (3.0).

Correct me if I'm wrong, but what my understanding of the groups is is the
following. When you do a restart command you also redefine the groups in
your script.

As the groups already exist (because they are read from the restart file),
it just adds particles to the groups that are not yet part of that group.
It will not remove particles already part of the group. As the frozen
atoms do not move, they can not be added to the free particles. However,
the free particles can move in the area of the frozen particles and
therefore become part of the frozen group too.

What you want, I guess, is to remove the definitions of the groups after
you do a restart, as they are already present in the restart file.

Regards,
Bart

Thank you, Bart. I thought that groups are not saved in restart.
I can just generate restart file with a different script - without any
groups. And then read it current script and add groups.

Groups are saved in the restart file. See the read_restart
doc page.

Steve