group region include molecule

Hi

I read “group command” in the manual, and found include style with its arg *molecule.*It is useful if molecules straddle the region boundary. Using the group command a 2nd time with include molecule will add those atoms that are outside the region to the group.

I tried with the following command, and it worked fine.

region left block INF 2.0 INF INF INF INF
region right block 2.0 INF INF INF INF INF

group h2o11 region left
group h2o11 include molecule

But then I took this with “dynamic” style, it didn’t work and lammps just gave out the number of atoms actual in the region “left”.

group h2o11 dynamic all region left
group h2o11 include molecule

Could “include molecule” work with “dynamic” ,or I used them in a wrong way ??
Finally, is there any keyword can exclude all the atoms of molecules that straddle the region boundary , opposite to “include molecule” ??

Thanks,
Dai

You can’t modify a dynamic group by trying to add atoms to
it after the fact. A dynamic group does something
simple. It uses its parent group (non-dynamic)
and periodically applies a current condition to
all those atoms (region or variable) to determine
what atoms are now in the dynamic group. That’s it.

Finally, is there any keyword can exclude all the atoms of molecules that straddle the >region boundary , opposite to “include molecule” ??

Not sure I understand. That’s what you have before you
do include molecule in your first example. I.e. you
only had the atoms in the group that were inside the region.

If you mean, can you do the exclusion on-the-fly
as atoms/molecules move in/out of the region,
then that’s what a dynamic group does.

Start with all atoms (or atoms in some set of molecules)
as the parent static group. If you then define a dynamic
group (with that parent) and use the region keyword,

the dynamic group will always contain only the subset

that are in the region.

Steve