LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Mailing List Archives
Re: [lammps-users] How to access the group averaged position at a certain step?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lammps-users] How to access the group averaged position at a certain step?


From: Axel Kohlmeyer <akohlmey@...24...>
Date: Fri, 13 Apr 2018 13:04:19 -0400

On Fri, Apr 13, 2018 at 10:35 AM, Peter Chu <bdzhu@...5255...> wrote:
> 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.

>
> -----------------------------------------------------------------
>
> Best Regards,
>
> Bida Zhu
>
> Huazhong University of Science and Technology
>
> Department of Mechanics
>
> China
>
> bdzhu@...5255...
>
>
>
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> lammps-users mailing list
> lammps-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/lammps-users
>



-- 
Dr. Axel Kohlmeyer  akohlmey@...24...  http://goo.gl/1wk0
College of Science & Technology, Temple University, Philadelphia PA, USA
International Centre for Theoretical Physics, Trieste. Italy.