is an exactly double defined dihedral (e.g., A B C D 9 0 0.1234 3) counted twice during energy minimization/integration, or not? I did some single point energy calculations with different configurations of the dihedral and then compared the energy values with gmx check. For example, the energies were equal between A B C D 9 0 1000 3 and A B C D 9 0 700 3, A B C D 9 0 300 3, but not between A B C D 9 0 1000 3 and A B C D 9 0 500 3, A B C D 9 0 500 3. So am I right in my assumption that for exact copies of a dihedral only one copy is taken into account for further calculations?
Do you mean in the [ dihedrals ] section or [ dihedraltypes ] section? In the [ dihedrals ] section every interaction is computed. So if you list a dihedral twice you get double the potential.
Dihedral type 9 is the only interaction type where multiple parameter entries generate multiple dihedrals. So you will get two dihedrals, so double the potential.
I see now that the reference manual is not very clear on this point.
I agree with the multiple parameter entries for the proper dihedral type. However, why do the energies differ then for two dihedral potentials with force constants of 500 kJ/mol each, compared to a single dihedral potential with 1000 kJ/mol? But are equal between two dihedral potentials with 700 kJ/mol and 300 kJ/mol compared to 1000 kJ/mol?
The manual states the following:
If parameters for a certain interaction are defined multiple times for the same combination of atom types the last definition is used; starting with GROMACS version 3.1.3 grompp generates a warning for parameter redefinitions with different values
Based on that I was thinking that grompp maybe ignores exact copies of a dihedral, and taking only the last definition.
However, they do not appear to be equal in GROMACS. When comparing the single-point energies of two identical structures—one with a .tpr file prepared using a single dihedral potential of 1000 kJ/mol and the other with two dihedral potentials of 500 kJ/mol each—I obtain different energy values.
Additionally, I compared two .tpr files using gmx check: one generated with a single dihedral potential of 500 kJ/mol and the other with two dihedral potentials, each with a force constant of 500 kJ/mol. The output was as follows:
I created a toy model using the CGenFF web server since the original data has not yet been published. However, the behavior remains the same. The molecule is butane, and I modified the dihedral between the first and last carbon atoms of the chain. I have attached the files with two dihedrals (each with a force constant of 500 kJ/mol) as well as the forcefield.itp file used for the toy model. (Note: GROMACS threw an error because the dihedral in the *.prm file was already defined in the ffbonded.itp file.)
No, grompp does not issue a warning about this (see 2x_500_grompp_output.txt ). I have also attached the output of gmx dump for the cases of 600 kJ/mol + 400 kJ/mol and 500 kJ/mol + 500 kJ/mol. In the latter case, only one PDHIS entry appears, with a force constant of 500 kJ/mol. Additionally, using gmx check , I compared the energies between the 600 kJ/mol + 400 kJ/mol and the 500 kJ/mol + 500 kJ/mol (or 1000 kJ/mol) cases. As you can see, the tool only returns differences between the 600 kJ/mol + 400 kJ/mol and the 500 kJ/mol + 500 kJ/mol cases.
You can see in the 2x500 dump that there is only one dihedral defined. I assume this must mean that grompp simply ignores a second, identical dihedraltype 9 parameter definition. We should have a warning for that.
Generating both dihedrals is likely a valid approach, as it aligns with the force field files (i.e., itp or prm). However, if a copy-paste error occurs—as it did in my case—a warning would be extremely useful to catch such mistakes.