Specifying pairwise interactions using OPLS file distributed with moltemplate

Following up with a previous post, I am preparing a simulation in which I am replacing

pair_style lj/cut/coul/long


pair_style hybrid/overlay lj/smooth coul/long

My understanding from the documentation is that if you use hybrid/overlay, the user must specify all cross-interaction terms explicitly.

I use moltemplate to prepare the input files, and in the process of building my system I am using the OPLS file distributed with moltemplate which contains over 900 atom (or united atom) types. When I specify the cross-interactions for the 8 or so atom types that I am using in my simulation, lammps then wonders where the interaction terms are for the remaining 800+ atom types. I know this from including info coeffs in the script and seeing an enormous output in the .out file containing every cross-interaction pair for all 900 atoms where each one is marked “not set” and from receiving the error “All pair coeffs are not set (…/pair.cpp:232)”.

My question is this: Is there a way to tell lammps that I only want to look at the coefficients for those 8 or so atoms that I am using without having to go into the data file or moltemplate oplsaa.lt file and remove all of the unused atom types?

Not a deal-breaker if I have to specify each pairwise term… but it would save a little time if I didn’t.

The output file is a bit large, so I have not attached it here. I have however included my in.settings file where you can see I have specified the cross-wise terms manually as well as the oplsaa.lt file distributed with moltemplate.

Kind regards,
polysystemNEW.in.settings (79.5 KB)
oplsaaAJ.lt (572.0 KB)

You can use * instead of atom type in pair_coeff line to set coefficients for all pairs at once and then overwrite the important pairs in subsequent lines, e.g.

pair_coeff * * lj/smooth 0.0 0.5
pair_coeff 1 1 lj/smooth 10.0 1.5

You can easily obtain the mixed coefficients for lj/smooth if you construct an input with only lj/smooth and then use the write_coeffs command to write out all coeff settings to a file which can be added later with the include command.

Then all you need to do is to keep only the pair_coeff section of that file, insert the lj/smooth keyword as needed for the hybrid style and then add a line pair_coeff * * coul/long to set all required coeffs for the coulomb style (there are none and thus the same for all).

@akohlmey Okay, thank you. I’ll give that a try.

@mkanski thank you for the tip!