Is there any way to add the partial charges of the atoms in a monomer manually? Adding them in the opls-aa.top file does not work, since one rule has only one charge.
What I ended up doing is like this:
I used field_charge false in the esh file. Then after generating the polymer, I replaced the column for charge in the data file. This was fairly easy since you can get a idea about the arrangement of particle_id by first making a polymer with one or two monomers. If someone needs the matlab script, feel free to ask.
Dear user,
It is to be commended, that you found a way to solve your problem! A better way exists however, which without your question I would not have known not to be working anymore. You can actually directly assign user defined partial charges in your group definitions, e.g. for water (bad example, I know, but for illustration purposes):
ITEM OPTIONS
replace true
field trappe-ua
ntotal 1000
density 0.1
number true
focus true
emc_output exit=true
emc_execute true
ITEM END
ITEM SHORTHAND
water O,1
water1:c=a [O+0.2]([H-0.1])([H-0.1]),1
# equivalent to water1:charges=additive
water2:c=o [O-0.8]([H+0.4])([H+0.4]),1
# equivalent to water2:charges=override
ITEM END
Please note that you will have to download a new version of EMC (still v9.4.4 of 20230801, just a newer updated version, to be downloaded from here), since I noticed a bug existed in the C code. I have also included a new version of EMC Setup, which is capable of interpreting the above .esh
.