mosdef-hub / foyer

A package for atom-typing as well as applying and disseminating forcefields
https://foyer.mosdef.org
MIT License
117 stars 76 forks source link

Edge case when scaling factors are 0 #495

Closed daico007 closed 2 years ago

daico007 commented 2 years ago

Bug summary There is a bug when typing and parametrizing with forcefields whose scaling factors (lj14 and coulomb14) are 0. Specifically, when we typed and parametrized a mbuild Compound/parmed Structure using forcefield with scaling factors = 0 (i.e., TRAPPE), the scaling factors are not properly carried over when writing to the final form(e.g., when writing out a .top file, we have gen-pairs as yes, and fudgeQQ and fudgeLJ as 1 instead of 0).

Software versions

daico007 commented 2 years ago

This might be relate to how parmed structure store the 1-4 interactions in structure.adjusts and infer the scaling factor in the writer (or just write down under pairs section in .top). So when scaling factor is 0, it technically does not create any 1-4 interactions, so empty structure.adjusts --> default values are used.