marrink-lab / polyply_1.0

Generate input parameters and coordinates for atomistic and coarse-grained simulations of polymers, ssDNA, and carbohydrates
Apache License 2.0
124 stars 21 forks source link

Dihedral i-j-k-l with multiple multiplicities not handled by the `.ff` format #126

Closed ricalessandri closed 3 years ago

ricalessandri commented 3 years ago

The P3HT-P3HT link has a dihedral with 2 multiplicities, i.e., links.ff contains the following two lines (from https://github.com/ricalessandri/polyply_1.0/blob/2514a46e38028130fa04293c812ca9a56ecf09e3/polyply/data/gromos_53A6_polymers/links.ff#L17-L18):

  ST1   CT2  +CT5  +ST1   1        0.0       1.80          1  {"group": "connection"} 
  ST1   CT2  +CT5  +ST1   1        0.0      -9.50          2  {"group": "connection"}

however, the generated polymer itp will contain only 1 line instead of two. The line that gets printed is whatever of the two lines appears last in the links.ff (in this case, 0.0 -9.50 2). I found out about this when porting AA P3HT from the .itp to .ff format (2514a46e38028130fa04293c812ca9a56ecf09e3).

Note that this does work instead if one uses the .itp format (for example, see the M2 P3HT https://github.com/marrink-lab/polyply_1.0/blob/master/polyply/data/martini2_polymers/P3HT.martini.2.itp).

fgrunewald commented 3 years ago

@ricalessandri in fact .ff can handle these dihedrals properly but the solution is a bit awkward. It, however, is mentioned in the tutorial on writing ff input files. You need to add {"version": "x"} to each dihedral, where x has to be different for each term.

ricalessandri commented 3 years ago

I should have checked, my bad! Works indeed (c1acb631d3c1afc5d7e23183944b3431d7293ffa).