66 |
|
} |
67 |
|
} |
68 |
|
|
69 |
+ |
/** |
70 |
+ |
* getAtomType by string |
71 |
+ |
* |
72 |
+ |
* finds the requested atom type in this force field using the string |
73 |
+ |
* name of the atom type. |
74 |
+ |
*/ |
75 |
|
AtomType* ForceField::getAtomType(const std::string &at) { |
76 |
|
std::vector<std::string> keys; |
77 |
|
keys.push_back(at); |
78 |
|
return atomTypeCont_.find(keys); |
79 |
|
} |
80 |
|
|
81 |
+ |
/** |
82 |
+ |
* getAtomType by ident |
83 |
+ |
* |
84 |
+ |
* finds the requested atom type in this force field using the |
85 |
+ |
* integer ident instead of the string name of the atom type. |
86 |
+ |
*/ |
87 |
+ |
AtomType* ForceField::getAtomType(int ident) { |
88 |
+ |
std::string at = atypeIdentToName.find(ident)->second; |
89 |
+ |
return getAtomType(at); |
90 |
+ |
} |
91 |
+ |
|
92 |
|
BondType* ForceField::getBondType(const std::string &at1, |
93 |
|
const std::string &at2) { |
94 |
|
std::vector<std::string> keys; |
451 |
|
std::vector<std::string> keys; |
452 |
|
keys.push_back(at1); |
453 |
|
keys.push_back(at2); |
454 |
< |
|
454 |
> |
|
455 |
|
//try exact match first |
456 |
|
NonBondedInteractionType* nbiType = nonBondedInteractionTypeCont_.find(keys); |
457 |
|
if (nbiType) { |
458 |
|
return nbiType; |
459 |
|
} else { |
460 |
|
//if no exact match found, try wild card match |
461 |
< |
return nonBondedInteractionTypeCont_.find(keys, wildCardAtomTypeName_); |
461 |
> |
return nonBondedInteractionTypeCont_.find(keys, wildCardAtomTypeName_); |
462 |
|
} |
463 |
|
} |
464 |
|
|
515 |
|
bool ForceField::addAtomType(const std::string &at, AtomType* atomType) { |
516 |
|
std::vector<std::string> keys; |
517 |
|
keys.push_back(at); |
518 |
+ |
atypeIdentToName[atomType->getIdent()] = at; |
519 |
|
return atomTypeCont_.add(keys, atomType); |
520 |
|
} |
521 |
|
|
522 |
|
bool ForceField::replaceAtomType(const std::string &at, AtomType* atomType) { |
523 |
|
std::vector<std::string> keys; |
524 |
|
keys.push_back(at); |
525 |
+ |
atypeIdentToName[atomType->getIdent()] = at; |
526 |
|
return atomTypeCont_.replace(keys, atomType); |
527 |
|
} |
528 |
|
|