Fix very subtle bug in Amber prmtop with NBFIX
Some topology files have some of the nonbonded pairs in the Lennard-Jones matrix pointing to a 0 entry in the HBOND_ACOEF and HBOND_BCOEF arrays. This commit simply skips over those entries, having previously checked that all entries in the 10-12 sections are 0. There is actually an example of this already in the test suite (see ff14ipq.parm7), but this fortuitously did not cause any difference in those test results. The reason this bug is not evident in that test case is because the A- and B-coefficients pulled when the index was -1 (later decremented to -2) was also coincidentally 0. However, if this was not the case (as it does not *have* to be), then who knows what could happen. This also adds more of a check against 10-12 topology files. ParmEd actually supports using the 10-12 potential in OpenMM when specified in the Amber prmtop, but it is sufficiently rare that it is not worth porting to OpenMM, IMO.
Showing
Please register or sign in to comment