# Is there anything wrong about fix ave/correlate?

Hi,everybody
I have recently confused about how a global vector is established and used by another command. Specifically, I doubt the code for viscosity calcualtion is incorrect. the relavent script is extracted from the manual (P89, 24 Jan 2013 version):

# viscosity calculation, switch to NVE if desired

#unfix NVT
#fix NVE all nve

reset_timestep 0
variable pxy equal pxy
variable pxz equal pxz
variable pyz equal pyz
fix SS all ave/correlate \$s \$p d & v_pxy v_pxz v_pyz type auto file S0St.dat ave running variable scale equal {convert}/(\${kB}\$T)\$V*s*{dt}
variable v11 equal trap(f_SS){scale} variable v22 equal trap(f_SS)*{scale}
variable v33 equal trap(f_SS)
\${scale}
thermo_style custom step temp press v_pxy v_pxz v_pyz v_v11 v_v22 v_v33
run 100000
variable v equal (v_v11+v_v22+v_v33)/3.0
variable ndens equal count(all)/vol
print “average viscosity: \$v [Pa.s/ @ T K, {ndens} /A^3”

As illustrated in ‘compute pressure’ command, a vector [pxx,pyy,pzz,pxy,pxz,pyz] is created and can be used with indices1-6 by other command. logically, the ‘fix ave/correlate’ can create an identical vector of the same length and order. So,v11 is supposed to be calculated by trap(f_SS)*{scale}, other than trap(f_SS)*{scale}. Similarly, v22 and v33 correspond to f_SS and f_SS, respectively.
Is anything wrong or don’t I indeed get the ‘fix ave/correlate’ command? If the latter, would you please tell me what the vector created by ‘fix ave/correlate’ looks like? Thank you very much!
Best wishes,
Hongtao

Hi,everybody
I have recently confused about how a global vector is established and used by another command. Specifically, I doubt the code for viscosity calcualtion is incorrect. the relavent script is extracted from the manual (P89, 24 Jan 2013 version):

Before questioning the correctness of a script in a 1.5 year old version, please update to the latest version and compare to the script provided in the examples directory.

Hi,Axel