Dear Lammps users,
Hi,
I have a question about the example in compute global/atom command in manual. Here, we have a nice example that calculates relative displacement of the atoms inside the molecule w.r.t. the COM of the molecule as follows:
compute cc1 all chunk/atom molecule
compute myChunk all com/chunk cc1
compute prop all property/atom xu yu zu
compute glob all global/atom c_cc1 c_myChunk[*]
variable dx atom c_prop[1]-c_glob[1]
variable dy atom c_prop[2]-c_glob[2]
variable dz atom c_prop[3]-c_glob[3]
variable dist atom sqrt(v_dx*v_dx+v_dy*v_dy+v_dz*v_dz)
dump 1 all custom 100 tmp.dump id xu yu zu c_glob[1] c_glob[2] c_glob[3] &
v_dx v_dy v_dz v_dist
dump_modify 1 sort id
Now, is there any way we can do it " inside the lammps " w.r.t. specific atom in molecule ( let’s say each molecule contains only one Oxygen and I want to calculate the relative displacement w.r.t. it )
Thanks,
Shargh