Nearest Nonbonded Neighbor compute


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[1] c_my_comp[2]

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.


Jake Gissinger

compute_nnn.cpp (6.99 KB)

compute_nnn.h (747 Bytes)

Hi Jake - I can release this new compute in LAMMPS, but also need a doc/compute_nnn_local.txt

file that documents the command.

I also don’t understand why this isn’t a compute nnn/atom command. If I understand

there is at most one value per atom produced? Not multiple values per atom, like

the other compute */local commands that operate on pairs or bonds, etc?

Could the command simply be written/used with a group and a single atom type (call it Mtype) arg

that calculates (for each atom in the group) its min distance to an Mtype atom? Also

not clear what the imaxbond and jmaxbond params mean or it they would affect

what I’m asking.