--- branches/development/src/parallel/ForceDecomposition.cpp 2011/06/08 16:05:07 1576 +++ branches/development/src/parallel/ForceDecomposition.cpp 2011/06/21 06:34:35 1586 @@ -47,7 +47,7 @@ namespace OpenMD { using namespace std; namespace OpenMD { - ForceDecomposition::ForceDecomposition(SimInfo* info) : info_(info) { + ForceDecomposition::ForceDecomposition(SimInfo* info, InteractionManager* iMan) : info_(info), interactionMan_(iMan) { sman_ = info_->getSnapshotManager(); storageLayout_ = sman_->getStorageLayout(); ff_ = info_->getForceField(); @@ -87,9 +87,11 @@ namespace OpenMD { cellOffsets_.push_back( Vector3i(1, -1,1) ); } - SelfData ForceDecomposition::fillSelfData(int atom1) { - SelfData sdat; - // Still Missing atype, skippedCharge, potVec pot, + void ForceDecomposition::fillSelfData(SelfData &sdat, int atom1) { + + sdat.atype = ff_->getAtomType(idents[atom1]); + + // Still Missing skippedCharge if (storageLayout_ & DataStorage::dslElectroFrame) { sdat.eFrame = &(snap_->atomData.electroFrame[atom1]); } @@ -110,11 +112,13 @@ namespace OpenMD { sdat.dfrhodrho = &(snap_->atomData.functionalDerivative[atom1]); } + if (storageLayout_ & DataStorage::dslSkippedCharge) { + sdat.skippedCharge = &(snap_->atomData.skippedCharge[atom1]); + } + if (storageLayout_ & DataStorage::dslParticlePot) { sdat.particlePot = &(snap_->atomData.particlePot[atom1]); } - - return sdat; } bool ForceDecomposition::checkNeighborList() { @@ -124,7 +128,10 @@ namespace OpenMD { // if we have changed the group identities or haven't set up the // saved positions we automatically will need a neighbor list update: - if ( saved_CG_positions_.size() != nGroups ) return true; + if ( saved_CG_positions_.size() != nGroups ) { + cerr << "build because size\n"; + return true; + } RealType dispmax = 0.0; Vector3d disp; @@ -142,6 +149,13 @@ namespace OpenMD { // a conservative test of list skin crossings dispmax = 2.0 * sqrt (3.0 * dispmax * dispmax); - return (dispmax > skinThickness_); + + if (dispmax > skinThickness_) { + cerr << "build because movement\n"; + return (dispmax > skinThickness_); + } else { + cerr << "not rebuilding\n"; + } + return false; } }