Splitting for DPD

Dear lammps developers and users,

I want to implement the spliiting algorithm for the DPD proposed by Shardlow ( within lammps. Here is my idea:

Firstly, I may use the fix_nve.cpp and pair_morse.cpp as a start point for the conservation part in the splitting algorithm. Then, I plan to fulfill the dissipation/fluction part based on fix_temp_rescale.cpp. This dissipation/fluction part requires the relative velocity between two particles. Now, I am confused with adding the loop over the neighbors of particles in fix_temp_rescale.cpp.

For example, how to modify the following code taken from fix_temp_rescale.cpp to obtain the relative velocities between particle i and its neighbors within the cutoff

for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) {
v[i][0] *= factor;
v[i][1] *= factor;
v[i][2] *= factor;

Thanks a lot!


Yong Gan

I suggest you look at the pair_style dpd/tstat command and
code. It implements a DPD thermostat in a pairwise fashion
using the relative velocities of particles. If you want to
loop over neighbors, you are generally better off doing that
in a pair style, than in a fix.