How to calculate minimum distance between two atoms inn lammps?

887 Views Asked by At

I have minimized the energy of a system of two atoms. Now I have their coordinates. How do I compute the distance between the two atoms? What is the command to find the distance between the two atoms using their coordinates?

# Screen and file output
thermo          1
thermo_style    custom step etotal temp fmax fnorm dist
compute         pnrg all pe/atom 
compute         1 all pair/local dist
dump            cg all custom 10 Cul_2atom.min id type x y z c_pnrg

# Minimize total structure
min_style       cg
min_modify      line backtrack
minimize        1.0e-10 1.0e-10 30000 100000
undump          cg
undump          rmin  
1

There are 1 best solutions below

0
On

from here - the lammps documentation:

compute 1 all property/local patom1 patom2
compute 2 all pair/local dist eng force
dump 1 all local 1000 tmp.dump index c_1[1] c_1[2] c_2[1] c_2[2] c_2[3]

This will write out the distance, energy, and force between all pairs of atoms in your system and output to a dump file.