--- branches/development/src/parallel/ForceDecomposition.cpp 2011/09/14 21:15:17 1629 +++ branches/development/src/parallel/ForceDecomposition.cpp 2012/05/24 20:59:54 1723 @@ -36,7 +36,8 @@ * [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). - * [4] Vardeman & Gezelter, in progress (2009). + * [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" @@ -47,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 { @@ -125,7 +131,9 @@ namespace OpenMD { 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: @@ -153,4 +161,12 @@ namespace OpenMD { return false; } + + void ForceDecomposition::addToHeatFlux(Vector3d hf) { + snap_->frameData.conductiveHeatFlux += hf; + } + void ForceDecomposition::setHeatFlux(Vector3d hf) { + snap_->frameData.conductiveHeatFlux = hf; + } + }