Skip to content

Conversation

@lohedges
Copy link
Contributor

@lohedges lohedges commented Oct 10, 2025

This PR closes #366 by resetting the GCMC water state prior to minimisation following a dynamics crash. Previously the state was set after minimisation, meaning that minimisation would be performed on an OpenMM system where all waters were real, so large steric clashes could occur.

The PR also closes #367 by setting sensible defaults for the OpenMM periodic box vectors when the Sire system doesn't have a periodic space. This uses the AABox of the system coordinates to work out a minimum box size, then adds twice the nonbonded cutoff distance.

The PR has also removed some redundant code from the restraints, which was probably copied across from one of the others where it is used.

  • I confirm that I have merged the latest version of devel into this branch before issuing this pull request (e.g. by running git pull origin devel): [y]
  • I confirm that I have added a changelog entry to the changelog (we will add a link to this PR as part of the review): [y]
  • I confirm that I have permission to release this code under the GPL3 license: [y]

@akalpokas: Could you take a look at this next week? We can update the periodicity of an restraints in this PR too once tested.

Cheers.

@lohedges
Copy link
Contributor Author

Looks like this has caused a failure with a distance restraint unit test. I've also realised that the AABox approach won't always work for ring breaks transformations, since it could massively underestimate the extent of the molecule, hence the size of the box that is needed.

Copy link
Contributor

@akalpokas akalpokas left a comment

Choose a reason for hiding this comment

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

I have tested this on my end and I can see the dynamic box size resizing in the vacuum leg, with the box vectors increasing from 20 A to 44 A. Thanks for the changes!

@lohedges
Copy link
Contributor Author

Great, thanks for testing. This should cover most basic perturbations but we'll still probably need to be careful for macrocyclisation transformations. In that case, setting an appropriate box should be part of the setup process. I did think about changing the code to raise an exception when no box was set, rather than setting a better default. However, quite a few tests and bits of the tutorial use no box, so it would require a lot of changes.

@lohedges lohedges merged commit 6610a2e into devel Oct 14, 2025
4 of 5 checks passed
@lohedges lohedges deleted the fix_366_367 branch October 14, 2025 14:39
lohedges added a commit that referenced this pull request Oct 14, 2025
lohedges added a commit that referenced this pull request Oct 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] No OpenMM box vectors set when system has no periodic space [BUG] GCMC dynamics crashes

3 participants