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

Comparing trunk/src/integrators/NPTxyz.cpp (file contents):
Revision 1497 by gezelter, Thu Sep 9 13:02:24 2010 UTC vs.
Revision 1792 by gezelter, Fri Aug 31 17:29:35 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 61 | Line 62 | namespace OpenMD {
62  
63      
64    RealType NPTxyz::calcConservedQuantity(){
65 <
65 <    chi= currentSnapshot_->getChi();
66 <    integralOfChidt = currentSnapshot_->getIntegralOfChiDt();
65 >    thermostat = snap->getThermostat();
66      loadEta();
67 <    
67 >
68      // We need NkBT a lot, so just set it here: This is the RAW number
69      // of integrableObjects, so no subtraction or addition of constraints or
70      // orientational degrees of freedom:
# Line 84 | Line 83 | namespace OpenMD {
83      RealType barostat_potential;
84      RealType trEta;
85  
86 <    totalEnergy = thermo.getTotalE();
86 >    totalEnergy = thermo.getTotalEnergy();
87  
88 <    thermostat_kinetic = fkBT * tt2 * chi * chi /(2.0 * PhysicalConstants::energyConvert);
88 >    thermostat_kinetic = fkBT * tt2 * thermostat.first * thermostat.first
89 >      / (2.0 * PhysicalConstants::energyConvert);
90  
91 <    thermostat_potential = fkBT* integralOfChidt / PhysicalConstants::energyConvert;
91 >    thermostat_potential = fkBT* thermostat.second
92 >      / PhysicalConstants::energyConvert;
93  
94      SquareMatrix<RealType, 3> tmp = eta.transpose() * eta;
95      trEta = tmp.trace();
# Line 108 | Line 109 | namespace OpenMD {
109      
110    void NPTxyz::scaleSimBox(){
111  
112 <    int i,j,k;
112 >    int i, j;
113      Mat3x3d scaleMat;
114 <    RealType eta2ij, scaleFactor;
115 <    RealType bigScale, smallScale, offDiagMax;
114 >    RealType scaleFactor;
115 >    RealType bigScale, smallScale;
116      Mat3x3d hm;
117      Mat3x3d hmnew;
118  
118
119
119      // Scale the box after all the positions have been moved:
120  
121      // Use a taylor expansion for eta products:  Hmat = Hmat . exp(dt * etaMat)
# Line 124 | Line 123 | namespace OpenMD {
123  
124      bigScale = 1.0;
125      smallScale = 1.0;
127    offDiagMax = 0.0;
126  
127      for(i=0; i<3; i++){
128        for(j=0; j<3; j++){
# Line 166 | Line 164 | namespace OpenMD {
164        simError();
165      } else {
166  
167 <      Mat3x3d hmat = currentSnapshot_->getHmat();
167 >      Mat3x3d hmat = snap->getHmat();
168        hmat = hmat *scaleMat;
169 <      currentSnapshot_->setHmat(hmat);
169 >      snap->setHmat(hmat);
170      }
171    }
172  
173    void NPTxyz::loadEta() {
174 <    eta= currentSnapshot_->getEta();
174 >    eta= snap->getBarostat();
175    }
176  
177   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines