How to select atoms with specific requirements in specific group

Hello LAMMPS developers,

Now I face the situation of selecting some atoms with specific requirements in a specific group. Specifically, there are two groups in my system which are liquid and solid groups respectively. I want to select atoms belonging to liquid group but move into one special region during the simulation, and then delete them.

In my opinion, I can use like ‘variable atom expression’ to realize it, with expression like ‘type=1 && z <0.0 &&…’, but the problem is how I can specify the group?

Or dear developers, if I can realize this by other methods?

Thanks a lot.

Best regards,

Please have a look at the gmask(), rmask() or grmask() variable functions for determining membership of individual atoms in a group or region or both. variable command — LAMMPS documentation

You can define individual group based on types or regions or variables, but you can also define groups that are the intersection of two or more existing groups. Using the atom style variable is the more direct approach.

Please also note that groups are evaluated when they are defined and not updated (e.g. when atoms move around) unless you specifically define a dynamic group. For details, please study group command — LAMMPS documentation

Dear Akohlmey,
Thanks a lot. I really appreciate your detailed response and instructions.
Best regards,