Dear fellow LAMMPS users,
I am currently making a new fix that evaluates particle positions before and after integration, and I’ve come across the following issue:
- At the end of a time step (end_of_step) I access the (local) neighbor list through list->ilist
- I loop over the local particles (atom->nlocal) with iterator j, get their local ID through i = list->ilist[j], and fetch their tag through atom->tag[i]
- Then, when I perform the same loop at the beginning of a time step (post_integrate), I get a different atom tag for a given value of i = list->ilist[j]
I’m not entirely sure what is going on, but it seems to me that list->ilist was not updated after the neighbor list was rebuilt, so that the local particle IDs no longer refer to the same particles as before. My question: what is the procedure for getting an up-to-date neighbor list during each stage of a time step?
I wished I understood the process a bit better, so that I could show relevant pieces of code. Maybe this piece helps:
void FixNewFix::init()
{
dt = update->dt;
int irequest = neighbor->request((void *) this);
neighbor->requests[irequest]->pair = 0;
neighbor->requests[irequest]->fix = 1;
neighbor->requests[irequest]->occasional = 0;
neighbor->requests[irequest]->ghost = 1;
}
Please ask if I need to provide more code or clarification
Thanks and regards,
Martijn van den Ende