Dear LAMMPS users and developers,
This post is a follow-up to this previous issue. In the current documentation of the compute_dihedral_local, it is advised to copy-past the following lines into in.rhodo
:
variable p internal 0.0
variable cos equal cos(v_p)
variable cossq equal cos(v_p)*cos(v_p)
compute 1 all property/local datom1 datom2 datom3 datom4 dtype
compute 2 all dihedral/local phi v_cos v_cossq set phi p
dump 1 all local 100 tmp.dump c_1[*] c_2[*]
compute 3 all reduce ave c_2[*]
thermo_style custom step temp press c_3[*]
fix 10 all ave/histo 10 10 100 -1 1 20 c_2[2] mode vector file tmp.histo
This is what I did in the following input file in.rhodo (1.0 KB) that goes with this data file data.rhodo (6.0 MB).
With the stable 29Aug2024 (update1) version of LAMMPS, the in.rhodo input with the modification suggested by the doc gives the error:
ERROR: Compute reduce compute 2 does not calculate per-atom values (src/compute_reduce.cpp:254)
Last command: compute 3 all reduce ave c_2[*]
As already noted in the same previous issue, this script works fine with older LAMMPS versions, for instance with 2Aug2023.
After a bit of digging, I found that the compute reduce command was updated in 21Nov2023 and that, now, whether inputs are per-atom or local can be explicitly written.
Therefore, the compute_dihedral_local (and also the compute_angle_local and compute_bond_local) pages should provide examples including the line:
compute 3 all reduce ave c_2[*] inputs local
instead of
compute 3 all reduce ave c_2[*]
Simon