Dear LAMMPS developers and users,
Greetings. First, please accept my apologies if I have bothered you too many times on this issue. I thought I have solve this problem, but there are apparently something I overlooked. So please kindly share your wisdom, and I am truly thankful for all the help and comments.
I am modifying the temper command to increase its capability to swap both volume (density) and temperature among replicas. The idea is simple: I mimic what the author did in T swap and employ the process to V swap. Say, I am having the following 9 replicas:
0 1 2
3 4 5
6 7 8
Replicas in the same column are of the same temperature, and those in the same array are of the same volume (density). So, replica 4 swaps with 3 or 5 for T swap, and it swaps with 7 or 1 when a V swap is employed.
Since the domain size is changed after the V swap, I need to deal with the atom allocation (and neighbor list) problem. I checked the logic of change_box.cpp and fix_deform.cpp, but neither of them can be readily transplanted into my code.
change_box: it is defined between runs, so the atoms are properly allocated at the beginning of the next run.
fix deform: it has pre_exchange and end_of_step to deal with the neighbor list/kspace problem, but mine is a command. I do not know how to write a fix to force_reneighbor=1 and force->kspace->setup() when it is not perform in each step but after my V swap.
Currently I am issuing the following three lines at the bottom of each volume change (the idea is to build the neighbor list/kspace grid/ghost atom list from scratch):
update->integrate->cleanup();
lmp->init();
update->integrate->setup();
It works ok, but, occasionally(probably once several ns), my MD stops running, sometime showing a lost atom, sometime not. This lost-atom thing gets rarer if I enlarge the skin depth, but the pay is painful: much longer simulation time. This seems to defeat the whole purpose of employing REMD (to save time)…
Aside from the above cure, which does not work well, I think my last choice is to brutally insert the neighbor list/irregular migration/kspace pieces into verlet.cpp? But this is quite il-legitimate…
Thank you again for your attention. Any comment/suggestion is gratefully welcomed.
Sincerely,
LC Liu