This post comes as I am in the process of implementing pair_style hybrid/overlay lj/smooth coul/long with the OPLS forcefield using the OPLS file distributed with moltemplate.
Taking advice received from a recent post, I generated all of the cross-wise coefficients for the lj potential using the
write_coeff command while specifying in the in.init file only a lj/cut/coul/long potential. I then modified my in.settings file by removing the list of pair_coeffs (which only consisted of like-interactions) and adding the explicit like and unlike coefficients obtained from the
write_coeff command. I then ran lammps again, this time with pair_style hybrid/overlay lj/smooth coul/long and received the “numeric index is out of bounds” error which, from a survey of this forum, is quite common.
The error came at the first line in the in.settings file, which was the very beginning of the pair coefficients. As best I could tell from reading other posts in the forum, this was due to a mismatch between the data file and the settings file (i.e. the number of coefficients lammps had been told to expect in the system from the data file and the number of coefficients lammps saw in the settings file). So, I rebuilt the system in moltemplate using the
hybrid/overlay pair style, hoping that this would build the data file to be compatible with the coefficients for the hybrid potential.
However, moltemplate did what it was supposed to and produced a settings file with just the like-interaction coefficients, which I replaced with the output from
write_coeff. Running lammps again with this newly-built system from moltemplate, which was built with the hybrid/overlay pair style and updated with the coefficients list from
write_coeff, also yielded the numeric index out of bound error.
So, I am trying to track down the cause of lammps not seeing the number of coefficients it’s expecting to see. Any suggestions would be appreciated. The settings file is large (19 MB) due to containing the cross-coeffs for all 906 atom types in the OPLS file. I have pasted the first few lines below (showing up as a table, don’t want to change the formatting - it’s just text in the file). The in.init and log file are attached.