[lammps-users] The most efficient way to calculate interatomic distance

Dear colleagues, I have a question:

I need to calculate interatomic distances from my system for two cases:

1) Specific distance between two atoms that belong to the same molecule (e.g., distance between the ID 1 and the ID 300 atoms of molecule 1);
2) Specific distance between two different types of atoms of different molecules (e.g., distance of O and H atoms to check for hydrogen bonding)

Would anyone more experienced have any suggestions on how to do this most efficiently in one LAMMPS script (i.e., without slowing down script execution too much)?

I thought of two possibilities:
1) Use the commands
“compute ID group-ID property/local patom1 patom2”
“compute ID group-ID pair/local dist”
(in this case, I’m trying to figure out how to do it correctly).
2) Generate unwrapped trajectory files and perform distance calculations with post processing (in this case, I would only need to generate the trajectory to calculate the 2 types of interatomic distances mentioned).

Thanks for your time.

Best regards,

Emerson Parazzi Lyra

Ph.D. candidate

School of Chemical Engineering

University of Campinas

I would do this in post-processing, i.e. write a suitable trajectory and then analyze it later. there are several toolkits and software packages that you can use for that. doing processing in LAMMPS is primarily useful for tasks that can be parallelized, that take advantage of the existing neighbor list or require access to the force field data.

Thanks for your comments, time and attention, Dr. Axel Kohlmeyer!

Best regards,

Emerson Parazzi Lyra

Ph.D. candidate

School of Chemical Engineering

University of Campinas