Issues with OPLS-AA dihedral coefficients in LAMMPS parameter file

Hello everyone,

I am trying to build benzene polymer chains using the OPLS-AA force field and generate a LAMMPS input file. The generated .params file shows that the dihedral_style is multi/harmonic:

# Potentials
pair_style      lj/cut/coul/long ${cutoff} ${charge_cutoff}  # 9.5 
pair_style      lj/cut/coul/long 9.5 ${charge_cutoff}
pair_style      lj/cut/coul/long 9.5 9.5
bond_style      harmonic
angle_style     harmonic
dihedral_style  multi/harmonic
pair_modify     mix geometric tail yes
special_bonds   lj/coul 0 0 0.5

and the corresponding dihedral coefficients are:

dihedral_coeff  1  7.25000  0.00000  -7.25000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  # c3a,c3a,c3a,c3a
dihedral_coeff  2  7.25000  0.00000  -7.25000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  # c3a,c3a,c3a,c3ab
dihedral_coeff  3  7.25000  0.00000  -7.25000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  # c3a,c3a,c3a,c4

LAMMPS returns an error because these coefficients are not compatible with the multi/harmonic style:

ERROR: Incorrect args for dihedral coefficients
For more information see https://docs.lammps.org/err0021 (src/MOLECULE/dihedral_multi_harmonic.cpp:255)
Last input line: dihedral_coeff 1 7.25000 0.00000 -7.25000 0.00000 0.00000 0.00000 0.00000 0

Based on the multi/harmonic definition, the dihedral coefficient array must contain six values, and LAMMPS works correctly if I remove the last five zero entries:

# Dihedral Coeffs
dihedral_coeff  1  7.25000  0.00000  -7.25000  0.00000  0.00000  # c3a,c3a,c3a,c3a
dihedral_coeff  2  7.25000  0.00000  -7.25000  0.00000  0.00000  # c3a,c3a,c3a,c3ab
dihedral_coeff  3  7.25000  0.00000  -7.25000  0.00000  0.00000  # c3a,c3a,c3a,c4
dihedral_coeff  4  7.25000  0.00000  -7.25000  0.00000  0.00000  # c3a,c3a,c3a,h1a

So, how can I fix this in EMC? For reference, I am sharing my .esh setup file that reproduces this behavior:


#=======================================================
ITEM	OPTIONS
replace		true
field		opls-aa
number     true
field_charge false
density		0.05
focus		true
ITEM	END
#=======================================================
# Groups
ITEM	GROUPS
    MP	                           *c1ccc(cc1)*   ,1,MP:2   
    methyl	      *C ,1,MP:1,1,MP:2
ITEM	END
#=======================================================
# Clusters
ITEM	CLUSTERS
    poly		    random,	5
ITEM	END
#=======================================================
# Polymers
ITEM	POLYMERS
    poly
    1		MP,10,methyl,2
ITEM	END
#=======================================================

Moreover, is there any command option in the .esh file to customize the generated LAMMPS file by EMC? I know I can manipulate the build.emc file, but I wonder if I can do it directly through the .esh file.

Dear user,

I just noticed that your question remained unanswered. I used your provided .esh and tried to recreate your observation with the current version of EMC, but was unable to do so. It seems to me that the issue has been resolved.

With regards to your question for modifying LAMMPS using a .esh: you can add verbatim text to your LAMMPS input script by using ITEM LAMMPS (see the EMC manual under ‘Simulation Setup => File Formats => Chemistry File => General’). This allows you to e.g. change parameters etc. after they already have been defined, or add extra integration paragraphs, sampling steps, etc. Actual changes of the output produced by EMC (such as is the case for the .params file) is not possible.

Thanks dear Veld for your reply