Question about fix shake bond counts

Dear LAMMPS community,

I am trying to simulate a rigid 3-point water model, and using fix shake to constraint the OH bonds and HOH angles. My system contains 10k water molecules. I print out the shake statistics every 1k steps, and I find that the count for the OH bonds is 30k, instead of 20k. I was wondering if I set anything wrong in my input file. I am using LAMMPS (29 Sep 2021 - Update 3). Please find my input file and data file attached.

Thank you in advance!

Best,
Sijia Chen

data.lmp (3.7 MB)
in.equil-1.sh (2.5 KB)

Please try running with the latest LAMMPS release and check again. You can just download one of the provided binary packages with serial executables for a quick test, if you don’t want to compile from source.

Thank you for the quick reply, Alex! I tried the latest release, and it does report the correct number now.

I was wondering if the recent LAMMPS uses a different (correct) way to count the number of constrained bonds compared to the old LAMMPS? Was there any underlying computation procedure changed? Because our group has some in-home code developed based on the 29 Sep 2021 version, I prefer not to switch to a different LAMMPS version.

When I look at the shake stats reported by the old LAMMPS, the count is incorrect, but the dumped bond lengths (I use compute blOH gOH bond/local dist and dump BDOH all local ${dumpfreq} OH_bond.dump c_blOH to output all OH bond length) are correct.

The bond/angle counts are a purely diagnostic computation and independent from the actual constraints. They have been revised multiple times in recent years (initially, there were no counts at all, only the constraint value and the error).

The LAMMPS manual has a guide for porting code written for older versions to the current version: 4.10. Notes for updating code written for older LAMMPS versions — LAMMPS documentation
There are multiple benefits of updating: there are plenty of bugs fixed (we have been very thorough in recent years on hunting down bugs and adding tests) and useful new features added (e.g. fix shake can now be used during minimization).

If you would ever want to contribute your feature to the distribution, you would have to update it anyway.

Thanks for the clarification.

I strongly agree with you. I always feel it is a good idea to catch up the latest LAMMPS. But I am not the coder in the group, so it actually depends on the people who maintain the in-home code. Anyway, I really appreciate your warm help.

Best,
Sijia