Fix spring couple without declaring new atom type?

Hi, I am trying to attach springs between simple molecular structures and am unable to attach a spring to another atom without declaring a new atom type (i.e. 1, 2, 3). It works for simple structures with small numbers of atoms but is it possible to attach a spring between atoms of the same type?

I am using the spring couple method as I need the springs to attach themselves between individual atoms themselves and not be tethered to a certain point.

The fix spring command operates on groups not atom types. You can define groups based on atom ID, so there should be no problem beyond the fact that you are limited to about 30 additional groups to make a total of 32 (including the predefined group “all”).

You could have an arbitrary number of “springs” through multiple ways:

  • by adding bonds with bond_style harmonic (but you have to watch out for exclusions, so this would only work if you have no other bonds in your system and then set special_bonds lj/coul 1.0 1.0 1.0). this would be computationally most efficient, but you are limited in the length of the bonds and by now having any other bonds
  • by using fix restrain command — LAMMPS documentation this avoids the exclusion issue, but is less efficient and (if I remember correctly) still is affected by length restrictions in case that matters
  • by using pair style hybrid/overlay to add an instance of pair style list with a list of all harmonic interactions. This has no length limitations, but - unlike most of LAMMPS - is subject to minimum image conventions
1 Like