I found some different explanations for the atom orders of impropers in LAMMPS data file, and I feel confused.
According to this LAMMPS doc:
1 improper-type atom-1 atom-2 atom-3 atom-4 (atom-2 is central atom)
In another LAMMPS official doc:
If the 4 atoms in an improper quadruplet (listed in the data file read by the read_data command) are ordered I,J,K,L then X is the angle between the plane of I,J,K and the plane of J,K,L. Alternatively, you can think of atoms J,K,L as being in a plane, and atom I above the plane, and X as a measure of how far out-of-plane I is with respect to the other 3 atoms.
Note that defining 4 atoms to interact in this way, does not mean that bonds necessarily exist between I-J, J-K, or K-L, as they would in a linear dihedral. Normally, the bonds I-J, I-K, I-L would exist for an improper to be defined between the 4 atoms.
It’s not very clear which atom of the I-J-K-L is the central atom. But if I understand correctly, the last sentence indicates the first atom, I, is the central atom because it bonds to the other atoms.
But from this thread:
Andrew and Arun suggested that atom-3 was the central atom (Let’s talk about OPLS ff and harmonic-style improper here).
The oplsaa in moltemplate also seems to take the atom-3 the central atom, according to the related source codes (oplsaa.lt, nbody_Impropers.py opls_imp.py); however, a case I carried out suggested that the moltemplate may actually take the atom-2 the central atom (could be a bug). Here is the case: I used the original file ethylene.lt given by moltemplate_2019-8-28 to generate a data file. The atoms are numbered as:
1C = 2C
The impropers generated by moltemplate.sh combined with oplsaa.lt turned out as following:
1 1 1 2 5 6
2 1 1 2 6 5
3 1 2 1 3 4
4 1 2 1 4 3
5 1 3 1 2 4
6 1 5 1 2 6
If I understand correctly, here moltemplate takes 2-atom the central atom. By the way, here moltemplate seems to generate redundant impropers though it may not affect the computation in LAMMPS.
I also made some data files for other molecules using moltemplate. For those cases, I feel moltemplate could sometimes take atom-2 the central atom and sometimes take the atom-3, but I’m not quite sure.
I hope Andrew can take a look to this issue. Any comments are appreciated!