incorrect gmx energy decomposition for separate molecules
Summary
gmx energy gives non-zero LJ-14 and Coulomb-14 values for intermolecular interactions. At the same time LJ-14 and Coulomb-14 are zero for non-protein molecule where 1-4 interactions should be present.
GROMACS version
The problem appears in the versions 2022, 2023, 2024. In the earlier version the issue is not present.
Steps to reproduce
Simulation of a system with a protein and ligand. mdp file needs to specify energygrps = Protein MOL. Afterwards output 1-4 energies with gmx energy
What is the current bug behavior? gmx2024, output from gmx energy
@ s0 legend "LJ-14:Protein-Protein"
@ s1 legend "LJ-14:Protein-MOL"
@ s2 legend "LJ-14:MOL-MOL"
0.000000 3983.340088 42.350895 0.000000
0.020000 4763.316406 40.349072 0.000000
What did you expect the correct behavior to be? gmx2021
@ s0 legend "LJ-14:Protein-Protein"
@ s1 legend "LJ-14:Protein-MOL"
@ s2 legend "LJ-14:MOL-MOL"
0.000000 3983.342285 0.000000 42.350891
0.020000 3999.370361 0.000000 38.584415
Possible fixes
Seems to be introduced by fixing issue #4462 (closed) in a merge request !2642 (merged)