| 57 |
|
ForceField::NonBondedInteractionTypeContainer* nbiTypes = forceField_->getNonBondedInteractionTypes(); |
| 58 |
|
ForceField::NonBondedInteractionTypeContainer::MapTypeIterator j; |
| 59 |
|
NonBondedInteractionType* nbt; |
| 60 |
+ |
ForceField::NonBondedInteractionTypeContainer::KeyType keys; |
| 61 |
|
|
| 62 |
|
for (nbt = nbiTypes->beginType(j); nbt != NULL; |
| 63 |
|
nbt = nbiTypes->nextType(j)) { |
| 64 |
|
|
| 65 |
|
if (nbt->isMAW()) { |
| 66 |
< |
pair<AtomType*, AtomType*> atypes = nbt->getAtomTypes(); |
| 67 |
< |
|
| 68 |
< |
GenericData* data = nbt->getPropertyByName("MAW"); |
| 69 |
< |
if (data == NULL) { |
| 70 |
< |
sprintf( painCave.errMsg, "MAW::initialize could not find\n" |
| 71 |
< |
"\tMAW parameters for %s - %s interaction.\n", |
| 72 |
< |
atypes.first->getName().c_str(), |
| 72 |
< |
atypes.second->getName().c_str()); |
| 73 |
< |
painCave.severity = OPENMD_ERROR; |
| 74 |
< |
painCave.isFatal = 1; |
| 75 |
< |
simError(); |
| 76 |
< |
} |
| 77 |
< |
|
| 78 |
< |
MAWData* mawData = dynamic_cast<MAWData*>(data); |
| 79 |
< |
if (mawData == NULL) { |
| 66 |
> |
keys = nbiTypes->getKeys(j); |
| 67 |
> |
AtomType* at1 = forceField_->getAtomType(keys[0]); |
| 68 |
> |
AtomType* at2 = forceField_->getAtomType(keys[1]); |
| 69 |
> |
|
| 70 |
> |
MAWInteractionType* mit = dynamic_cast<MAWInteractionType*>(nbt); |
| 71 |
> |
|
| 72 |
> |
if (mit == NULL) { |
| 73 |
|
sprintf( painCave.errMsg, |
| 74 |
< |
"MAW::initialize could not convert GenericData to\n" |
| 75 |
< |
"\tMAWData for %s - %s interaction.\n", |
| 76 |
< |
atypes.first->getName().c_str(), |
| 77 |
< |
atypes.second->getName().c_str()); |
| 74 |
> |
"MAW::initialize could not convert NonBondedInteractionType\n" |
| 75 |
> |
"\tto MAWInteractionType for %s - %s interaction.\n", |
| 76 |
> |
at1->getName().c_str(), |
| 77 |
> |
at2->getName().c_str()); |
| 78 |
|
painCave.severity = OPENMD_ERROR; |
| 79 |
|
painCave.isFatal = 1; |
| 80 |
|
simError(); |
| 81 |
|
} |
| 82 |
|
|
| 83 |
< |
MAWParam mawParam = mawData->getData(); |
| 84 |
< |
|
| 85 |
< |
RealType De = mawParam.De; |
| 86 |
< |
RealType beta = mawParam.beta; |
| 87 |
< |
RealType Re = mawParam.Re; |
| 95 |
< |
RealType ca1 = mawParam.ca1; |
| 96 |
< |
RealType cb1 = mawParam.cb1; |
| 83 |
> |
RealType De = mit->getD(); |
| 84 |
> |
RealType beta = mit->getBeta(); |
| 85 |
> |
RealType Re = mit->getR(); |
| 86 |
> |
RealType ca1 = mit->getCA1(); |
| 87 |
> |
RealType cb1 = mit->getCB1(); |
| 88 |
|
|
| 89 |
< |
addExplicitInteraction(atypes.first, atypes.second, |
| 89 |
> |
addExplicitInteraction(at1, at2, |
| 90 |
|
De, beta, Re, ca1, cb1); |
| 91 |
|
} |
| 92 |
|
} |