The fix_create_bond command is a powerful way to empirically approximate chemical reactions in LAMMPS based on the nearest distance between atoms. However, there is currently no way to print out these distance values to make an empirical fit based on, for example, temperature of the system. Therefore I have written a new compute based on “create_bond” code which prints out the Nearest Nonbonded Neighbor distance, taking into account connectivity, bond type, and max bonds allowed (which is less convenient to do in post-processing).
It goes like this:
compute my_comp all nnn Rmin itype imaxbond jtype jmaxbond bondtype
for example: compute my_comp all nnn 5 2 4 3 4 1
It can be printed with:
dump mine all local 1 my_text.txt c_my_comp c_my_comp
This prints the atom ID of each atom of itype and its distance to the nearest nonbonded jtype atoms. If this distance is more than Rmin, it prints 1E20. Please find the files attached.
compute_nnn.cpp (6.99 KB)
compute_nnn.h (747 Bytes)