| 90 |
|
|
| 91 |
|
ForceField::AtomTypeContainer* atomTypes = forceField_->getAtomTypes(); |
| 92 |
|
int nTypes = atomTypes->size(); |
| 93 |
+ |
sHash_.resize(nTypes); |
| 94 |
|
iHash_.resize(nTypes); |
| 95 |
|
interactions_.resize(nTypes); |
| 96 |
|
ForceField::AtomTypeContainer::MapTypeIterator i1, i2; |
| 137 |
|
simError(); |
| 138 |
|
} |
| 139 |
|
} |
| 140 |
< |
|
| 140 |
> |
|
| 141 |
> |
if (atype1->isLennardJones()) { |
| 142 |
> |
sHash_[atid1] |= LJ_INTERACTION; |
| 143 |
> |
} |
| 144 |
> |
if (atype1->isElectrostatic()) { |
| 145 |
> |
sHash_[atid1] |= ELECTROSTATIC_INTERACTION; |
| 146 |
> |
} |
| 147 |
> |
if (atype1->isSticky()) { |
| 148 |
> |
sHash_[atid1] |= STICKY_INTERACTION; |
| 149 |
> |
} |
| 150 |
> |
if (atype1->isStickyPower()) { |
| 151 |
> |
sHash_[atid1] |= STICKY_INTERACTION; |
| 152 |
> |
} |
| 153 |
> |
if (atype1->isEAM()) { |
| 154 |
> |
sHash_[atid1] |= EAM_INTERACTION; |
| 155 |
> |
} |
| 156 |
> |
if (atype1->isSC()) { |
| 157 |
> |
sHash_[atid1] |= SC_INTERACTION; |
| 158 |
> |
} |
| 159 |
> |
if (atype1->isGayBerne()) { |
| 160 |
> |
sHash_[atid1] |= GB_INTERACTION; |
| 161 |
> |
} |
| 162 |
> |
|
| 163 |
|
// Now, iterate over all known types and add to the interaction map: |
| 164 |
|
|
| 165 |
|
map<int, AtomType*>::iterator it1, it2; |
| 175 |
|
|
| 176 |
|
if (atype1->isLennardJones() && atype2->isLennardJones()) { |
| 177 |
|
interactions_[atid1][atid2].insert(lj_); |
| 178 |
< |
iHash_[atid1][atid2] |= LJ_PAIR; |
| 178 |
> |
iHash_[atid1][atid2] |= LJ_INTERACTION; |
| 179 |
|
} |
| 180 |
|
if (atype1->isElectrostatic() && atype2->isElectrostatic() ) { |
| 181 |
|
interactions_[atid1][atid2].insert(electrostatic_); |
| 182 |
< |
iHash_[atid1][atid2] |= ELECTROSTATIC_PAIR; |
| 182 |
> |
iHash_[atid1][atid2] |= ELECTROSTATIC_INTERACTION; |
| 183 |
|
} |
| 184 |
|
if (atype1->isSticky() && atype2->isSticky() ) { |
| 185 |
|
interactions_[atid1][atid2].insert(sticky_); |
| 186 |
< |
iHash_[atid1][atid2] |= STICKY_PAIR; |
| 186 |
> |
iHash_[atid1][atid2] |= STICKY_INTERACTION; |
| 187 |
|
} |
| 188 |
|
if (atype1->isStickyPower() && atype2->isStickyPower() ) { |
| 189 |
|
interactions_[atid1][atid2].insert(sticky_); |
| 190 |
< |
iHash_[atid1][atid2] |= STICKY_PAIR; |
| 190 |
> |
iHash_[atid1][atid2] |= STICKY_INTERACTION; |
| 191 |
|
} |
| 192 |
|
if (atype1->isEAM() && atype2->isEAM() ) { |
| 193 |
|
interactions_[atid1][atid2].insert(eam_); |
| 194 |
< |
iHash_[atid1][atid2] |= EAM_PAIR; |
| 194 |
> |
iHash_[atid1][atid2] |= EAM_INTERACTION; |
| 195 |
|
} |
| 196 |
|
if (atype1->isSC() && atype2->isSC() ) { |
| 197 |
|
interactions_[atid1][atid2].insert(sc_); |
| 198 |
< |
iHash_[atid1][atid2] |= SC_PAIR; |
| 198 |
> |
iHash_[atid1][atid2] |= SC_INTERACTION; |
| 199 |
|
} |
| 200 |
|
if (atype1->isGayBerne() && atype2->isGayBerne() ) { |
| 201 |
|
interactions_[atid1][atid2].insert(gb_); |
| 202 |
< |
iHash_[atid1][atid2] |= GB_PAIR; |
| 202 |
> |
iHash_[atid1][atid2] |= GB_INTERACTION; |
| 203 |
|
} |
| 204 |
|
if ((atype1->isGayBerne() && atype2->isLennardJones()) |
| 205 |
|
|| (atype1->isLennardJones() && atype2->isGayBerne())) { |
| 206 |
|
interactions_[atid1][atid2].insert(gb_); |
| 207 |
< |
iHash_[atid1][atid2] |= GB_PAIR; |
| 207 |
> |
iHash_[atid1][atid2] |= GB_INTERACTION; |
| 208 |
|
} |
| 209 |
|
|
| 210 |
|
// look for an explicitly-set non-bonded interaction type using the |
| 230 |
|
} |
| 231 |
|
} |
| 232 |
|
interactions_[atid1][atid2].insert(lj_); |
| 233 |
< |
iHash_[atid1][atid2] |= LJ_PAIR; |
| 233 |
> |
iHash_[atid1][atid2] |= LJ_INTERACTION; |
| 234 |
|
vdwExplicit = true; |
| 235 |
|
} |
| 236 |
|
|
| 257 |
|
} |
| 258 |
|
} |
| 259 |
|
interactions_[atid1][atid2].insert(morse_); |
| 260 |
< |
iHash_[atid1][atid2] |= MORSE_PAIR; |
| 260 |
> |
iHash_[atid1][atid2] |= MORSE_INTERACTION; |
| 261 |
|
vdwExplicit = true; |
| 262 |
|
} |
| 263 |
|
|
| 284 |
|
} |
| 285 |
|
} |
| 286 |
|
interactions_[atid1][atid2].insert(repulsivePower_); |
| 287 |
< |
iHash_[atid1][atid2] |= REPULSIVEPOWER_PAIR; |
| 287 |
> |
iHash_[atid1][atid2] |= REPULSIVEPOWER_INTERACTION; |
| 288 |
|
vdwExplicit = true; |
| 289 |
|
} |
| 290 |
|
|
| 302 |
|
} |
| 303 |
|
} |
| 304 |
|
interactions_[atid1][atid2].insert(eam_); |
| 305 |
< |
iHash_[atid1][atid2] |= EAM_PAIR; |
| 305 |
> |
iHash_[atid1][atid2] |= EAM_INTERACTION; |
| 306 |
|
metExplicit = true; |
| 307 |
|
} |
| 308 |
|
|
| 329 |
|
} |
| 330 |
|
} |
| 331 |
|
interactions_[atid1][atid2].insert(sc_); |
| 332 |
< |
iHash_[atid1][atid2] |= SC_PAIR; |
| 332 |
> |
iHash_[atid1][atid2] |= SC_INTERACTION; |
| 333 |
|
metExplicit = true; |
| 334 |
|
} |
| 335 |
|
|
| 356 |
|
} |
| 357 |
|
} |
| 358 |
|
interactions_[atid1][atid2].insert(maw_); |
| 359 |
< |
iHash_[atid1][atid2] |= MAW_PAIR; |
| 359 |
> |
iHash_[atid1][atid2] |= MAW_INTERACTION; |
| 360 |
|
vdwExplicit = true; |
| 361 |
|
} |
| 362 |
|
} |
| 408 |
|
|
| 409 |
|
int& iHash = iHash_[idat.atid1][idat.atid2]; |
| 410 |
|
|
| 411 |
< |
if ((iHash & EAM_PAIR) != 0) eam_->calcDensity(idat); |
| 412 |
< |
if ((iHash & SC_PAIR) != 0) sc_->calcDensity(idat); |
| 411 |
> |
if ((iHash & EAM_INTERACTION) != 0) eam_->calcDensity(idat); |
| 412 |
> |
if ((iHash & SC_INTERACTION) != 0) sc_->calcDensity(idat); |
| 413 |
|
|
| 414 |
|
// set<NonBondedInteraction*>::iterator it; |
| 415 |
|
|
| 427 |
|
|
| 428 |
|
if (!initialized_) initialize(); |
| 429 |
|
|
| 430 |
< |
int& iHash = iHash_[sdat.atid][sdat.atid]; |
| 430 |
> |
int& sHash = sHash_[sdat.atid]; |
| 431 |
|
|
| 432 |
< |
if ((iHash & EAM_PAIR) != 0) eam_->calcFunctional(sdat); |
| 433 |
< |
if ((iHash & SC_PAIR) != 0) sc_->calcFunctional(sdat); |
| 432 |
> |
if ((sHash & EAM_INTERACTION) != 0) eam_->calcFunctional(sdat); |
| 433 |
> |
if ((sHash & SC_INTERACTION) != 0) sc_->calcFunctional(sdat); |
| 434 |
|
|
| 435 |
|
// set<NonBondedInteraction*>::iterator it; |
| 436 |
|
|
| 449 |
|
|
| 450 |
|
int& iHash = iHash_[idat.atid1][idat.atid2]; |
| 451 |
|
|
| 452 |
< |
if ((iHash & ELECTROSTATIC_PAIR) != 0) electrostatic_->calcForce(idat); |
| 452 |
> |
if ((iHash & ELECTROSTATIC_INTERACTION) != 0) electrostatic_->calcForce(idat); |
| 453 |
|
|
| 454 |
|
// electrostatics still has to worry about indirect |
| 455 |
|
// contributions from excluded pairs of atoms, but nothing else does: |
| 456 |
|
|
| 457 |
|
if (idat.excluded) return; |
| 458 |
|
|
| 459 |
< |
if ((iHash & LJ_PAIR) != 0) lj_->calcForce(idat); |
| 460 |
< |
if ((iHash & GB_PAIR) != 0) gb_->calcForce(idat); |
| 461 |
< |
if ((iHash & STICKY_PAIR) != 0) sticky_->calcForce(idat); |
| 462 |
< |
if ((iHash & MORSE_PAIR) != 0) morse_->calcForce(idat); |
| 463 |
< |
if ((iHash & REPULSIVEPOWER_PAIR) != 0) repulsivePower_->calcForce(idat); |
| 464 |
< |
if ((iHash & EAM_PAIR) != 0) eam_->calcForce(idat); |
| 465 |
< |
if ((iHash & SC_PAIR) != 0) sc_->calcForce(idat); |
| 466 |
< |
if ((iHash & MAW_PAIR) != 0) maw_->calcForce(idat); |
| 459 |
> |
if ((iHash & LJ_INTERACTION) != 0) lj_->calcForce(idat); |
| 460 |
> |
if ((iHash & GB_INTERACTION) != 0) gb_->calcForce(idat); |
| 461 |
> |
if ((iHash & STICKY_INTERACTION) != 0) sticky_->calcForce(idat); |
| 462 |
> |
if ((iHash & MORSE_INTERACTION) != 0) morse_->calcForce(idat); |
| 463 |
> |
if ((iHash & REPULSIVEPOWER_INTERACTION) != 0) repulsivePower_->calcForce(idat); |
| 464 |
> |
if ((iHash & EAM_INTERACTION) != 0) eam_->calcForce(idat); |
| 465 |
> |
if ((iHash & SC_INTERACTION) != 0) sc_->calcForce(idat); |
| 466 |
> |
if ((iHash & MAW_INTERACTION) != 0) maw_->calcForce(idat); |
| 467 |
|
|
| 468 |
|
// set<NonBondedInteraction*>::iterator it; |
| 469 |
|
|
| 485 |
|
|
| 486 |
|
if (!initialized_) initialize(); |
| 487 |
|
|
| 488 |
< |
int& iHash = iHash_[sdat.atid][sdat.atid]; |
| 488 |
> |
int& sHash = sHash_[sdat.atid]; |
| 489 |
|
|
| 490 |
< |
if ((iHash & ELECTROSTATIC_PAIR) != 0) electrostatic_->calcSelfCorrection(sdat); |
| 490 |
> |
if ((sHash & ELECTROSTATIC_INTERACTION) != 0) electrostatic_->calcSelfCorrection(sdat); |
| 491 |
|
|
| 492 |
|
// set<NonBondedInteraction*>::iterator it; |
| 493 |
|
|