| 110 |
|
Globals* simParams_ = info_->getSimParams(); |
| 111 |
|
ForceFieldOptions& forceFieldOptions_ = forceField_->getForceFieldOptions(); |
| 112 |
|
int mdFileVersion; |
| 113 |
+ |
rCut_ = 0.0; //Needs a value for a later max() call; |
| 114 |
|
|
| 115 |
|
if (simParams_->haveMDfileVersion()) |
| 116 |
|
mdFileVersion = simParams_->getMDfileVersion(); |
| 476 |
|
// Zero out the stress tensor |
| 477 |
|
stressTensor *= 0.0; |
| 478 |
|
// Zero out the heatFlux |
| 479 |
< |
fDecomp_->setHeatFlux( V3Zero ); |
| 479 |
> |
fDecomp_->setHeatFlux( Vector3d(0.0) ); |
| 480 |
|
} |
| 481 |
|
|
| 482 |
|
void ForceManager::shortRangeInteractions() { |
| 645 |
|
RealType mf; |
| 646 |
|
RealType lrPot; |
| 647 |
|
RealType vpair; |
| 648 |
+ |
RealType dVdFQ1(0.0); |
| 649 |
+ |
RealType dVdFQ2(0.0); |
| 650 |
|
potVec longRangePotential(0.0); |
| 651 |
|
potVec workPot(0.0); |
| 652 |
|
vector<int>::iterator ia, jb; |
| 658 |
|
idat.pot = &workPot; |
| 659 |
|
sdat.pot = fDecomp_->getEmbeddingPotential(); |
| 660 |
|
idat.vpair = &vpair; |
| 661 |
+ |
idat.dVdFQ1 = &dVdFQ1; |
| 662 |
+ |
idat.dVdFQ2 = &dVdFQ2; |
| 663 |
|
idat.f1 = &f1; |
| 664 |
|
idat.sw = &sw; |
| 665 |
|
idat.shiftedPot = (cutoffMethod_ == SHIFTED_POTENTIAL) ? true : false; |
| 673 |
|
} else { |
| 674 |
|
loopStart = PAIR_LOOP; |
| 675 |
|
} |
| 671 |
– |
|
| 676 |
|
for (int iLoop = loopStart; iLoop <= loopEnd; iLoop++) { |
| 677 |
|
|
| 678 |
|
if (iLoop == loopStart) { |
| 704 |
|
|
| 705 |
|
in_switching_region = switcher_->getSwitch(rgrpsq, sw, dswdr, |
| 706 |
|
rgrp); |
| 707 |
< |
|
| 707 |
> |
|
| 708 |
|
atomListRow = fDecomp_->getAtomsInGroupRow(cg1); |
| 709 |
|
atomListColumn = fDecomp_->getAtomsInGroupColumn(cg2); |
| 710 |
|
|
| 711 |
|
if (doHeatFlux_) |
| 712 |
|
gvel2 = fDecomp_->getGroupVelocityColumn(cg2); |
| 713 |
< |
|
| 713 |
> |
|
| 714 |
|
for (ia = atomListRow.begin(); |
| 715 |
|
ia != atomListRow.end(); ++ia) { |
| 716 |
|
atom1 = (*ia); |
| 717 |
< |
|
| 717 |
> |
|
| 718 |
|
for (jb = atomListColumn.begin(); |
| 719 |
|
jb != atomListColumn.end(); ++jb) { |
| 720 |
|
atom2 = (*jb); |
| 721 |
|
|
| 722 |
< |
if (!fDecomp_->skipAtomPair(atom1, atom2)) { |
| 722 |
> |
if (!fDecomp_->skipAtomPair(atom1, atom2, cg1, cg2)) { |
| 723 |
> |
|
| 724 |
|
vpair = 0.0; |
| 725 |
|
workPot = 0.0; |
| 726 |
|
f1 = V3Zero; |
| 727 |
+ |
dVdFQ1 = 0.0; |
| 728 |
+ |
dVdFQ2 = 0.0; |
| 729 |
|
|
| 730 |
|
fDecomp_->fillInteractionData(idat, atom1, atom2); |
| 731 |
< |
|
| 731 |
> |
|
| 732 |
|
topoDist = fDecomp_->getTopologicalDistance(atom1, atom2); |
| 733 |
|
vdwMult = vdwScale_[topoDist]; |
| 734 |
|
electroMult = electrostaticScale_[topoDist]; |
| 844 |
|
} |
| 845 |
|
} |
| 846 |
|
|
| 847 |
+ |
// collects pairwise information |
| 848 |
|
fDecomp_->collectData(); |
| 849 |
|
|
| 850 |
|
if (info_->requiresSelfCorrection()) { |
| 851 |
< |
|
| 844 |
< |
for (int atom1 = 0; atom1 < info_->getNAtoms(); atom1++) { |
| 851 |
> |
for (int atom1 = 0; atom1 < info_->getNAtoms(); atom1++) { |
| 852 |
|
fDecomp_->fillSelfData(sdat, atom1); |
| 853 |
|
interactionMan_->doSelfCorrection(sdat); |
| 854 |
|
} |
| 848 |
– |
|
| 855 |
|
} |
| 856 |
|
|
| 857 |
+ |
// collects single-atom information |
| 858 |
+ |
fDecomp_->collectSelfData(); |
| 859 |
+ |
|
| 860 |
|
longRangePotential = *(fDecomp_->getEmbeddingPotential()) + |
| 861 |
|
*(fDecomp_->getPairwisePotential()); |
| 862 |
|
|
| 888 |
|
} |
| 889 |
|
|
| 890 |
|
#ifdef IS_MPI |
| 882 |
– |
|
| 891 |
|
MPI::COMM_WORLD.Allreduce(MPI::IN_PLACE, stressTensor.getArrayPointer(), 9, |
| 892 |
|
MPI::REALTYPE, MPI::SUM); |
| 893 |
|
#endif |