ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/branches/new_design/OOPSE-4/src/UseTheForce/ForceField.cpp
(Generate patch)

Comparing branches/new_design/OOPSE-4/src/UseTheForce/ForceField.cpp (file contents):
Revision 1846 by tim, Wed Dec 1 02:24:57 2004 UTC vs.
Revision 1847 by tim, Sat Dec 4 05:24:07 2004 UTC

# Line 57 | Line 57 | BondType* ForceField::getBondType(const std::string &a
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,
# Line 67 | Line 75 | BendType* ForceField::getBendType(const std::string &a
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,
# Line 77 | Line 93 | TorsionType* ForceField::getTorsionType(const std::str
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   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines