Dear LAMMPS developers,
We modified the pair style lj/cut/tip4p/long, such that the virtue site (instead of oxygen) in the TIP4P model will be used for computing Lennard-Jones (LJ) interaction.
Two files were modified, pair_lj_cut_tip4p_long.cpp and pair_lj_cut_tip4p_long.h, in the “settings” function so that it reads in additional parameters.
nwtype = force->inumeric(FLERR,arg[7]);
if (nwtype < 1) error->all(FLERR,"tip4p_yw requires at least one wall atom type\n”);
if (narg < 8+nwtype) error->all(FLERR,"not enough parameters for pair tip4p_yw, check number wall types specified\n”);
typeW = new int[nwtype];
for(int i=0; i<nwtype; i++)
{
typeW[i] = force->inumeric(FLERR,arg[8+i]);
}
To compute LJ interaction using TIP4P virtual site (instead of oxygen), we modified the “compute” function. The modified codes are attached.
The modified code works fine with serial runs. But it crashed with parallel runs with the error message:
“ERROR on proc 1: TIP4P hydrogen is missing (…/pair_lj_cut_tip4p_long.cpp:201)”.
And when we checked the source code, this error message will be printed if the two atoms following an oxygen atom are not hydrogen atoms.
This error does not happen when the code runs in serial version. This means that in parallel runs, the atom types were changed, or not communicated correctly among cores.
Could someone guide me the directions to debug this error?
More explanation about using this modified pair type is as follows:
pair_style lj/cut/tip4p/long otype htype btype atype qhist ljcut qcut nwtype wtype1 wtype2 … wtypenw
Syntax
otype, htype = atom types for TIP4P O and H
bytpe, atype = bond and angle types for TIP4P waters
qdist = distance from O atom to the massless charge M (distance units)
ljcut = global cutoff for the LJ interaction (distance units)
qcut = global cutoff for the Coulombic interaction (distance units)
nwtype = number of types of atoms that interact with M, not O, in computing the LJ interaction
wtype1, wtype2, …, wtypenw = types of atoms that interact with M, not O, in computing the LJ interaction
Example
Pair_style lj/cut/tip4pwwa/long 3 4 1 1 0.15 14.0 14.0 2 1 2
Thank you in advance.
Yanbin
pair_lj_cut_tip4p_long.cpp (20.8 KB)
pair_lj_cut_tip4p_long.h (3.35 KB)