Hi Pieter and other EMC users,
I am currently attempting to use EMC to build up a polyimide chain with PCFF force field using partial charges on the atoms that I have derived from quantum mechanical calculations (HF/6-31G* optimization in Gaussian and RESP fitting with Chargemol). To use these charges in EMC, I would like to use the “charge=override” or “c=o” keyword in my groups section where I define the chemistry with SMILES strings, as was shown here. As you can imagine, this is challenging for a monomer and end groups which in my case have ~67 atoms; however, I have done it with some great effort (in the future, I would like to develop a tool to automate this process).
However, I have discovered a bug. despite putting all the atoms, including the now explicit hydrogens, in brackets with their charges (i.e. [C-0.1] or [H+0.1]), the charge for the atom in the SMILES string which immediately follows the polymer connecting point * is NOT read by EMC. Instead, its charge is applied to the following atom, et cetera, until the end of the molecule, and the charge that is supposed to be applied to the final atom is never used. I discovered this using the
field_charge false
flag in my input file and cross-referencing molecule EMC gave me (a monomer of the two end groups merged) versus the optimized geometry and charges from Chargemol.
When I try to assign a charge to the bonding site (i.e., by using ([*+0.0]) in my SMILES string), I get the following error:
Source connect $end1 out of bounds in group
I wanted to flag this because for anyone who wants to do polymeric systems with externally derived partial charges this is a big problem.
Pieter, do you know what the first steps to addressing this bug would be? I would be happy to try and help with it. I’m attaching the relevant files including a slightly modified version of PCFF that just adds an additional rule to type the imide nitrogen as type nb. The .xyz file is my QM optimized structure with RESP charges and the .data file is the EMC output which is not charge neutral due to the bug.
DDEC6_even_tempered_net_atomic_charges.xyz (49.7 KB)
polymer.data (59.7 KB)
polymer.esh (3.1 KB)
pcff.frc (332.4 KB)
pcff_templates.dat (39.1 KB)