Dear Lammps developers,
I am creating a compute style to calculate the neighbor list correlation function (NLCF) following the paper:
Rabani, E., Gezelter, J. D., & Berne, B. J. (1997). Calculating the hopping rate for self-diffusion on rough potential energy surfaces: Cage correlations. The Journal of chemical physics, 107(17), 6867-6876.
Our research group already has a python script that works as a post-processing tool; It uses the coordinates of the atoms that are in the dump files to create a neighbor list for each atom based on a cutoff (smaller than the force cutoff). However, We think it would be more convenient to have this feature as a compute style.
We choose to use ‘compute_orientorder_atom’ as a starting point for ‘compute_nlcf’ since this compute style builds neighbor lists based on a cutoff and iterates through every atom to perform the computation.
One of the main challenges we have faced during the development of compute_nlcf is that in order to compute the NLCF at any time step, we need to retrieve the neighbor list of each atom at time = 0; meaning that we have to store it in memory.
We have seen that one method to store data, such as atom coordinates, is to use fix_store. So far we think that fix_store only supports saving data within a ‘n by m’ matrix (please correct me if I am wrong). We would like to use a fix_store or some other type of LAMMPS implemented method to save our neighbor lists at time = 0, but a key issue is that every neighbor list can ultimately be a different size.
For now, we have implemented this storing process using a multi-dimensional dynamic array int** that is a member variable of the compute_nlcf class. When compute_peratom() is invoked we use a flag variable to determine if time = 0. If it is, then for each atom ‘i’ and its neighbor list ‘nearest[ ]’, we dynamically allocate enough memory (size of nearest[ ]) and store this neighbor list in the int** member variable.
Please, if there is any more efficient method already implemented that we can use to store the neighbor list at time = 0, please let me know.
I am using LAMMPS version 22 August 2018.
Thank you.
-S