| 59 |
|
#include "nonbonded/NonBondedInteraction.hpp" |
| 60 |
|
#include "parallel/ForceMatrixDecomposition.hpp" |
| 61 |
|
|
| 62 |
+ |
#include <cstdio> |
| 63 |
+ |
#include <iostream> |
| 64 |
+ |
#include <iomanip> |
| 65 |
+ |
|
| 66 |
|
using namespace std; |
| 67 |
|
namespace OpenMD { |
| 68 |
|
|
| 127 |
|
painCave.severity = OPENMD_INFO; |
| 128 |
|
simError(); |
| 129 |
|
} |
| 126 |
– |
fDecomp_->setUserCutoff(rCut_); |
| 130 |
|
} |
| 131 |
|
|
| 132 |
+ |
fDecomp_->setUserCutoff(rCut_); |
| 133 |
+ |
interactionMan_->setCutoffRadius(rCut_); |
| 134 |
+ |
|
| 135 |
|
map<string, CutoffMethod> stringToCutoffMethod; |
| 136 |
|
stringToCutoffMethod["HARD"] = HARD; |
| 137 |
|
stringToCutoffMethod["SWITCHED"] = SWITCHED; |
| 264 |
|
} |
| 265 |
|
switcher_->setSwitchType(sft_); |
| 266 |
|
switcher_->setSwitch(rSwitch_, rCut_); |
| 267 |
+ |
interactionMan_->setSwitchingRadius(rSwitch_); |
| 268 |
|
} |
| 269 |
|
|
| 270 |
|
void ForceManager::initialize() { |
| 525 |
|
InteractionData idat; |
| 526 |
|
SelfData sdat; |
| 527 |
|
RealType mf; |
| 521 |
– |
potVec pot(0.0); |
| 522 |
– |
potVec longRangePotential(0.0); |
| 528 |
|
RealType lrPot; |
| 529 |
|
RealType vpair; |
| 530 |
+ |
potVec longRangePotential(0.0); |
| 531 |
+ |
potVec workPot(0.0); |
| 532 |
|
|
| 533 |
|
int loopStart, loopEnd; |
| 534 |
|
|
| 535 |
|
idat.vdwMult = &vdwMult; |
| 536 |
|
idat.electroMult = &electroMult; |
| 537 |
< |
idat.pot = &pot; |
| 537 |
> |
idat.pot = &workPot; |
| 538 |
> |
sdat.pot = fDecomp_->getEmbeddingPotential(); |
| 539 |
|
idat.vpair = &vpair; |
| 540 |
|
idat.f1 = &f1; |
| 541 |
|
idat.sw = &sw; |
| 542 |
< |
|
| 542 |
> |
idat.shiftedPot = (cutoffMethod_ == SHIFTED_POTENTIAL) ? true : false; |
| 543 |
> |
idat.shiftedForce = (cutoffMethod_ == SHIFTED_FORCE) ? true : false; |
| 544 |
> |
|
| 545 |
|
loopEnd = PAIR_LOOP; |
| 546 |
|
if (info_->requiresPrepair() ) { |
| 547 |
|
loopStart = PREPAIR_LOOP; |
| 548 |
|
} else { |
| 549 |
|
loopStart = PAIR_LOOP; |
| 550 |
|
} |
| 551 |
< |
|
| 551 |
> |
|
| 552 |
|
for (int iLoop = loopStart; iLoop <= loopEnd; iLoop++) { |
| 553 |
|
|
| 554 |
|
if (iLoop == loopStart) { |
| 591 |
|
for (vector<int>::iterator jb = atomListColumn.begin(); |
| 592 |
|
jb != atomListColumn.end(); ++jb) { |
| 593 |
|
atom2 = (*jb); |
| 594 |
< |
|
| 594 |
> |
|
| 595 |
|
if (!fDecomp_->skipAtomPair(atom1, atom2)) { |
| 586 |
– |
|
| 596 |
|
vpair = 0.0; |
| 597 |
+ |
workPot = 0.0; |
| 598 |
|
f1 = V3Zero; |
| 599 |
|
|
| 600 |
|
fDecomp_->fillInteractionData(idat, atom1, atom2); |
| 693 |
|
fDecomp_->fillSelfData(sdat, atom1); |
| 694 |
|
interactionMan_->doPreForce(sdat); |
| 695 |
|
} |
| 696 |
< |
|
| 696 |
> |
|
| 697 |
> |
|
| 698 |
|
fDecomp_->distributeIntermediateData(); |
| 699 |
|
} |
| 700 |
|
} |
| 715 |
|
atom2 = (*jb); |
| 716 |
|
fDecomp_->fillSkipData(idat, atom1, atom2); |
| 717 |
|
interactionMan_->doSkipCorrection(idat); |
| 718 |
+ |
fDecomp_->unpackSkipData(idat, atom1, atom2); |
| 719 |
|
|
| 720 |
|
} |
| 721 |
|
} |
| 730 |
|
|
| 731 |
|
} |
| 732 |
|
|
| 733 |
< |
longRangePotential = fDecomp_->getLongRangePotential(); |
| 733 |
> |
longRangePotential = *(fDecomp_->getEmbeddingPotential()) + |
| 734 |
> |
*(fDecomp_->getPairwisePotential()); |
| 735 |
> |
|
| 736 |
|
lrPot = longRangePotential.sum(); |
| 737 |
|
|
| 738 |
|
//store the tau and long range potential |