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
Related to #238 and #188 and #192. Currently, the ForceField class in GMSO is just a container with a bunch of dictionaries for each potential terms. You can search an AtomType, BondType, AngleType etc... by their class/type names with . However, the following things are missing from the current implementation:
No support for BondTypes/AngleTypes/DihedralTypes with wildcards. Full or Partial wildcards support
No utility to support wildcard patterns for an AtomType class name.
Resolution
After #501, we can support arbitrary tags for any Potential type in gmso. Which means if we want to add wildcard patterns that a particular atom type is supposed to match, these patterns (list, set) can be added and saved as a tag like atom_class_patterns for an AtomType. A tokenizer for wildcard tokens for an AtomType might look like( Assuming that there's no branching in partial wild cards for a particular type/class (which I am not convinced is the case and warrants further discussion)):
Now comes the search problem in the ForceFiled. I think a st. forward way to do it would be to override object.__getitem__ for the ForceField class to search for wildcard matches in multiple passes. For example if a ForceField has a dihedral type like:
A Dihedral in a Topology with four Atoms with their atomclasses ['Ar', 'Ar', 'Ar', 'Ar'], should match the above dihedral type while parametrizing the Topology.
Unanswered Questions
What rules if any should be followed while matching partial/full wildcards?
Are there any restrictions in the presence of wildcards?
What is the precedence order in case a multiple match is found?
Any alternative ideas for the resolution of the problem?
The text was updated successfully, but these errors were encountered:
In #506, I have implemented a tokenizer class. I am going for an exact match rule there. But, I think there can be a regex based solution as well. Lets look at an example:
Now, if these to AtomClasses i.e. Xe and Ar are associated with two atoms that have a Bond in a Topology, while parameterizing the sytem using this ForceField, The following precedence order should be followed:
If there is a BondType, where member types is [ Xe, Ar ] in the ForceField the3. If there as BondType where member types is [ *, Ar ] in the ForceField the Bond should be assigned that BondType.
If there as BondType where member types is [ *, Ar ] in the ForceField the Bond should be assigned that BondType. Bond should be assigned that BondType.
If there as BondType where member types is [ X*, Ar ] in the ForceField the Bond should be assigned that BondType.
If there as BondType where member types is [ *, Ar ] in the ForceField the Bond should be assigned that BondType.
If there as BondType where member types is [ Xe, * ] in the ForceField the Bond should be assigned that BondType. etc...
However, there are multiple cases for these rules and I think we need some domain expertise to generalize these rules @mosdef-hub/mosdef-contributors.
Related to #238 and #188 and #192. Currently, the ForceField class in GMSO is just a container with a bunch of dictionaries for each potential terms. You can search an
AtomType
,BondType
,AngleType
etc... by their class/type names with . However, the following things are missing from the current implementation:Resolution
After #501, we can support arbitrary tags for any
Potential
type ingmso
. Which means if we want to add wildcard patterns that a particular atom type is supposed to match, these patterns (list, set) can be added and saved as a tag likeatom_class_patterns
for anAtomType
. A tokenizer for wildcard tokens for anAtomType
might look like( Assuming that there's no branching in partial wild cards for a particular type/class (which I am not convinced is the case and warrants further discussion)):And the
AtomType
can be extended to have a method like:Now comes the search problem in the
ForceFiled
. I think a st. forward way to do it would be to overrideobject.__getitem__
for the ForceField class to search for wildcard matches in multiple passes. For example if aForceField
has a dihedral type like:A
Dihedral
in aTopology
with four Atoms with their atomclasses['Ar', 'Ar', 'Ar', 'Ar']
, should match the above dihedral type while parametrizing theTopology
.Unanswered Questions
The text was updated successfully, but these errors were encountered: