You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In principle, the question is formulated in the header. What I mean is if it's possible to use two different xml files [ that hopefully have no conflicts ] to define a force-field for the same molecule? I'm interested since on top of the default oplsaa.xml I might have some add-ons that I would like to use without modifying the original file.
The text was updated successfully, but these errors were encountered:
Hey @iGulitch. You can't use two forcefields on the same molecule currently, but you could use two forcefields each on their own molecule that you specify with the molecule name. The function you need lives in GMSO. Note the text defining the forcefields argument, which can take a dictionary. We intend to include residue matching for forcefields using the same API, but haven't quite determined a consistent way to handle connections that would occur between residues.
If you have two forcefields xmls, and want to combine them into a single forcefield, here's a script that should work:
importgmsoff1=gmso.ForceField("path_to_xml1.xml")
ff2=gmso.ForceField("path_to_xml2.xml")
ff1.atom_types.update(ff2.atom_types) # this will overwrite atomtypes that have the same name in ff1. Use this with careforff_attrin ["bond", "angle", "dihedral", "improper"]:
gettattr(ff1, ff_attr).update(getattr(ff2, ff_attr) # i.e. ff1.bond_types.update(ff2.bond_types)# same warnings applyff1.to_xml("updated_name.xml")
In principle, the question is formulated in the header. What I mean is if it's possible to use two different
xml
files [ that hopefully have no conflicts ] to define a force-field for the same molecule? I'm interested since on top of the defaultoplsaa.xml
I might have some add-ons that I would like to use without modifying the original file.The text was updated successfully, but these errors were encountered: