GROMACS version: 2026.3
GROMACS modification: No
Hi all,
With constraints = h-bonds, I found that C-H bonds remain flexible when the hydrogen names start with a digit, such as 1H21. These names occur in some CHARMM-style lipid and detergent topologies.
In a minimal ethane reproduction, ordinary H-prefixed names give 6 constraints, while digit-prefixed names give 0 constraints. Both cases pass grompp with -maxwarn 0 at a 2 fs timestep. The hydrogen atom type has atomic number 1 in both cases.
I opened an issue with the reproduction files and details:
The hydrogen detection in count_hydrogens() checks the first character of the atom name. Would using the atomic number when available, with a fallback to the existing name-based check, be an acceptable change? OpenMM constrains the same topology as expected using the atomic number.
I have a warning-only patch ready with tests, and would also be happy to prepare an MR for atomic-number-based detection if that is preferred.
Thanks!