How to request neighbor list for post force fix

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.

  1. 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;

  2. Following code at the beginning of post_force method:
    neighbor->build_one(list);

list is defined as int * in header file

  1. A method named init_list
    void FixPolar::init_list(int id, NeighList *ptr)
    {
    list = ptr;
    }

Thanks in advance.

Han

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

but fix orient/fcc does.

could help me to find if I miss some thing.

1. 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;
2. Following code at the beginning of post_force method:
          neighbor->build_one(list);

why this? the neighbor list class will build your neighborlist for you
according to your request.

axel.