Dear all,
I’m writing a fix style to add extra force due to polarization by post_force method. I wonder how I could get the neighbour list. I check some fix including efield and add force which utilize post_force method but they don’t need neighbour list. Currently, what I do is the following. If anyone could help me to find if I miss some thing.
-
Following code in init mehod:
int irequest = neighbor->request(this,instance_me);
neighbor->requests[irequest]->half = 0;
neighbor->requests[irequest]->full = 1;
neighbor->requests[irequest]->pair = 0;
neighbor->requests[irequest]->fix = 1; -
Following code at the beginning of post_force method:
neighbor->build_one(list);
list is defined as int * in header file
- A method named init_list
void FixPolar::init_list(int id, NeighList *ptr)
{
list = ptr;
}
Thanks in advance.
Han