How to prevent lammps from creating bond between atoms from different molecules?

Dear All,

I hope you are doing well.

I have DSPE molecules in my system and need to include multiple copies of them. To achieve this, I wrote a routine that generates multiple molecules, each stored in a separate file. In each file, the atom IDs, bond, and angle information are identical across all molecules, and they are positioned at different Z-offsets to ensure separation.

However, when I run my LAMMPS simulation:

  • With a small offset (e.g., 1): The molecules initially stick together at equilibrium and then gradually separate.
  • With a larger offset: I get the error “bond atom missing,” which suggests that the simulation is trying to form bonds between atoms from different molecules.

I suspect that since all molecules use the same atom types (e.g., type 2 and 3), and there are predefined bonds between these types (e.g., between atom type 2 & 3), LAMMPS may be mistakenly creating bonds between separate molecules. When the molecules move farther apart, these unintended bonds break, causing the error.

My Question:

How can I ensure that bonds only form within each individual molecule and not between different molecules?

  • Changing atom IDs for each molecule would be complex and difficult to track.
  • Would assigning molecule IDs be sufficient to prevent inter-molecular bonding while keeping atom IDs unchanged?
  • What is the simplest and most efficient way to resolve this issue?

Thank you so much for your time and care,
Delaram

No. LAMMPS only does what you tell it to do.

No, it suggests that you either have a bad geometry, or a bad topology, or a bad model, or bad force field parameters or bad simulation settings.

Any unintended bonds must be bonds that you have specified. LAMMPS knows nothing about chemistry and does only do what you tell it to do.

Why separate files? That makes matters needlessly complicated. Why not just a single file?

The simplest and most efficient solution is to create the whole system in a single file with all required topology information included. Then there can be no doubt and no mistakes with the command line when loading multiple data files.

The second best option is to not use data files, but create a molecule file, load it with the molecule command and then create a set of molecules with create_atoms from that after setting a suitable lattice.

1 Like

Thanks, I created one datafile with different atomIDs for molecules and it worked.