mosdef-hub / gmso

Flexible storage of chemical topology for molecular simulation
https://gmso.mosdef.org
MIT License
52 stars 33 forks source link

Allow connection types to be defined by `name` or `atom class` #441

Closed rmatsum836 closed 4 years ago

rmatsum836 commented 4 years ago

In the current foyer xml implementation, connections can be defined either by name or class (example: https://github.com/mosdef-hub/foyer/blob/master/foyer/forcefields/xml/oplsaa.xml). This is very useful because OPLS-AA, for example, defines bond types between two specific classes. Rather than defining redundant bond types between different atom types, a single bond type between two classes can be defined.

I believe we could support something similar in GMSO by changing how the XML is parsed in ff_utils.py. Rather than just checking the types in the connection types to the atom_type names, we could check for both valid name and atomclass.

umesh-timalsina commented 4 years ago

This will require addition of class attribute to our schema. This will also require changes to the xml to forcefield conversion logic as you pointed out.