| 35 |
|
* |
| 36 |
|
* [1] Meineke, et al., J. Comp. Chem. 26, 252-271 (2005). |
| 37 |
|
* [2] Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006). |
| 38 |
< |
* [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008). |
| 39 |
< |
* [4] Vardeman & Gezelter, in progress (2009). |
| 38 |
> |
* [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 234107 (2008). |
| 39 |
> |
* [4] Kuang & Gezelter, J. Chem. Phys. 133, 164101 (2010). |
| 40 |
> |
* [5] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). |
| 41 |
|
*/ |
| 42 |
|
|
| 43 |
|
#include <stdio.h> |
| 58 |
|
ForceField::NonBondedInteractionTypeContainer* nbiTypes = forceField_->getNonBondedInteractionTypes(); |
| 59 |
|
ForceField::NonBondedInteractionTypeContainer::MapTypeIterator j; |
| 60 |
|
NonBondedInteractionType* nbt; |
| 61 |
+ |
ForceField::NonBondedInteractionTypeContainer::KeyType keys; |
| 62 |
|
|
| 63 |
|
for (nbt = nbiTypes->beginType(j); nbt != NULL; |
| 64 |
|
nbt = nbiTypes->nextType(j)) { |
| 65 |
|
|
| 66 |
|
if (nbt->isMAW()) { |
| 67 |
< |
pair<AtomType*, AtomType*> atypes = nbt->getAtomTypes(); |
| 68 |
< |
|
| 69 |
< |
GenericData* data = nbt->getPropertyByName("MAW"); |
| 70 |
< |
if (data == NULL) { |
| 71 |
< |
sprintf( painCave.errMsg, "MAW::initialize could not find\n" |
| 72 |
< |
"\tMAW parameters for %s - %s interaction.\n", |
| 73 |
< |
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) { |
| 67 |
> |
keys = nbiTypes->getKeys(j); |
| 68 |
> |
AtomType* at1 = forceField_->getAtomType(keys[0]); |
| 69 |
> |
AtomType* at2 = forceField_->getAtomType(keys[1]); |
| 70 |
> |
|
| 71 |
> |
MAWInteractionType* mit = dynamic_cast<MAWInteractionType*>(nbt); |
| 72 |
> |
|
| 73 |
> |
if (mit == NULL) { |
| 74 |
|
sprintf( painCave.errMsg, |
| 75 |
< |
"MAW::initialize could not convert GenericData to\n" |
| 76 |
< |
"\tMAWData for %s - %s interaction.\n", |
| 77 |
< |
atypes.first->getName().c_str(), |
| 78 |
< |
atypes.second->getName().c_str()); |
| 75 |
> |
"MAW::initialize could not convert NonBondedInteractionType\n" |
| 76 |
> |
"\tto MAWInteractionType for %s - %s interaction.\n", |
| 77 |
> |
at1->getName().c_str(), |
| 78 |
> |
at2->getName().c_str()); |
| 79 |
|
painCave.severity = OPENMD_ERROR; |
| 80 |
|
painCave.isFatal = 1; |
| 81 |
|
simError(); |
| 82 |
|
} |
| 83 |
|
|
| 84 |
< |
MAWParam mawParam = mawData->getData(); |
| 85 |
< |
|
| 86 |
< |
RealType De = mawParam.De; |
| 87 |
< |
RealType beta = mawParam.beta; |
| 88 |
< |
RealType Re = mawParam.Re; |
| 95 |
< |
RealType ca1 = mawParam.ca1; |
| 96 |
< |
RealType cb1 = mawParam.cb1; |
| 84 |
> |
RealType De = mit->getD(); |
| 85 |
> |
RealType beta = mit->getBeta(); |
| 86 |
> |
RealType Re = mit->getR(); |
| 87 |
> |
RealType ca1 = mit->getCA1(); |
| 88 |
> |
RealType cb1 = mit->getCB1(); |
| 89 |
|
|
| 90 |
< |
addExplicitInteraction(atypes.first, atypes.second, |
| 90 |
> |
addExplicitInteraction(at1, at2, |
| 91 |
|
De, beta, Re, ca1, cb1); |
| 92 |
|
} |
| 93 |
|
} |
| 174 |
|
myDerivC = 0.0; |
| 175 |
|
} else if (idat.shiftedForce) { |
| 176 |
|
myPotC = D_e * (expfnc2C - 2.0 * expfncC); |
| 177 |
< |
myDerivC = 2.0 * D_e * beta * (expfnc2C - expfnc2C); |
| 177 |
> |
myDerivC = 2.0 * D_e * beta * (expfncC - expfnc2C); |
| 178 |
|
myPotC += myDerivC * ( *(idat.rij) - *(idat.rcut) ); |
| 179 |
|
} else { |
| 180 |
|
myPotC = 0.0; |
| 185 |
|
RealType y = r.y(); |
| 186 |
|
RealType z = r.z(); |
| 187 |
|
RealType x2 = x * x; |
| 196 |
– |
RealType y2 = y * y; |
| 188 |
|
RealType z2 = z * z; |
| 189 |
|
|
| 190 |
|
RealType r3 = *(idat.r2) * *(idat.rij) ; |