I am writing a custom fix that needs to read the global atom ID’s that are provided in the read_data file. To circumvent local identity change by domain decomposition as atoms shift processors, I am using the atom->map() function:
I am writing a custom fix that needs to read the global atom ID’s that are provided in the read_data file. To circumvent local identity change by domain decomposition as atoms shift processors, I am using the atom->map() function:
this is wrong. the atom->map function converts from the (global) atom ID to the local index (or -1 if the atom is not present).
to get the global ID, you use atom->tag[i], while i loops over local atoms.
I managed to implement global atom ID’s in my fix using atom->tag[ ] and the example in compute_bond_local.cpp (thank you).
Follow up question:
In pair potential.cpp files, usually “i” loops over all atoms in “inum”, which is derived from “ilist”. Does “atom->tag[i]” return the global atom id when “i” is looping over this quantity as well? If not, is there a way to obtain the global atom ID’s given this setup?