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 |
+ |
|
134 |
|
map<string, CutoffMethod> stringToCutoffMethod; |
135 |
|
stringToCutoffMethod["HARD"] = HARD; |
136 |
|
stringToCutoffMethod["SWITCHED"] = SWITCHED; |
523 |
|
InteractionData idat; |
524 |
|
SelfData sdat; |
525 |
|
RealType mf; |
521 |
– |
potVec pot(0.0); |
522 |
– |
potVec longRangePotential(0.0); |
526 |
|
RealType lrPot; |
527 |
|
RealType vpair; |
528 |
+ |
potVec longRangePotential(0.0); |
529 |
+ |
potVec workPot(0.0); |
530 |
|
|
531 |
|
int loopStart, loopEnd; |
532 |
|
|
533 |
|
idat.vdwMult = &vdwMult; |
534 |
|
idat.electroMult = &electroMult; |
535 |
< |
idat.pot = &pot; |
535 |
> |
idat.pot = &workPot; |
536 |
> |
sdat.pot = fDecomp_->getEmbeddingPotential(); |
537 |
|
idat.vpair = &vpair; |
538 |
|
idat.f1 = &f1; |
539 |
|
idat.sw = &sw; |
540 |
< |
|
540 |
> |
idat.shiftedPot = (cutoffMethod_ == SHIFTED_POTENTIAL) ? true : false; |
541 |
> |
idat.shiftedForce = (cutoffMethod_ == SHIFTED_FORCE) ? true : false; |
542 |
> |
|
543 |
|
loopEnd = PAIR_LOOP; |
544 |
|
if (info_->requiresPrepair() ) { |
545 |
|
loopStart = PREPAIR_LOOP; |
546 |
|
} else { |
547 |
|
loopStart = PAIR_LOOP; |
548 |
|
} |
549 |
< |
|
549 |
> |
|
550 |
|
for (int iLoop = loopStart; iLoop <= loopEnd; iLoop++) { |
551 |
|
|
552 |
|
if (iLoop == loopStart) { |
589 |
|
for (vector<int>::iterator jb = atomListColumn.begin(); |
590 |
|
jb != atomListColumn.end(); ++jb) { |
591 |
|
atom2 = (*jb); |
592 |
< |
|
592 |
> |
|
593 |
|
if (!fDecomp_->skipAtomPair(atom1, atom2)) { |
586 |
– |
|
594 |
|
vpair = 0.0; |
595 |
+ |
workPot = 0.0; |
596 |
|
f1 = V3Zero; |
597 |
|
|
598 |
|
fDecomp_->fillInteractionData(idat, atom1, atom2); |
691 |
|
fDecomp_->fillSelfData(sdat, atom1); |
692 |
|
interactionMan_->doPreForce(sdat); |
693 |
|
} |
694 |
< |
|
694 |
> |
|
695 |
> |
|
696 |
|
fDecomp_->distributeIntermediateData(); |
697 |
|
} |
698 |
|
} |
713 |
|
atom2 = (*jb); |
714 |
|
fDecomp_->fillSkipData(idat, atom1, atom2); |
715 |
|
interactionMan_->doSkipCorrection(idat); |
716 |
+ |
fDecomp_->unpackSkipData(idat, atom1, atom2); |
717 |
|
|
718 |
|
} |
719 |
|
} |
728 |
|
|
729 |
|
} |
730 |
|
|
731 |
< |
longRangePotential = fDecomp_->getLongRangePotential(); |
731 |
> |
longRangePotential = *(fDecomp_->getEmbeddingPotential()) + |
732 |
> |
*(fDecomp_->getPairwisePotential()); |
733 |
> |
|
734 |
|
lrPot = longRangePotential.sum(); |
735 |
|
|
736 |
|
//store the tau and long range potential |