How to use output from vcm/chunk in a variable?

Dear Lammps users,

I would like to calculate the instantaneous velocity of the center-of-mass of a defined group of atoms “wgroup” and use the value in another calculation on the same step.

I understand from the Lammps website that I can output this information to a file:

compute wc wgroup chunk/atom bin/1d x lower 1 units reduced
compute wcvec all vcm/chunk wc
fix wcout all ave/time 1 1 100 c_wcvec[*] file out.test mode vector

resulting in output like:

Time-averaged data for fix wcout

TimeStep Number-of-rows

Row c_wcvec[1] c_wcvec[2] c_wcvec[3]

0 1
1 4.05836e-05 5.15452e-06 -2.93765e-05

Instead of writing to a file however, I would like to use c_wcvec[1] in a further calculation in Lammps, but I have not been able to do this. For example:

variable wcvecx equal f_wcout[1]

generates the error

ERROR: Variable wcvecx: Fix global vector in equal-style variable formula

and

variable wcvecx equal c_wcvec[1]

produces the error

ERROR: Variable wcvecx: Compute global vector in equal-style variable formula

and
compute wcvecx all reduce sum c_wcvec[1]

produces the error
ERROR: Compute reduce compute calculates global values

Can anyone explain to me how to extract the value of wcvec[1] for use in an equation further down the script?

Thank you.

Jeff

Equal-style variables are scalars. So you cannot define them to

operate on a global vector. There is a vector-style variable

which will do that. See the variable doc page for details.

Steve