mosdef-hub / mbuild

A hierarchical, component based molecule builder
https://mbuild.mosdef.org
Other
171 stars 79 forks source link

Incorrect determination of CHARMM dihedral 1-4 weighting factor in lammpsdata writer #903

Open rwsmith7531 opened 3 years ago

rwsmith7531 commented 3 years ago

In _get_dihedral_types in lammpsdata.py, the weighting factor for CHARMM dihedrals is determined as the reciprocal of the length of the list of dihedral terms for a given dihedral. This is probably done to ensure that weighting factors are not overcounted due to multiple terms in a dihedral. However, this is not how the LAMMPS documentation says the weighting factor should be used. LAMMPS says that only 0.0, 0.5, and 1.0 are options, and they are meant to correct over-counting of 1-4 LJ interactions in CHARMM force fields due to a given pair of atoms appearing in multiple different dihedrals in rings. The current method used by _get_dihedral_types can result in other values, and cannot give a weighting factor of 0.0. The intended usage of the weighting parameter is described in more detail in https://lammps.sandia.gov/doc/dihedral_charmm.html .

XiaoboLinlin commented 3 years ago

Hi Ryan,

I found the same issue in lammpsdata.py as you found. I am currently trying to modify the lammpsdata.py to give a weighting factor of 0.0

Best,

Xiaobo