foyer: FoyerError: Found no types for atom 0 (carbon).
I’m working on a ‘hello world’ example for using foyer + mbuild + hoomd to run a hoomd simulation. I ran into an issue when trying to create a forcefield file. I created a minimal example below:
import mbuild as mb
class CH2(mb.Compound):
def __init__(self):
super(CH2, self).__init__()
self.add(mb.Particle(name='C', pos=[0,0,0]), label='C[$]')
self.add(mb.Particle(name='H', pos=[-0.109, 0, 0.0]), label='HC[$]')
self.add(mb.Particle(name='H', pos=[0.109, 0, 0.0]), label='HC[$]')
ch2 = CH2()
ch2.save("poly_gen.hoomdxml", overwrite=True, forcefield_name="oplsaa")
Traceback (most recent call last):
File "test.py", line 13, in <module>
ch2.save("poly_gen.hoomdxml", overwrite=True, forcefield_name="oplsaa")
File "/home/mike/Projects/mbuild/mbuild/compound.py", line 1300, in save
structure = ff.apply(structure)
File "/home/mike/Projects/foyer/foyer/forcefield.py", line 239, in apply
system = self.createSystem(topology, *args, **kwargs)
File "/home/mike/Projects/foyer/foyer/forcefield.py", line 301, in createSystem
find_atomtypes(atoms=list(topology.atoms()), forcefield=self)
File "/home/mike/Projects/foyer/foyer/atomtyper.py", line 42, in find_atomtypes
_resolve_atomtypes(atoms)
File "/home/mike/Projects/foyer/foyer/atomtyper.py", line 95, in _resolve_atomtypes
n, atom.element.name))
foyer.exceptions.FoyerError: Found no types for atom 0 (carbon).
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 26 (26 by maintainers)
So I was was able to create a usable forcefield.xml file by feeding this file into parmed:
I’ll then pull out the parameters I need and merge them into the oplsaa parameters from foyer (to take advantage of the atom typing work that’s already done).