LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Commands


Multiple processors are not supported.

This code can be downloaded here , however it is not likely to be supported in the future. As an alternative, try compute cluster/atom: "There is a compute cluster/atom command which will generate a unique ID for all the atoms in individual clusters, defined by a geometric length separation. If you define an atom-style variable that uses the output of that compute, then the set command can be used to set the molecule ID for each atom to the value of the variable, i.e. the cluster ID." -Steve Plimpton, 2015-7-03

fix renum/mol command


fix ID group-ID renum/mol Nevery keyword values ... 


fix 1 all renum/mol 500
fix 1 all renum/mol 500 type 1*3 3*6
fix 1 all renum/mol 500 rmax 2.0
fix 1 all renum/mol 1000 rmax 3.0 ignorebonds
fix 1 all renum/mol 1000 rmax 6.0 type 1 * partial mergeup
fix 1 solutes renum/mol 1000 rmax 4.0 nucleate 1
fix 1 all renum/mol 1000 rmax 4.0 type 4* 4* nucleate 1


This fix renumbers all of the molecule-IDs for all the atoms in the system at regular intervals. Each molecule is given a unique molecule ID equal which is (by default) the lowest atomID of the atoms which belong to it. By default, two atoms are assigned to the same molecule if they are connected by one or more bonds. Additionally, atoms can be assigned to the same molcule whenever they lie within a certain distance of each other, (AND if the satisfy the optional atom-type requirements). (Note: The resulting molecule-ID numbers are often not contiguous.)

This fix can be a useful way to keep track of molecule size distribution during simulations of polymer growth or cross-linking (for example using fix bond_create command). This fix can also be used to keep track of membership in clusters that form during aggregation. When used together with pair_style lj/charmm/coul/charmm/inter this fix can be used to help prevent multiple clusters from forming and merging in simulations of nucleation and self-assembly at high concentrations.

A check for possible bonds or contact between molecules is performed Nevery timesteps. If two atoms I,J are connected to each other by bonds (as a result of fix bond_create, for example), and if they are both in the specified fix group, then their molecule ID numbers will be set equal to each other. Additionally if the rmax paramter is specified, then the atoms will be assigned to the same molecule whenever two atoms I,J are within a distance cutoff of each other. If atom-type requirements were specified (by using the "type" keyword), then this only happens if I is of atom type itype, and if J is of atom type jtype.

Computationally, at each timestep this fix operates, it loops over all bond pairs and neighbor lists. If "rmax" was specified, this fix computes distances between pairs of atoms in the neighbor-list. By default (unless the "partial" keyword is specified), this fix repeats this loop for a number of times proportional to the number of atoms in the molecule. For example, if there are 5000 atoms in the largest molecule in your simulation, then your simulation might be noticably slower if you invoke this fix much more frequently than once every 5000 timesteps.

The "partial" keyword can be used to speed up the renumbering process. This keyword tells LAMMPS not to erase the molecule-ID numbers and start from scratch at every interval. However this only works if you can guarantee that the process of aggregation and growth in your simulation is irreversible. (IE if bonds never break, and clusters never fall apart.)

Restart, fix_modify, output, run start/stop, minimize info:

No information about this fix is written to binary restart files. None of the fix_modify options are relevant to this fix.

No parameter of this fix can be used with the start/stop keywords of the run command. This fix is not invoked during energy minimization.


This fix is part of the USER-MISC package. It is only enabled if LAMMPS was built with that package. See the Making LAMMPS section for more info.

Related commands:

fix bond/create

fix bond/break

fix bond/swap

pair_style lj/charmm/coul/charmm/inter


The option defaults are rmax=0.0, itype=*, jtype=*