| 50 |
|
|
| 51 |
|
namespace OpenMD { |
| 52 |
|
|
| 53 |
< |
MAW::MAW() : name_("MAW"), initialized_(false), forceField_(NULL), |
| 54 |
< |
shiftedPot_(false), shiftedFrc_(false) {} |
| 53 |
> |
MAW::MAW() : name_("MAW"), initialized_(false), forceField_(NULL) {} |
| 54 |
|
|
| 55 |
|
void MAW::initialize() { |
| 56 |
|
|
| 128 |
|
if (!initialized_) initialize(); |
| 129 |
|
|
| 130 |
|
map<pair<AtomType*, AtomType*>, MAWInteractionData>::iterator it; |
| 131 |
< |
it = MixingMap.find( *(idat.atypes) ); |
| 131 |
> |
it = MixingMap.find( idat.atypes ); |
| 132 |
|
if (it != MixingMap.end()) { |
| 133 |
|
MAWInteractionData mixer = (*it).second; |
| 134 |
|
|
| 143 |
|
RealType ca1 = mixer.ca1; |
| 144 |
|
RealType cb1 = mixer.cb1; |
| 145 |
|
|
| 146 |
< |
bool j_is_Metal = idat.atypes->second->isMetal(); |
| 146 |
> |
bool j_is_Metal = idat.atypes.second->isMetal(); |
| 147 |
|
|
| 148 |
|
Vector3d r; |
| 149 |
|
RotMat3x3d Atrans; |
| 171 |
|
myPot = D_e * (expfnc2 - 2.0 * expfnc); |
| 172 |
|
myDeriv = 2.0 * D_e * beta * (expfnc - expfnc2); |
| 173 |
|
|
| 174 |
< |
if (MAW::shiftedPot_ || MAW::shiftedFrc_) { |
| 174 |
> |
if (idat.shiftedPot || idat.shiftedForce) { |
| 175 |
|
exptC = -beta*( *(idat.rcut) - R_e); |
| 176 |
|
expfncC = exp(exptC); |
| 177 |
|
expfnc2C = expfncC*expfncC; |
| 178 |
|
} |
| 179 |
|
|
| 180 |
< |
if (MAW::shiftedPot_) { |
| 180 |
> |
if (idat.shiftedPot) { |
| 181 |
|
myPotC = D_e * (expfnc2C - 2.0 * expfncC); |
| 182 |
|
myDerivC = 0.0; |
| 183 |
< |
} else if (MAW::shiftedFrc_) { |
| 183 |
> |
} else if (idat.shiftedForce) { |
| 184 |
|
myPotC = D_e * (expfnc2C - 2.0 * expfncC); |
| 185 |
|
myDerivC = 2.0 * D_e * beta * (expfnc2C - expfnc2C); |
| 186 |
|
myPotC += myDerivC * ( *(idat.rij) - *(idat.rcut) ); |
| 220 |
|
|
| 221 |
|
RealType pot_temp = *(idat.vdwMult) * Vmorse * Vang; |
| 222 |
|
*(idat.vpair) += pot_temp; |
| 223 |
< |
idat.pot[VANDERWAALS_FAMILY] += *(idat.sw) * pot_temp; |
| 223 |
> |
(*(idat.pot))[VANDERWAALS_FAMILY] += *(idat.sw) * pot_temp; |
| 224 |
|
|
| 225 |
|
Vector3d dVmorsedr = (myDeriv - myDerivC) * Vector3d(x, y, z) / *(idat.rij) ; |
| 226 |
|
|