[lammps-users] Computing atom property

Hi All,

I am a new user of LAMMPS and starting to learn things.
I would like to compute and record the time evolution of the distance between 2 atoms which are part of different groups . Does anybody have an idea how to do that using fix ave/ or any other commands. I tried using following options but this gives an error.

group a 1 10
group b 11 20

variable b1 x[11]-x[1]

fix 1 all ave/time 1 1000 1000 v_b1 file dist_ev.dat


These commands do it:

varaible b1 equal x[11]-x[1]
thermo_style custom step temp v_b1

You don't need groups to do this.

You may also need

atom_modify map array

at the top of your script if you are not
creating an atom map by default (see the atom_modify command).