Add atoms to a dynamic group

Dear all,

I want to add atoms to a dynamic group that have the same molecule ID as atoms already in the group. It worked with a static group. However, when I used the “group groupID include molecule” command for a dynamic group, it didn’t work. Anyone knows how to solve this problem? Thx

Static group:
group mobile1 region d1
group mobile1 include molecule

dynamic group:
group mobile1 dynamic all region d1 every 100
group mobile1 include molecule

Luo

Dear all,

I want to add atoms to a dynamic group that have the same molecule ID as
atoms already in the group. It worked with a static group. However, when
I used the “group groupID include molecule” command for a dynamic group, it
didn't work. Anyone knows how to solve this problem? Thx

​you cannot do this. the expression for the dynamic group is regularly
re-evaluated and the dynamic group thusly redefined. any other additions
will be lots at that point.

the way to work around this limitation is to define the dynamic group via
an atom style variable. the variable has to evaluate to non-zero for atoms
in the group and 0 for atoms outside. you can access region membership as
well as group membership this way (and more complex relations).

axel.​

1 Like