from flowermd.base import Molecule
from flowermd.base import Pack
from flowermd.library.forcefields import FF_from_file
import unyt
p3ht = Molecule(num_mols=20, smiles="CCCCCCc1ccsc1")
system = Pack(molecules=p3ht, density=0.5 * unyt.g/unyt.cm**3)
p3ht_ff = FF_from_file(forcefield_files="/home/smccallum/flowerMD/P3HT.xml")
system.apply_forcefield(r_cut=2.5, force_field=p3ht_ff, auto_scale=True)
For the minimal working example above, Foyer isn't getting the expected atom types.
File ~/miniforge3/envs/flowermd/lib/python3.11/site-packages/foyer/atomtyper.py:228, in _resolve_atomtypes(topology_graph, typemap)
222 raise FoyerError(
223 "Found multiple types for atom {} ({}): {}.".format(
224 atom_id, atoms[atom_id].atomic_number, atomtype
225 )
226 )
227 else:
--> 228 raise FoyerError(
229 "Found no types for atom {} ({}).".format(
230 atom_id, atoms[atom_id].atomic_number
231 )
232 )
FoyerError: Found no types for atom 0 (6).
For the minimal working example above, Foyer isn't getting the expected atom types.