[lammps-users] Granular pair styles and fix_shear_history

Hello. I am working on implementing a new pair style using Walton model interactions. Like the Hertz and Hooke styles (gran/hertz/history and gran/hooke/history), this new style (gran/walton/history) will use fix_shear_history to store a shear[] array. However, it also needs an additional history value other than just the 3 shear values (x, y, z).

To do this, I copied most of the code from pair_gran_hooke_history.cpp, reimplemented some of the functions (compute(), settings(), and the restart functions), and changed neighbor->requests[irequest]->dnum from 3 to 4. However, fix_shear_history and some places in neigh_gran and neigh_derive had the value of 3 hardcoded instead of using dnum.

I have changed those places in the code to use dnum instead of 3 (e.g. "shear = &allshear[3*jj]"). From some initial testing, it seems to work with the extra double value (a0). Would this be a useful addition to LAMMPS? I can send a patch file with the changes.

Thanks.