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

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


From: Al web <kondorkondor@...1092...>
Date: Thu, 12 Apr 2018 18:28:05 +0300



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!