Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix inconsistent units from get_box and nonbondedCutoff #6

Merged
merged 35 commits into from
Sep 22, 2022

Conversation

rkingsbury
Copy link
Contributor

@rkingsbury rkingsbury commented Jul 19, 2022

The nonbondedCutoff in OpenMM must be specified in units of nm, however get_box (which is used by parameterize_system) returns box dimensions in angstrom. The subsequent calculation at this line thus incorrectly sets the nonbondedCutoff to either 10 nm (100 Angstrom), or 10x the intended box size.

This PR contains a fix for the inconsistent units, calculating the nonbondedCutoff as the min of (1 nm) or (1/2 the box size in nm). I still need to add a test.

@orionarcher orionarcher marked this pull request as ready for review September 22, 2022 22:19
@orionarcher
Copy link
Owner

orionarcher commented Sep 22, 2022

Fixed issues with testing and removed draft status. Will be merged pending linting passing. Thanks for the PR @rkingsbury!

@orionarcher orionarcher merged commit b9b9bcc into orionarcher:main Sep 22, 2022
@rkingsbury rkingsbury deleted the boxunits branch September 23, 2022 16:32
@rkingsbury
Copy link
Contributor Author

Thanks @orionarcher ! This is sufficiently important to get right that I think some follow up work is warranted - e.g. adding a more comprehensive test to confirm that we get the expected density in the expected units (as per the TODO item you added).

I will open an issue related to that so we don't lose track.

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.

2 participants