stress auto-correlation function: fix ave/correlate

Dear LAMMPS users,

I want to calculate the stress auto-correlation function for my system and have two questions regarding to LAMMPS.

  1. I have the error as ‘Fix ave/correlate compute does not calculate a vector’ reported and my scripts are:

compute 1 all stress/atom NULL

fix 3 all ave/correlate 1 10 1000 c_1[4] c_1[5] c_1[6] file aout.correlate

I would like to have the stress of xy, xz, yz correlate to themselves. Could you kindly point out what’s wrong in the script?

  1. what if I would like to calculate ave/correlate of pxy,pxz,pyz from thermo_style? Can I simply replace c_1[4] c_1[5] c_1[6] with pxy pxz pyz? Or should I store pxy, pxz and pyz first, then take them as variables?

Many thanks,

Sunnia

Dear LAMMPS users,

I want to calculate the stress auto-correlation function for my system and
have two questions regarding to LAMMPS.

1) I have the error as 'Fix ave/correlate compute does not calculate a
vector' reported and my scripts are:

   compute 1 all stress/atom NULL
   fix 3 all ave/correlate 1 10 1000 c_1[4] c_1[5] c_1[6] file
aout.correlate

I would like to have the stress of xy, xz, yz correlate to themselves.
Could you kindly point out what's wrong in the script?

​compute stress/atom does not compute a global property, but a per-atom
one.​ so the error message is correct.

2) what if I would like to calculate ave/correlate of pxy,pxz,pyz from
thermo_style? Can I simply replace c_1[4] c_1[5] c_1[6] with pxy pxz pyz?

​no, please see the fix ave/correlated documentation​.

Or should I store pxy, pxz and pyz first, then take them as variables?

​how about defining an instance of compute pressure?​

​axel.​

Dear axel.

Is this a right way to compute the pressure (or say, stress)? See below:

compute 1 all stress/atom NULL

compute 2 all reduce sum c_1[4] c_1[5] c_1[6]

variable pxy equal -c_2[1]/(3*vol)

variable pxz equal -c_2[2]/(3*vol)

variable pyz equal -c_2[3]/(3*vol)

And then compute the stress auto-correlation function in the way as:

fix 3 all ave/correlate 1 10 1000 pxy pxz pyz file auto.correlate

If this will give me what I want?

Best wishes,

Sunnia

three comments on this:

  1. this mailing list is not an input file approval service. please do what everybody else does: read the documentation, make tests, check error messages, if any, against the Errors section in the manual, re-check the documentation, check the output. rinse and repeat until you either are confident, that you get what you want, or discover that the documentation disagrees with what LAMMPS computes. you should post to the mailing list only in the latter case with sufficient supporting information, of course.

  2. your computation is needlessly complex and wasteful. there are simpler ways to get the same info (which will also have less performance impact)

  3. there are no absolute rights or wrongs in these matters.

thank you very much for your commends.

Best wishes,

Sunnia