LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Mailing List Archives
Re: [lammps-users] get id of the any atom of the group
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lammps-users] get id of the any atom of the group

From: Steve Plimpton <sjplimp@...24...>
Date: Tue, 17 Apr 2018 08:37:58 -0600

I don't understand your Q.  The fix setforce command does not
output a table with rows and columns.  It just outputs a 3-vector
of total force on the group of atoms before it was reset.

Re: compute not current error, the variable doc page (at the bottom)
explains how to overcome this kind of error.


On Thu, Apr 12, 2018 at 9:28 AM, Al web via lammps-users <> wrote:

Hello all,

The "fix 1 #group setforce 0 0 0 " outputs a table with number of rows=atoms in the group and the same lines in all rows: Fx Fy Fz - total resulting force on the all atoms of the group.
Later I would like to average the force over N steps for a single line of this fix, so that no extra resources are spent on averaging other lines which are the same.

My code:

compute bot_id_all bot property/atom id   # get id's of the atoms in the group bot
compute bot_id_var bot reduce min c_bot_id_all # get id's of the atom in the group - with lowest id (in fact any could have been taken)

variable bot_id equal c_bot_id_var

variable bot_idd equal ${bot_id}
ERROR: Variable bot_id: Compute used in variable between runs is not current

how to make this code work, so that I can do:
group one_bot_atom id ${bot_idd}
and use this single atom of the group only for averaging the total force?

Thank you in advance for you help!

Check out the vibrant tech community on one of the world's most
engaging tech sites,!
lammps-users mailing list