LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Commands

group command

Syntax:

group ID style args 

Examples:

group edge region reg1 reg2
group water type 3 4
group sub id <= 150
group polyA molecule <> 50 250
group boundary join lower upper
group boundary subtract all a2 a3
group boundary intersect upper flow 

Description:

Identify a collection of atoms as belonging to a group. The group ID can then be used in other commands such as fix, velocity, dump, or temperature to act on the atoms together.

If the group ID already exists, the group command adds the specified atoms to the group.

The region style puts all atoms in the listed regions into the group. An atom must be contained in each of the regions to qualify. If you want to add atoms to the same group that are in geometrically distinct regions, use the group command multiple times.

The type, id, and molecule styles put all atoms with the specified atom types, atom IDs, or molecule IDs into the group. These 3 styles can have their arguments specified in one of two formats. The 1st format is a list of values (types or IDs). For example, the 2nd command in the examples above, puts all atoms of type 3 or 4 into the group named water. The 2nd format is a logical followed by one or two values (type or ID). The 5 valid logicals are listed above. All the logicals except <> take a single argument. The 3rd example above adds all atoms with IDs from 1 to 150 to the group named sub. The logical <> means "between" and takes 2 arguments. The 4th example above adds all atoms belonging to molecules with IDs from 50 to 250 (inclusive) to the group named polyA.

The join style takes a list of one or more existing group names as arguments. All atoms that belong to any of the listed groups are added to the specified group.

The subtract style takes a list of two or more existing group names as arguments. All atoms that belong to the 1st group, but not to any of the other groups are added to the specified group.

The intersect style takes a list of two or more existing group names as arguments. Atoms that belong to every one of the listed groups are added to the specified group.

A group with the ID all is predefined. All atoms belong to this group.

Restrictions:

There can be no more than 32 defined groups, including "all".

Related commands:

region, fix, velocity, dump, temperature

Default:

All atoms belong to the "all" group.