--- trunk/src/integrators/NPTf.cpp 2009/11/25 20:02:06 1390 +++ trunk/src/integrators/NPTf.cpp 2013/06/16 15:15:42 1879 @@ -35,8 +35,9 @@ * * [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). + * [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 "brains/SimInfo.hpp" @@ -113,7 +114,7 @@ namespace OpenMD { vScale(i, j) = eta(i, j); if (i == j) { - vScale(i, j) += chi; + vScale(i, j) += thermostat.first; } } } @@ -221,9 +222,9 @@ namespace OpenMD { simError(); } else { - Mat3x3d hmat = currentSnapshot_->getHmat(); + Mat3x3d hmat = snap->getHmat(); hmat = hmat *scaleMat; - currentSnapshot_->setHmat(hmat); + snap->setHmat(hmat); } } @@ -243,9 +244,8 @@ namespace OpenMD { } RealType NPTf::calcConservedQuantity(){ - - chi= currentSnapshot_->getChi(); - integralOfChidt = currentSnapshot_->getIntegralOfChiDt(); + + thermostat = snap->getThermostat(); loadEta(); // We need NkBT a lot, so just set it here: This is the RAW number @@ -266,12 +266,13 @@ namespace OpenMD { RealType barostat_potential; RealType trEta; - totalEnergy = thermo.getTotalE(); + totalEnergy = thermo.getTotalEnergy(); + + thermostat_kinetic = fkBT * tt2 * thermostat.first * + thermostat.first /(2.0 * PhysicalConstants::energyConvert); - thermostat_kinetic = fkBT * tt2 * chi * chi /(2.0 * PhysicalConstants::energyConvert); + thermostat_potential = fkBT* thermostat.second / PhysicalConstants::energyConvert; - thermostat_potential = fkBT* integralOfChidt / PhysicalConstants::energyConvert; - SquareMatrix tmp = eta.transpose() * eta; trEta = tmp.trace(); @@ -287,7 +288,7 @@ namespace OpenMD { } void NPTf::loadEta() { - eta= currentSnapshot_->getEta(); + eta= snap->getBarostat(); //if (!eta.isDiagonal()) { // sprintf( painCave.errMsg, @@ -298,7 +299,7 @@ namespace OpenMD { } void NPTf::saveEta() { - currentSnapshot_->setEta(eta); + snap->setBarostat(eta); } }