Closed joaander closed 1 year ago
There are two errors that need to be corrected and a test to add:
1) [ ] - Pass the system dimensionality to getVolume
so that it computes the box volume or area when appropriate:
https://github.com/glotzerlab/hoomd-blue/blob/d71900eb2174bafb1aebede304f7ed5a77e61870/hoomd/hpmc/ComputeFreeVolume.h#L296-L298
2) [ ] - Generate 0 z coordinates when the system dimensionality is 2: https://github.com/glotzerlab/hoomd-blue/blob/d71900eb2174bafb1aebede304f7ed5a77e61870/hoomd/hpmc/ComputeFreeVolume.h#L177-L179 https://github.com/glotzerlab/hoomd-blue/blob/d71900eb2174bafb1aebede304f7ed5a77e61870/hoomd/hpmc/ComputeFreeVolumeGPU.cuh#L275-L277
3) [ ] - To test the fix, add a 2D test to test_compute_free_volume.py
.
Note that the code appropriately generates rotations based on the dimensionality: https://github.com/glotzerlab/hoomd-blue/blob/d71900eb2174bafb1aebede304f7ed5a77e61870/hoomd/hpmc/ComputeFreeVolume.h#L185
Description
hoomd.hpmc.compute.FreeVolume
always assumes the box is 3D. This leads to errors in the free volume computation.Script
Input files
No response
Output
Expected output
Approximately
9996.85840734641
(100*100 - pi)Platform
CPU, GPU, Linux, macOS
Installation method
Compiled from source
HOOMD-blue version
3.8.1
Python version
3.11.1