choderalab / saltswap

Package to fluctuate the number of counterions in an OpenMM simulation
MIT License
6 stars 3 forks source link

Acceptance test fix for resetting the volume #10

Closed gregoryross closed 7 years ago

gregoryross commented 7 years ago

Upon rejection of an NCMC proposal, all variables must be reset to their initial values. This PR fixes the fact that, previously, the periodic box vectors were not reset after rejection.

@bas-rustenburg, this fix should also work for #protons.

bas-rustenburg commented 7 years ago

I noticed one minor opportunity for optimization. If you use asNumpy=True for your positions, velocities and box vectors, you save a few operations that add and strip units.

jchodera commented 7 years ago

So the positions were being reset, but not the box vectors? I wonder why this didn't lead to insanely large energies.