[lammps-users] Rules of formatting Angles, Dihedrals, Impropers data

Dear Lammps users, it is possible that this question was raised several times in the past, si please accept my apologies in advance.

I am referring to the rules to be adopted when describing a given bond, angle, dihedral or improper set of parameters.

For example the Angles section must be compiled as follows:

Angle ID (number) / angle Type / Atom-1 / Atom-2 / Atom-3

a) should the list of the bonds / angles / dihedrals / impropers be organized in ascending sequence of the ID’s (first column) or may they be listed in a casual way?

b) for angles, atom-2 is the central atom, so I understand it should be put in between the other two. Is there any rule to be respected for positions of atom-1 and atom-2?
for example if the central atom is 4, and the other two are 3 and 6 may I write: 1(ID) 2(Type) 3 4 6 or 1 2 6 4 3 without causing an issue with Lammps?

c) same questions a, b for the more complex case of dihedrals (where I understand atom-2 and 3 form the central bond, so they should be put between the other 2).

  1. even more difficult for me is to understand the rules for impropers

To make a long story short, if some patient “savant” may help, he would be very welcome.

By the way, my (possibly limited) search in the Lammps documentation and generally in google did not really gave me a clearcut picture.

Thanks in advance for your understanding

Paolo Botto

Dear Lammps users, it is possible that this question was raised several times in the past, si please accept my apologies in advance.

I am referring to the rules to be adopted when describing a given bond, angle, dihedral or improper set of parameters.

The authoritative documentation for the format of the data file is a) the documentation of the read_data command and b) the documentation of the corresponding styles (Bond, Angle, Dihedral, Improper).
read_data will store topology data as it reads it, but the various styles decide how they interpret it. So there may be differences, if different conventions are applied.

Code for styles is contributed by many different people, so the chances that not everything is perfectly consistent across different styles are high. That is where the individual documentation needs to be consulted.

For example the Angles section must be compiled as follows:

Angle ID (number) / angle Type / Atom-1 / Atom-2 / Atom-3

a) should the list of the bonds / angles / dihedrals / impropers be organized in ascending sequence of the ID’s (first column) or may they be listed in a casual way?

no. actually the ID is ignored. when reading any of those sections.

b) for angles, atom-2 is the central atom, so I understand it should be put in between the other two. Is there any rule to be respected for positions of atom-1 and atom-2?
for example if the central atom is 4, and the other two are 3 and 6 may I write: 1(ID) 2(Type) 3 4 6 or 1 2 6 4 3 without causing an issue with Lammps?

for angles, they should be equivalent due to symmetry.

c) same questions a, b for the more complex case of dihedrals (where I understand atom-2 and 3 form the central bond, so they should be put between the other 2).

For this you need to consult the documentation of the individual dihedral style. I remember people stating that there were differences.
The best way to make certain is to create inputs with just 4 atoms and a dihedral and try out different geometries and match them to the potential function from the documentation.

It would be a great service to the LAMMPS community if somebody would do this systematically for all pair styles, possibly even formulate this in some kind of test executable that we could add to the unittest try and then confirm that there are no inconsistent changes added.

  1. even more difficult for me is to understand the rules for impropers

The “rules” are the same: There is no enforcement of any convention. The read_data docs explain how the atom IDs are stored, but the individual style can interpret them any which way they see.
If it is not described in the documentation, you may find explanations as comments in the source.

To make a long story short, if some patient “savant” may help, he would be very welcome.

LAMMPS has 20 bond styles, 22 angle styles, 16 dihedral styles, and 13 improper styles (not counting accelerated versions). I don’t think anybody can and wants to remember all of that properly by heart.
So the only way to make certain is to create test inputs and validate.

By the way, my (possibly limited) search in the Lammps documentation and generally in google did not really gave me a clearcut picture.

this is not something that was properly planned by a bunch of swiss administrators, so I am not surprised. most people only care about some specific styles and either trust that things work correctly if the runs don’t crash or do the tests I described.

axel.