Changing the atoms' group dynamically based on their types

Dear all,

I’d like to use dynamic style of group command, based on the atoms’ type: in my system, the type of the atoms can change based on some conditions. Then, the atoms’ movement of the new type should be restricted along the z axis. To do so, I need to identify these atoms as members of a group.

I tried “group new dynamic all type 4”, but obviously I’m making a mistake, because this line produces the “Illegal group command” error; however, unfortunately, I couldn’t figure out how to solve this problem with reading through the manual.

Is it the case that the dynamic option works only with “region”, and not “type”? I’d appreciate any comment on this issue and possible solutions.

With regards,
Soheil

Dear all,

I'd like to use dynamic style of group command, based on the atoms' type:
in my system, the type of the atoms can change based on some conditions.
Then, the atoms' movement of the new type should be restricted along the z
axis. To do so, I need to identify these atoms as members of a group.

I tried "group new dynamic all type 4", but obviously I'm making a
mistake, because this line produces the "Illegal group command" error;
however, unfortunately, I couldn't figure out how to solve this problem
with reading through the manual.

but ​it *is* all​ spelled out in the documentation; you are not reading it
careful enough. there are only two options available for dynamic groups:
selection by region or selection by variable. since the former is not
applicable, it would have to be done by the latter. and defining a suitable
atom style variable is extremely trivial.

​axel.​