[lammps-users] probelm regaring dihedral style

Dear sir,

I am facing a problem regarding the dihedral style. I want to use multi harmonic dihedral style for my alkane simulation. But
the form of multi harmonic dihedral in lammps has five coefficients. The potential models available in literature for alkanes
have six or nine or four coefficients. So is it possible to modify few of the lammps subroutines so that the multi harmonic
dihedral can accomodate six coefficients instead of existing five coefficients? If possible which subroutines should I modify.
I have given below the details that I want to do.

lammps multi harmonic dihedral form is

V = sum_i={1,5}(A_i*cos^(i-1)(phi))

I want to add one more term to this function that is the sumation going from 1 to 6 instead of 1 to 5.

Any suggestions is highly appreciated.

kind regards


The file that you’d need to change is “dihedral_multi_harmonic.cpp”. Specifically, take a look at lines 185 and 186:

p = a1[type] + c*(a2[type] + c*(a3[type] + c*(a4[type] + ca5[type])));
pd = a2[type] + c
(2.0a3[type] + c(3.0a4[type] + c4.0*a5[type]));

These are where the forces and energies for the dihedral are computed. You’d also need to change the input to accept more coefficients (see lines 273 to 299 of that same file).

But I think you’d be better off not changing the source code if you can figure a way around it. You might try refitting the dihedrals that you have found in the literature, using 5 coefficients instead.