--- trunk/src/brains/ForceManager.cpp 2014/02/26 14:14:50 1969 +++ trunk/src/brains/ForceManager.cpp 2014/04/29 17:32:31 1993 @@ -417,6 +417,7 @@ namespace OpenMD { if (doHeatFlux_) doParticlePot_ = true; doElectricField_ = info_->getSimParams()->getOutputElectricField(); + doSitePotential_ = info_->getSimParams()->getOutputSitePotential(); } @@ -646,14 +647,6 @@ namespace OpenMD { MPI_REALTYPE, MPI_SUM, MPI_COMM_WORLD); MPI_Allreduce(MPI_IN_PLACE, &inversionPotential, 1, MPI_REALTYPE, MPI_SUM, MPI_COMM_WORLD); - // MPI::COMM_WORLD.Allreduce(MPI::IN_PLACE, &bondPotential, 1, MPI::REALTYPE, - // MPI::SUM); - // MPI::COMM_WORLD.Allreduce(MPI::IN_PLACE, &bendPotential, 1, MPI::REALTYPE, - // MPI::SUM); - // MPI::COMM_WORLD.Allreduce(MPI::IN_PLACE, &torsionPotential, 1, - // MPI::REALTYPE, MPI::SUM); - // MPI::COMM_WORLD.Allreduce(MPI::IN_PLACE, &inversionPotential, 1, - // MPI::REALTYPE, MPI::SUM); #endif Snapshot* curSnapshot = info_->getSnapshotManager()->getCurrentSnapshot(); @@ -724,6 +717,9 @@ namespace OpenMD { potVec exPot(0.0); Vector3d eField1(0.0); Vector3d eField2(0.0); + RealType sPot1(0.0); + RealType sPot2(0.0); + vector::iterator ia, jb; int loopStart, loopEnd; @@ -739,13 +735,16 @@ namespace OpenMD { idat.dVdFQ1 = &dVdFQ1; idat.dVdFQ2 = &dVdFQ2; idat.eField1 = &eField1; - idat.eField2 = &eField2; + idat.eField2 = &eField2; + idat.sPot1 = &sPot1; + idat.sPot2 = &sPot2; idat.f1 = &f1; idat.sw = &sw; idat.shiftedPot = (cutoffMethod_ == SHIFTED_POTENTIAL) ? true : false; idat.shiftedForce = (cutoffMethod_ == SHIFTED_FORCE || cutoffMethod_ == TAYLOR_SHIFTED) ? true : false; idat.doParticlePot = doParticlePot_; idat.doElectricField = doElectricField_; + idat.doSitePotential = doSitePotential_; sdat.doParticlePot = doParticlePot_; loopEnd = PAIR_LOOP; @@ -785,6 +784,8 @@ namespace OpenMD { fij.zero(); eField1.zero(); eField2.zero(); + sPot1 = 0.0; + sPot2 = 0.0; } in_switching_region = switcher_->getSwitch(rgrpsq, sw, dswdr, @@ -987,9 +988,7 @@ namespace OpenMD { #ifdef IS_MPI MPI_Allreduce(MPI_IN_PLACE, stressTensor.getArrayPointer(), 9, - MPI_REALTYPE, MPI_SUM, MPI_COMM_WORLD); - // MPI::COMM_WORLD.Allreduce(MPI::IN_PLACE, stressTensor.getArrayPointer(), 9, - // MPI::REALTYPE, MPI::SUM); + MPI_REALTYPE, MPI_SUM, MPI_COMM_WORLD); #endif curSnapshot->setStressTensor(stressTensor);