--- branches/development/src/parallel/ForceDecomposition.cpp 2012/06/14 01:58:35 1755 +++ trunk/src/parallel/ForceDecomposition.cpp 2014/02/26 14:14:50 1969 @@ -35,16 +35,18 @@ * * [1] Meineke, et al., J. Comp. Chem. 26, 252-271 (2005). * [2] Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006). - * [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008). + * [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 234107 (2008). * [4] Kuang & Gezelter, J. Chem. Phys. 133, 164101 (2010). * [5] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). */ -#include "parallel/ForceDecomposition.hpp" -#include "math/Vector3.hpp" + #ifdef IS_MPI #include #endif +#include "parallel/ForceDecomposition.hpp" +#include "math/Vector3.hpp" + using namespace std; namespace OpenMD { @@ -55,6 +57,8 @@ namespace OpenMD { ff_ = info_->getForceField(); userChoseCutoff_ = false; + usePeriodicBoundaryConditions_ = info->getSimParams()->getUsePeriodicBoundaryConditions(); + Globals* simParams_ = info_->getSimParams(); if (simParams_->havePrintHeatFlux()) { if (simParams_->getPrintHeatFlux()) { @@ -96,14 +100,20 @@ namespace OpenMD { void ForceDecomposition::fillSelfData(SelfData &sdat, int atom1) { - sdat.atype = atypesLocal[atom1]; + //sdat.atype = atypesLocal[atom1]; + sdat.atid = idents[atom1]; sdat.pot = &embeddingPot; + sdat.excludedPot = &excludedSelfPot; - if (storageLayout_ & DataStorage::dslElectroFrame) { - sdat.eFrame = &(snap_->atomData.electroFrame[atom1]); + if (storageLayout_ & DataStorage::dslDipole) { + sdat.dipole = &(snap_->atomData.dipole[atom1]); } - + + if (storageLayout_ & DataStorage::dslQuadrupole) { + sdat.quadrupole = &(snap_->atomData.quadrupole[atom1]); + } + if (storageLayout_ & DataStorage::dslTorque) { sdat.t = &(snap_->atomData.torque[atom1]); } @@ -133,7 +143,7 @@ namespace OpenMD { } if (storageLayout_ & DataStorage::dslFlucQForce) { - sdat.dVdFQ = &(snap_->atomData.flucQFrc[atom1]); + sdat.flucQfrc = &(snap_->atomData.flucQFrc[atom1]); } } @@ -158,7 +168,7 @@ namespace OpenMD { } #ifdef IS_MPI - MPI::COMM_WORLD.Allreduce(&dispmax, &dispmax, 1, MPI::REALTYPE, MPI::MAX); + MPI_Allreduce(&dispmax, &dispmax, 1, MPI_REALTYPE, MPI_MAX, MPI_COMM_WORLD); #endif // a conservative test of list skin crossings