How to access the group averaged position at a certain step?

Hi All,

I want to calculate the averaged position of atoms in a group at certain step, and then store them for input of later commands. I try fix ave/atom and reduce them after runs, like:

group He1 id 57086 57087

fix ave He1 ave/atom 1 1 5 x y z

run 5

compute 1 He1 reduce ave f_ave[1] f_ave[2] f_ave[3]

variable xm equal c_1[1]

print “The xm is now ${xm}”

I got the follow error message:

ERROR: Compute used in variable between runs is not current

How to do this right?

Hi All,

       I want to calculate the averaged position of atoms in a group at
certain step, and then store them for input of later commands. I try fix
ave/atom and reduce them after runs, like:

group He1 id 57086 57087

fix ave He1 ave/atom 1 1 5 x y z

run 5

compute 1 He1 reduce ave f_ave[1] f_ave[2] f_ave[3]

variable xm equal c_1[1]

print "The xm is now ${xm}"

I got the follow error message:

ERROR: Compute used in variable between runs is not current

How to do this right?

for starters, you need to define the compute reduce *before* the run
and also output xm during the run (e.g. using fix print) for
triggering that the corresponding information is computed and
collected in time. if you do this *after* a run is completed, this
usually does not work because dependent calculations have not been
triggered. hence you get the error message.

there may be other issues, but this is a definite problem.

axel.