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

Comparing trunk/src/integrators/NPTf.cpp (file contents):
Revision 1390 by gezelter, Wed Nov 25 20:02:06 2009 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 "brains/SimInfo.hpp"
# Line 113 | Line 114 | namespace OpenMD {
114          vScale(i, j) = eta(i, j);
115  
116          if (i == j) {
117 <          vScale(i, j) += chi;
117 >          vScale(i, j) += thermostat.first;
118          }
119        }
120      }
# Line 221 | Line 222 | namespace OpenMD {
222        simError();
223      } else {
224  
225 <      Mat3x3d hmat = currentSnapshot_->getHmat();
225 >      Mat3x3d hmat = snap->getHmat();
226        hmat = hmat *scaleMat;
227 <      currentSnapshot_->setHmat(hmat);
227 >      snap->setHmat(hmat);
228          
229      }
230    }
# Line 243 | Line 244 | namespace OpenMD {
244    }
245  
246    RealType NPTf::calcConservedQuantity(){
247 <
248 <    chi= currentSnapshot_->getChi();
248 <    integralOfChidt = currentSnapshot_->getIntegralOfChiDt();
247 >    
248 >    thermostat = snap->getThermostat();
249      loadEta();
250      
251      // We need NkBT a lot, so just set it here: This is the RAW number
# Line 266 | Line 266 | namespace OpenMD {
266      RealType barostat_potential;
267      RealType trEta;
268  
269 <    totalEnergy = thermo.getTotalE();
269 >    totalEnergy = thermo.getTotalEnergy();
270 >    
271 >    thermostat_kinetic = fkBT * tt2 * thermostat.first *
272 >      thermostat.first /(2.0 * PhysicalConstants::energyConvert);
273  
274 <    thermostat_kinetic = fkBT * tt2 * chi * chi /(2.0 * PhysicalConstants::energyConvert);
274 >    thermostat_potential = fkBT* thermostat.second / PhysicalConstants::energyConvert;
275  
273    thermostat_potential = fkBT* integralOfChidt / PhysicalConstants::energyConvert;
274
276      SquareMatrix<RealType, 3> tmp = eta.transpose() * eta;
277      trEta = tmp.trace();
278      
# Line 287 | Line 288 | namespace OpenMD {
288    }
289  
290    void NPTf::loadEta() {
291 <    eta= currentSnapshot_->getEta();
291 >    eta= snap->getBarostat();
292  
293      //if (!eta.isDiagonal()) {
294      //    sprintf( painCave.errMsg,
# Line 298 | Line 299 | namespace OpenMD {
299    }
300  
301    void NPTf::saveEta() {
302 <    currentSnapshot_->setEta(eta);
302 >    snap->setBarostat(eta);
303    }
304  
305   }

Comparing trunk/src/integrators/NPTf.cpp (property svn:keywords):
Revision 1390 by gezelter, Wed Nov 25 20:02:06 2009 UTC vs.
Revision 1782 by gezelter, Wed Aug 22 02:28:28 2012 UTC

# Line 0 | Line 1
1 + Author Id Revision Date

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines