ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/trunk/src/integrators/NPTi.cpp
(Generate patch)

Comparing trunk/src/integrators/NPTi.cpp (file contents):
Revision 1781 by gezelter, Mon May 10 17:28:26 2010 UTC vs.
Revision 1782 by gezelter, Wed Aug 22 02:28:28 2012 UTC

# Line 36 | Line 36
36   * [1]  Meineke, et al., J. Comp. Chem. 26, 252-271 (2005).            
37   * [2]  Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006).          
38   * [3]  Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008).          
39 < * [4]  Vardeman & Gezelter, in progress (2009).                        
39 > * [4]  Kuang & Gezelter,  J. Chem. Phys. 133, 164101 (2010).
40 > * [5]  Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011).
41   */
42  
43   #include "NPTi.hpp"
# Line 77 | Line 78 | namespace OpenMD {
78    }
79  
80    void NPTi::calcVelScale() {
81 <    vScale = chi + eta;
81 >    vScale = thermostat.first + eta;
82    }
83  
84    void NPTi::getVelScaleA(Vector3d& sc, const Vector3d& vel) {
# Line 111 | Line 112 | namespace OpenMD {
112        painCave.isFatal = 1;
113        simError();
114      } else {
115 <      Mat3x3d hmat = currentSnapshot_->getHmat();
115 >      Mat3x3d hmat = snap->getHmat();
116        hmat *= scaleFactor;
117 <      currentSnapshot_->setHmat(hmat);
117 >      snap->setHmat(hmat);
118      }
119  
120    }
# Line 125 | Line 126 | namespace OpenMD {
126  
127    RealType NPTi::calcConservedQuantity(){
128  
129 <    chi= currentSnapshot_->getChi();
129 <    integralOfChidt = currentSnapshot_->getIntegralOfChiDt();
129 >    thermostat = snap->getThermostat();
130      loadEta();
131      // We need NkBT a lot, so just set it here: This is the RAW number
132      // of integrableObjects, so no subtraction or addition of constraints or
# Line 145 | Line 145 | namespace OpenMD {
145      RealType barostat_kinetic;
146      RealType barostat_potential;
147  
148 <    Energy =thermo.getTotalE();
148 >    Energy =thermo.getTotalEnergy();
149  
150 <    thermostat_kinetic = fkBT* tt2 * chi * chi / (2.0 * PhysicalConstants::energyConvert);
150 >    thermostat_kinetic = fkBT* tt2 * thermostat.first *
151 >      thermostat.first / (2.0 * PhysicalConstants::energyConvert);
152  
153 <    thermostat_potential = fkBT* integralOfChidt / PhysicalConstants::energyConvert;
153 >    thermostat_potential = fkBT* thermostat.second / PhysicalConstants::energyConvert;
154  
155  
156      barostat_kinetic = 3.0 * NkBT * tb2 * eta * eta /(2.0 * PhysicalConstants::energyConvert);
# Line 164 | Line 165 | namespace OpenMD {
165    }
166  
167    void NPTi::loadEta() {
168 <    Mat3x3d etaMat = currentSnapshot_->getEta();
168 >    Mat3x3d etaMat = snap->getBarostat();
169      eta = etaMat(0,0);
170      //if (fabs(etaMat(1,1) - eta) >= OpenMD::epsilon || fabs(etaMat(1,1) - eta) >= OpenMD::epsilon || !etaMat.isDiagonal()) {
171      //    sprintf( painCave.errMsg,
# Line 179 | Line 180 | namespace OpenMD {
180      etaMat(0, 0) = eta;
181      etaMat(1, 1) = eta;
182      etaMat(2, 2) = eta;
183 <    currentSnapshot_->setEta(etaMat);
183 >    snap->setBarostat(etaMat);
184    }
185   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines