Using pair_hybrid and read_data commands simultaneously

Hello,

I had been attempting to use read_data with mixing rules to apply one pair style and then replace a certain subset of pair interactions with a different pair style. (See the abbreviated input files below). However, I see the error “All pair coeffs are not set (pair_hybrid.cpp:505).” Inspection of the array with GDB shows that only the interactions specified by pair_coeff outside of the datafile are set. I suspect I may be specifying Pair Coeffs in my datafile improperly. Am I missing arguments in the datafile? Or does one have to specify every set of pair interactions when using a pair_style hybrid? I have 17 site types, and would like to avoid specifying these interactions.

... pair_style hybrid 3spn2 ${T} ${salt} 18.0 50.0 0.61 0.67 1.266 3spn2_ions ${T} ${salt} 18.0 50.0 ... read_data [conf_lammps.in](http://conf_lammps.in)

pair_coeff 1 1 3spn2_ions … # P-P
pair_coeff 1 15 3spn2_ions … # P-Na+
pair_coeff 1 16 3spn2_ions … # P-Mg+
pair_coeff 1 17 3spn2_ions … # P-Cl-
pair_coeff 15 15 3spn2_ions … # Na±Na+
pair_coeff 15 16 3spn2_ions … # Na±Mg2+
pair_coeff 15 17 3spn2_ions … # Na±Cl-
pair_coeff 16 16 3spn2_ions … # Mg2±Mg2+
pair_coeff 16 17 3spn2_ions … # Mg2±Cl-
pair_coeff 17 17 3spn2_ions … # Cl–Cl-

pair_modify mix arithmetic


</Input file>

<conf_lammps.in>

Pair Coeffs

1 3spn2 …
2 3spn2 …
3 3spn2 …
4 3spn2 …
5 3spn2 …
6 3spn2 …
7 3spn2 …
8 3spn2 …
9 3spn2 …
10 3spn2 …
11 3spn2 …
12 3spn2 …
13 3spn2 …
14 3spn2 …
15 3spn2 …
16 3spn2 …
17 3spn2 …


</conf_lammps.in>

Thank you,

Dan

Assuming your 2 pair styles do mixing themselves, then
you don't have to specify cross terms within each sub-style.
But you do have to explicitly specify all cross terms
that involve both sub-styles. Your list below does not
include 2-to-14 crossed with 15-to-17. Note that you
can do something like:

pair_coeff 1*14 1*14 3spn2 ...
pair_coeff 1*14 15*17 3spn2_ions ...
pair_coeff 15*17 15*17 3spn2_ions ...

and not use the data file at all.

Also you could
list 2spno2_ions as the pair style for 15-17 in the data file
and avoid specifying all its pairings with pair_coeff commands.

On another note - are you interested in releasing your
new pair styles in LAMMPS? I assume from the name
they have some orientational properties ...

Steve

Hi Steve,

I’ve added the cross terms to define the interactions between atoms belonging to different pair styles, as shown below (essentially an excluded volume interaction):

pair_coeff 1 2 lj/cut 0.184000 5.350000 6.005172
pair_coeff 1 3 lj/cut 0.184000 4.950000 5.556187

pair_coeff 2 15 lj/cut 0.184000 4.315000 4.843424

However, I still see the error saying that not all pair_coeffs are set (pair_hybrid::init_one()). Further investigation shows that, even if I define the 1,2 interaction, the 2,1 interaction is not set (setflag[i][j] = 0).

I’ve tried to add the 2,1 interaction manually but pair_lj_cut.cpp() tells me that I have “Incorrect args for my pair coefficients.”

What else needs to be done to ensure that the (i > j)th pair interactions are set?

Thank you,

Dan

Interactions with i > j are never set in the input script, for any pair style.
Nor is init_one() called with i > j. Please post all your pair commands if
you still have problems.

Steve