The intention is that the number of degrees of freedom of one thermo on all particles is equal to the sum of the degrees of freedom of two thermos that cover all particles with two distinct subsets. Bug 1: The code fails to perform as documented because of the group->getNumMembersGlobal() == m_pdata->getNGlobal() check. To function as documented, it should be replaced with a check against method 0's group size.
However, fixing Bug 1 as described will create another bug. When using rigid bodies, the single integration method is not applied to all particles - but only central and free particles. With ThermodynamicQuantities applied to all particles (including constituents), the ratio based on N including constituents will meet the requirement that multiple ThermodynamicQuantities instances are additive. However, the condition on when to activate the periodic degree of freedom removal needs to check only central and free particles, not constituents. At this time, an efficient solution is not clear to me.
Description
There is a problem with this code: https://github.com/glotzerlab/hoomd-blue/blob/03e25a0a17913f55094b1e880d4ed74abc252c1c/hoomd/md/IntegratorTwoStep.cc#L159-L165
The intention is that the number of degrees of freedom of one thermo on all particles is equal to the sum of the degrees of freedom of two thermos that cover all particles with two distinct subsets. Bug 1: The code fails to perform as documented because of the
group->getNumMembersGlobal() == m_pdata->getNGlobal()
check. To function as documented, it should be replaced with a check against method 0's group size.However, fixing Bug 1 as described will create another bug. When using rigid bodies, the single integration method is not applied to all particles - but only central and free particles. With
ThermodynamicQuantities
applied to all particles (including constituents), the ratio based on N including constituents will meet the requirement that multiple ThermodynamicQuantities instances are additive. However, the condition on when to activate the periodic degree of freedom removal needs to check only central and free particles, not constituents. At this time, an efficient solution is not clear to me.The documentation for the degree of freedom removal that needs to be updated: https://github.com/glotzerlab/hoomd-blue/blob/0b4b6b54f2ec6acbfdc817215e89d9e9e863655c/hoomd/md/compute.py#L211-L226
While my script is built using #1424, the error is present in the most current release. Fixing the second bug is a breaking change.
Script
Input files
init.gsd.zip
Output
Expected output
1533.0
Platform
CPU, GPU, Linux, macOS
Installation method
Compiled from source
HOOMD-blue version
feature/modern-integrators
Python version
3.10.6