Hi, Axel and Steve,
Thank you so much for giving directions. Please forgive me being wordy, since I would like to make a rather detailed description to the problem, and hopefully someone can also benefit from your advice and experience from this thread.
I would like to reproduce the phase diagram of TIP4P-Ew proposed by Paschek et al, 2008 (DOI: 10.1002/cphc.200800539). It covers T ranging from 150 K to 360K, and density from 0.95 g/cm^3 to 1.35 g/cm^3. I used the temper command to simulate the same temperature grids as Paschek, at a couple of density settings. At high temperatures (roughly above 240K), the results look good, but at low temperatures, calculated pressures are way below the literature data. We presume this is because the states are trapped at local minimums. Hence to speed up the sampling, we need density swap in addition to temperature swap among states.
My goal is: retain the main structure of temper.cpp with an addition to density swap.
Say, I have 6 temperatures and 4 densities, so totally 24 states. Here is my idea. I place the replicas as below:
[0 1 2 3 4 5 ] [6 7 8 9 10 11] [12 13 14 15 16 17] [18 19 20 21 22 23]
The states in the bracket are of the same density, and the temperatures are repeated every 6 replicas.
(i.e., I break down the 2D matrix (T-density) into a 1D array)
T-swap: states in the bracket
density-swap: pairs such as 0<->6<->12<->18, 3<->9<->15<->21, and etc.
I was not thinking carefully yesterday…I intended to swap the physical molecule sets between the density pairs, so I need to update the neighbor list as well. But actually it could be done similarly as how you did in the T-swap. Namely, Only rescale the volumes of the states if a density swap occurs. (molecules stay where they are, only the “location of the state labels” are changed). However, this approach also requires the system domains (and other related settings) to be exchanged.
So, could you please direct me to the code piece to be invoke for the domain swap? I looked at domain.cpp…can I call reset_box() to let it do the thing after my molecule topology is expended/shrunk?
Great appreciations to all the valuable help and advice.
LC Liu
ps., I know rescaling the volume is a bit dangerous…so I will give an eye on the density difference and time step.