[lammps-users] Number of contacts between two groups of atoms

Dear LAMMPS Users

I am trying to calculate the number of contacts of two chains of a peptide using the LAMMPS commands, however I cannot find anything in the documentation to help me with this.

Each chain of the peptide converted it into a group of atoms using:

group A id 1: 300

group B id 301: 600

Is there any trick to use the command “compute ID group-ID contact / atom” to calculate the number of contacts of two groups of atoms?




compute group/group is not such a good idea since it sums up interactions between groups, but compute pair/local might be of interest for you.
since this uses neighbor list info, it may be needed to first record a trajectory and then analyze it using re-run and a sufficiently short cutoff with pair style zero.
you would still need to post-process that data, though.