LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Commands

set_type command

Syntax:

set_type group-ID style N 

Examples:

set_type solvent atom 2
set_type edge bond 4 

Description:

Change the atom type (bond type, angle type, etc) for all atoms (bonds, angles, etc) in a particular group. Since types are specified when atoms are created or read in from a data or restart file, this command changes those assignments. This can be useful for altering pairwise and molecular force interactions, since force-field coefficients are defined in terms of types. It can also be used to change the labeling of atoms when they are output in dump files.

For style atom, the atom type of all atoms in the group is changed to the specified value from 1 to ntypes. For style bond (angle, dihedral, improper), the bond type (angle type, etc) of each bond (angle, etc) in the group is changed to the specified value from 1 to nbondtypes (angletypes, etc). All atoms in the bond (angle, etc) must be in the group in order for the change to be made.

Note that new type values must be within the range the simulation was initialized for. In the case of atom types, the maximum number of types is set by the create_box command or the atom types field in the header of the data file read by the read_data command. In the case of bond types (angle types, etc), the maximum number of types is set by the bond types (angle types, etc) field in the header of the data file.

Restrictions:

This command requires inter-processor communication to coordinate the setting of bond types (angle types, etc). This means that pairwise force cutoffs must be already be set before using this command, so that each processor can acquire the correct atoms. This is not necessary to reset atom types.

Related commands:

create_box, read_data

Default: none