ave/time command for a vector

Hello,

I want to time average the 2nd column of the bi-column array
produced by the temp/profile command.

compute c g temp/profile 1 1 1 y 20 out bin
fix f g ave/time 1 1000 10000 c_c[2] file f.txt

The following error appears:
“ERROR: Fix ave/time compute does not calculate a vector”
Moreover I tried to time average a single element (e.g. c[1][1]) and a
there was a similar error. How should I do that?

Thank you in advance.
Fahim

To ave/time a vector do this:

compute c all temp/profile 1 1 1 y 20 out bin mode vector
fix f all ave/time 1 10 100 c_c[2] file tmp.txt

To ave/time one element of the compute array, do this:

compute c all temp/profile 1 1 1 y 20 out bin
variable one equal c[1][1]
fix f all ave/time 1 10 100 v_one file tmp.txt

The fix ave/time command doc page does not say
that it supports accessing an array element, e.g. c[1][1],
as an argument it accepts. But you can do it thru
a variable.

Steve

The following error appeared for the vector mode:
“ERROR: Illegal compute temp/profile command (compute_temp_profile.cpp:115”

I think the mode keyword is not defined for the temp/profile command.

best,
Fahim

Sorry, the “mode vector” should be added to the fix ave/time command.

And on the 2nd example you need
variable one equal c_c[1][1]

Steve

Yes exactly. Thank you!

Fahim