I am trying to run a simulation that involves mixing LJ pair styles from the TIP4P water model and AMBER force field (lj/cut/tip4p/long
and lj/charmm/coul/long
, respectively). Despite reading the LAMMPS docs and reviewing many posts here I am unable to make my input work properly, because parameter mixing is not being activated. I’m struggling to understand what is wrong with my input and would appreciate any assistance!
In my input file, I specify a hybrid
pair style and arithmetic mixing. According to the LAMMPS manual, both pair styles support mixing (TIP4P) (CHARMM)
pair_style hybrid lj/cut/tip4p/long 2 1 1 1 0.10527 9.0 7.0 lj/charmm/coul/long 7.0 9.0 7.0
pair_modify arithmetic
I-I pair coefficients are specified in the Pair Coeff
section of a separate data file:
Pair Coeffs
1 lj/cut/tip4p/long 0.000000 0.000000
2 lj/cut/tip4p/long 0.179080 3.165500
3 lj/cut/tip4p/long 0.013144 2.464226
4 lj/charmm/coul/long 0.086000 3.399670
5 lj/charmm/coul/long 0.109400 3.399670
6 lj/charmm/coul/long 0.061000 3.118146
7 lj/charmm/coul/long 0.210000 2.959922
8 lj/charmm/coul/long 0.250000 3.563595
But my simulation fails with
ERROR on proc 0: All pair coeffs are not set (src/pair_hybrid.cpp:632)
Adding a info coeff
command to my input file confirms that no I-J coefficients are being calculated:
Info-Info-Info-Info-Info-Info-Info-Info-Info-Info-Info
Printed on Tue Sep 14 12:50:10 2021
Coeff information:
Pair Coeffs:
1 1 : is set
1 2 : is not set
1 3 : is not set
1 4 : is not set
1 5 : is not set
1 6 : is not set
1 7 : is not set
1 8 : is not set
2 2 : is set
2 3 : is not set
2 4 : is not set
2 5 : is not set
2 6 : is not set
2 7 : is not set
2 8 : is not set
3 3 : is set
3 4 : is not set
3 5 : is not set
3 6 : is not set
3 7 : is not set
3 8 : is not set
4 4 : is set
4 5 : is not set
4 6 : is not set
4 7 : is not set
4 8 : is not set
5 5 : is set
5 6 : is not set
5 7 : is not set
5 8 : is not set
6 6 : is set
6 7 : is not set
6 8 : is not set
7 7 : is set
7 8 : is not set
8 8 : is set
But I don’t understand why the mixing rule is not being applied, since both pair styles support mixing.
The following passage from the pair_hybrid docs may explain it, but I’m confused by its meaning. The first sentence implies that I-J mixing can only be used when both I and J are assigned the same sub-style, but the 2nd to last sentence seems to indicate that this requirement only applies to hybrid/overlay
and hybrid/scaled
styles.
For atom type pairs I,J and I != J, if the sub-style assigned to I,I and J,J is the same, and if the sub-style allows for mixing, then the coefficients for I,J can be mixed. This means you do not have to specify a pair_coeff command for I,J since the I,J type pair will be assigned automatically to the sub-style defined for both I,I and J,J and its coefficients generated by the mixing rule used by that sub-style. For the hybrid/overlay and hybrid/scaled style, there is an additional requirement that both the I,I and J,J pairs are assigned to a single sub-style. If this requirement is not met, no I,J coeffs will be generated, even if the sub-styles support mixing, and I,J pair coefficients must be explicitly defined.
I suppose my question boils down to this - is it possible to use mixing rules to obtain I-J parameters by mixing I-I and J-J parameters from different force fields, provided they both support mixing? Or must I specify all I-J interactions manually?
Thank you in advance for any assistance.