particle IDs

Submitted by hamedhoori on Wed, 11/20/2024 - 22:53

Hi,
I need help understanding how the fix commands work. Specifically, when you assign a value to a fix variable of a particle, should the index of the particle be its global ID (tag) or local ID (index in the code)? For example:

...
double *heatSource = fix_heatSource->vector_atom;
heatSource[i] = ...;
...

In this case, I need to know if i refers to the global ID or the local index, and whether it starts from 0 or 1. I couldn't find this and need to know to be sure about my algorithm.

Additionally, in my code, I use atom->map() to convert a global ID (tag) to a local processor ID. However, when I use it, I sometimes get -1 as the ID for a given tag. Does this mean that the specific particle is not present in that subdomain, or does it mean something else?

Update: I figured out the -1 Local ID, but now I have a question: How do I have access to the fix value of that specific particle? Is there a way, such as MPI_Allreduce()?

Thanks,
Hamed