GOMC
GOMC copied to clipboard
Volume Moves can be too large, resulting in negative volume
Describe the bug
Because the maximum adjustment for the volume move can be only a bit smaller than the total volume of the box, it's possible to have a move attempt that results in a negative volume. This causes the simulation to terminate with an error message.
To Reproduce
This was observed with a long-running simulation that uses the GEMC-NPT ensemble. A combination of bad luck, with a small reduction in the volume that is accepted, followed by a random decision to reduce the volume by nearly the maximum amount will result in a negative box volume.
Expected behavior
The maximum volume transfer amount should be smaller, so that the volume is changed modestly and won't underflow.
Screenshots
Example output with some additional debugging information.
Volume Move: Scale is 2.32458238e+06 for box 1 Changing volume by -2.48648638e+05 Current volume is 2.33258238e+06 and new volume is 2.08393374e+06 New dimensions of [1.27730507e+02, 1.27730507e+02, 1.27730507e+02] Old dimensions of [1.32621010e+02, 1.32621010e+02, 1.32621010e+02]
Volume Move: Scale is 2.32458238e+06 for box 1 Changing volume by -2.30452861e+06 Current volume is 2.08393374e+06 and new volume is -2.20594872e+05 New dimensions of [-6.04224695e+01, -6.04224695e+01, -6.04224695e+01] Old dimensions of [1.27730507e+02, 1.27730507e+02, 1.27730507e+02]
WARNING!!! Box 1 shrunk below 2*Rcut! Auto-rejecting! Volume was reduced from 2.08393374e+06 to -2.20594872e+05 Old Axis Dimensions: [1.27730507e+02, 1.27730507e+02, 1.27730507e+02] New Axis Dimensions: [-6.04224695e+01, -6.04224695e+01, -6.04224695e+01] Exiting!
Input files
Not uploaded, since I will submit the patch.
Please complete the following information:
- OS: CentOS
- Ensemble: GEMC-NPT
- Code version: 2.75, development branch
Additional context
N/A