Skip to content

Conversation

@LilDojd
Copy link
Contributor

@LilDojd LilDojd commented Dec 12, 2023

This change improves the handling of Nonbonded scaling factors. Subclasses of SmallMoleculeTemplateGenerator can now set specific 1-4 scaling factors, which are then used in the residue template generation. SMIRNOFFTemplateGenerator now sets lj14scaling and coulomb14scaling to the one present in the SMIRNOFF Force field

Georgy Andreev added 2 commits December 12, 2023 12:19
This change improves the handling of Nonbonded scaling factors. Subclasses of SmallMoleculeTemplateGenerator can now set specific 1-4 scaling factors, which are then used in the openmm system creation.
@mattwthompson
Copy link
Collaborator

SMIRNOFFTemplateGenerator now sets lj14scaling and coulomb14scaling to the one present in the SMIRNOFF Force field

Is it not currently?

@LilDojd
Copy link
Contributor Author

LilDojd commented Dec 15, 2023

It does set those values to a hardcoded 0.5 and 0.8333, respectively. The code even includes a TODO:

 # TODO: Get coulomb14scale and lj14scale from SMIRNOFF ForceField object,
 # though this must match the original AMBER values

I have a very special case where I need to modify the scaling of NB interactions in the system as a whole. I know exceptions exist in OpenMM, but having a general ability to read FF-defined scaling factors can prove useful

Comment on lines -1071 to +1074
# TODO: Get coulomb14scale and lj14scale from SMIRNOFF ForceField object,
# though this must match the original AMBER values
nonbonded_types = etree.SubElement(root, "NonbondedForce", coulomb14scale="0.833333", lj14scale="0.5")
# In case subclasses specifically set the 1-4 scaling factors, use those.
nonbonded_types = etree.SubElement(root, "NonbondedForce",
coulomb14scale=getattr(self, "_coulomb14scale", "0.833333"),
lj14scale=getattr(self, "_lj14scale", "0.5"))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Talking about this part of code

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see - you're totally correct

@mikemhenry
Copy link
Collaborator

Thanks! @LilDojd

@mikemhenry mikemhenry merged commit 5d16bb1 into openmm:main Dec 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants