Detailed description |
|
Having been testing out Modeller.loadHydrogenDefinitions() and Topology.loadBondDefinitions()in OpenMM5.1 beta, I stumbled upon a subtle problem, that was my own fault, but could have been resolved quicker with an exception being thrown.
To cut a very long story short and summarise three days of debugging, it turns out that a simulation will crash with a NaN if there is a duplicate term for a constraint. This was being caused by some bespoke parameters that had duplicate entries to those in amber99sb.xml. Serialising the system object and looking in the Constraints element revealed two entries for a particle:
<Constraint d=".101" p1="19" p2="20" />
....etc...
<Constraint d=".101" p1="19" p2="20" />
Removing these duplicates, deserialising, then proceeding with the simulation resolved the issue.
Even though this problem is caused by my faulty parameters, I still think System->addConstraint() should at least raise an exception if there is more than one entry for a given pair.
A wider issue, and out of scope for this bug, is whether an exception should be raised if one attempts to add a duplicate force to a system. I know NonbondedForce.addException() has an "replace" option, but I don't think other force objects have this ability. |
|