--- branches/development/src/parallel/ForceDecomposition.cpp 2011/11/22 20:38:56 1665 +++ branches/development/src/parallel/ForceDecomposition.cpp 2012/06/05 18:07:08 1744 @@ -48,14 +48,19 @@ namespace OpenMD { using namespace std; namespace OpenMD { - ForceDecomposition::ForceDecomposition(SimInfo* info, InteractionManager* iMan) : info_(info), interactionMan_(iMan) { + ForceDecomposition::ForceDecomposition(SimInfo* info, InteractionManager* iMan) : info_(info), interactionMan_(iMan), needVelocities_(false) { sman_ = info_->getSnapshotManager(); storageLayout_ = sman_->getStorageLayout(); ff_ = info_->getForceField(); userChoseCutoff_ = false; Globals* simParams_ = info_->getSimParams(); - + if (simParams_->havePrintHeatFlux()) { + if (simParams_->getPrintHeatFlux()) { + needVelocities_ = true; + } + } + if (simParams_->haveSkinThickness()) { skinThickness_ = simParams_->getSkinThickness(); } else { @@ -121,12 +126,22 @@ namespace OpenMD { if (storageLayout_ & DataStorage::dslParticlePot) { sdat.particlePot = &(snap_->atomData.particlePot[atom1]); } + + if (storageLayout_ & DataStorage::dslFlucQPosition) { + sdat.flucQ = &(snap_->atomData.flucQPos[atom1]); + } + + if (storageLayout_ & DataStorage::dslFlucQForce) { + sdat.dVdFQ = &(snap_->atomData.flucQFrc[atom1]); + } } bool ForceDecomposition::checkNeighborList() { int nGroups = snap_->cgData.position.size(); - + if (needVelocities_) + snap_->cgData.setStorageLayout(DataStorage::dslPosition | DataStorage::dslVelocity); + // if we have changed the group identities or haven't set up the // saved positions we automatically will need a neighbor list update: @@ -154,4 +169,14 @@ namespace OpenMD { return false; } + + void ForceDecomposition::addToHeatFlux(Vector3d hf) { + Vector3d chf = snap_->getConductiveHeatFlux(); + chf += hf; + snap_->setConductiveHeatFlux(chf); + } + void ForceDecomposition::setHeatFlux(Vector3d hf) { + snap_->setConductiveHeatFlux(hf); + } + }