| 139 |
|
void Morse::calcForce(InteractionData &idat) { |
| 140 |
|
|
| 141 |
|
if (!initialized_) initialize(); |
| 142 |
< |
|
| 142 |
> |
|
| 143 |
> |
//cerr << "In Morse::calcForce\n"; |
| 144 |
> |
|
| 145 |
|
MorseInteractionData &mixer = MixingMap[Mtids[idat.atid1]][Mtids[idat.atid2]]; |
| 146 |
|
|
| 147 |
|
RealType myPot = 0.0; |
| 173 |
|
|
| 174 |
|
switch(variant) { |
| 175 |
|
case mtShifted : { |
| 176 |
< |
|
| 176 |
> |
//cerr << "Morse Type Shifted\n"; |
| 177 |
|
myPot = De * (expfnc2 - 2.0 * expfnc); |
| 178 |
|
myDeriv = 2.0 * De * beta * (expfnc - expfnc2); |
| 179 |
|
|
| 192 |
|
break; |
| 193 |
|
} |
| 194 |
|
case mtRepulsive : { |
| 195 |
< |
|
| 195 |
> |
//cerr << "Morse Type Repulsive\n"; |
| 196 |
|
myPot = De * expfnc2; |
| 197 |
|
myDeriv = -2.0 * De * beta * expfnc2; |
| 198 |
|
|
| 199 |
|
if (idat.shiftedPot) { |
| 200 |
+ |
//cerr << "shifted potentional\n"; |
| 201 |
|
myPotC = De * expfnc2C; |
| 202 |
|
myDerivC = 0.0; |
| 203 |
|
} else if (idat.shiftedForce) { |
| 204 |
+ |
//cerr << "shifted force\n"; |
| 205 |
|
myPotC = De * expfnc2C; |
| 206 |
+ |
//cerr << "myPotC initial: " << myPotC << "\n"; |
| 207 |
|
myDerivC = -2.0 * De * beta * expfnc2C; |
| 208 |
|
myPotC += myDerivC * ( *(idat.rij) - *(idat.rcut)); |
| 209 |
|
} else { |
| 210 |
+ |
//cerr << "nothing\n"; |
| 211 |
|
myPotC = 0.0; |
| 212 |
|
myDerivC = 0.0; |
| 213 |
|
} |
| 215 |
|
break; |
| 216 |
|
} |
| 217 |
|
case mtUnknown: { |
| 218 |
+ |
//cerr << "Morse Type Unknown\n"; |
| 219 |
|
// don't know what to do so don't do anything |
| 220 |
|
break; |
| 221 |
|
} |
| 229 |
|
|
| 230 |
|
|
| 231 |
|
(*(idat.pot))[VANDERWAALS_FAMILY] += *(idat.sw) * pot_temp; |
| 232 |
+ |
//cerr << "Before force assigned: " << *(idat.f1) << "\n"; |
| 233 |
|
*(idat.f1) = *(idat.d) * dudr / *(idat.rij); |
| 234 |
< |
|
| 234 |
> |
|
| 235 |
> |
/* |
| 236 |
> |
cerr << "myPot: " << myPot << "\n"; |
| 237 |
> |
cerr << "myDeriv: " << myDeriv << "\n"; |
| 238 |
> |
cerr << "myPotC: " << myPotC << "\n"; |
| 239 |
> |
cerr << "myDerivC: " << myDerivC << "\n"; |
| 240 |
> |
cerr << "idat.rij: " << *(idat.rij) << "\n"; |
| 241 |
> |
cerr << "idat.d: " << *(idat.d) << "\n"; |
| 242 |
> |
cerr << "dudr: " << dudr << "\n"; |
| 243 |
> |
cerr << "After force: " << *(idat.f1) << "\n\n"; |
| 244 |
> |
*/ |
| 245 |
|
return; |
| 246 |
|
} |
| 247 |
|
|