I need to sum several global scalar values obtained by computes, sum them, and output it to a file; like this:

variable store equal (c_1[1] + c_2[1] + c_3[1] + c_4[1] + c_5[1] + c_6[1])

fix Int_AllGOOO all ave/time 5 5 500 v_ store file tmp.out

I couldn’t find a way to sum compute values directly, as it produces ERROR: Illegal variable command.

I tried to store each compute value in an equal style variable, then sum them in another variable. However, I got ERROR “Compute used in variable between runs is not current”.

Any idea how I can do this in lammps? Thanks a lot.

I need to sum several global scalar values obtained by computes, sum them,

and output it to a file; like this:

variable store equal (c_1[1] + c_2[1] + c_3[1] + c_4[1] + c_5[1] + c_6[1])

fix Int_AllGOOO all ave/time 5 5 500 v_ store file tmp.out

I couldn't find a way to sum compute values directly, as it produces

ERROR: Illegal variable command.

this error message is correct. your variable command is illegal. you have

white space in your expression without quoting it. that is not allowed.

please read the fine manual for more details on this.

I tried to store each compute value in an equal style variable, then sum

them in another variable. However, I got ERROR "Compute used in variable

between runs is not current".

Any idea how I can do this in lammps? Thanks a lot.

just follow the documentation.

axel.