57 |
|
std::vector<std::string> keys; |
58 |
|
keys.push_back(at1); |
59 |
|
keys.push_back(at2); |
60 |
– |
return bondTypeCont_.find(keys, wildCardAtomTypeName_); |
60 |
|
|
61 |
+ |
//try exact match first |
62 |
+ |
BondType* bondType = bondTypeCont_.find(keys); |
63 |
+ |
if (bondType) { |
64 |
+ |
return bondType; |
65 |
+ |
} else { |
66 |
+ |
//if no exact match found, try wild card match |
67 |
+ |
return bondTypeCont_.find(keys, wildCardAtomTypeName_); |
68 |
+ |
} |
69 |
+ |
|
70 |
|
} |
71 |
|
|
72 |
|
BendType* ForceField::getBendType(const std::string &at1, const std::string &at2, |
75 |
|
keys.push_back(at1); |
76 |
|
keys.push_back(at2); |
77 |
|
keys.push_back(at3); |
78 |
< |
return bendTypeCont_.find(keys, wildCardAtomTypeName_); |
78 |
> |
|
79 |
> |
//try exact match first |
80 |
> |
BendType* bendType = bendTypeCont_.find(keys); |
81 |
> |
if (bendType) { |
82 |
> |
return bendType; |
83 |
> |
} else { |
84 |
> |
//if no exact match found, try wild card match |
85 |
> |
return bendTypeCont_.find(keys, wildCardAtomTypeName_); |
86 |
> |
} |
87 |
|
} |
88 |
|
|
89 |
|
TorsionType* ForceField::getTorsionType(const std::string &at1, const std::string &at2, |
93 |
|
keys.push_back(at2); |
94 |
|
keys.push_back(at3); |
95 |
|
keys.push_back(at4); |
96 |
+ |
|
97 |
+ |
TorsionType* torsionType = torsionTypeCont_.find(keys); |
98 |
+ |
if (torsionType) { |
99 |
+ |
return torsionType; |
100 |
+ |
} else { |
101 |
+ |
//if no exact match found, try wild card match |
102 |
+ |
return torsionTypeCont_.find(keys, wildCardAtomTypeName_); |
103 |
+ |
} |
104 |
+ |
|
105 |
|
return torsionTypeCont_.find(keys, wildCardAtomTypeName_); |
106 |
|
|
107 |
|
} |