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 507 by gezelter, Fri Apr 15 22:04:00 2005 UTC vs.
Revision 963 by tim, Wed May 17 21:51:42 2006 UTC

# Line 130 | Line 130 | namespace oopse {
130    void NPTf::getPosScale(const Vector3d& pos, const Vector3d& COM, int index, Vector3d& sc) {
131  
132      /**@todo */
133 <    Vector3d rj = (oldPos[index] + pos)/2.0 -COM;
133 >    Vector3d rj = (oldPos[index] + pos)/(RealType)2.0 -COM;
134      sc = eta * rj;
135    }
136  
# Line 140 | Line 140 | namespace oopse {
140      int j;
141      int k;
142      Mat3x3d scaleMat;
143 <    double eta2ij;
144 <    double bigScale, smallScale, offDiagMax;
143 >    RealType eta2ij;
144 >    RealType bigScale, smallScale, offDiagMax;
145      Mat3x3d hm;
146      Mat3x3d hmnew;
147  
# Line 230 | Line 230 | namespace oopse {
230  
231    bool NPTf::etaConverged() {
232      int i;
233 <    double diffEta, sumEta;
233 >    RealType diffEta, sumEta;
234  
235      sumEta = 0;
236      for(i = 0; i < 3; i++) {
# Line 242 | Line 242 | namespace oopse {
242      return ( diffEta <= etaTolerance );
243    }
244  
245 <  double NPTf::calcConservedQuantity(){
245 >  RealType NPTf::calcConservedQuantity(){
246  
247      chi= currentSnapshot_->getChi();
248      integralOfChidt = currentSnapshot_->getIntegralOfChiDt();
# Line 258 | Line 258 | namespace oopse {
258      // of freedom).  
259      fkBT = info_->getNdf()*OOPSEConstant::kB *targetTemp;    
260      
261 <    double conservedQuantity;
262 <    double totalEnergy;
263 <    double thermostat_kinetic;
264 <    double thermostat_potential;
265 <    double barostat_kinetic;
266 <    double barostat_potential;
267 <    double trEta;
261 >    RealType conservedQuantity;
262 >    RealType totalEnergy;
263 >    RealType thermostat_kinetic;
264 >    RealType thermostat_potential;
265 >    RealType barostat_kinetic;
266 >    RealType barostat_potential;
267 >    RealType trEta;
268  
269      totalEnergy = thermo.getTotalE();
270  
# Line 272 | Line 272 | namespace oopse {
272  
273      thermostat_potential = fkBT* integralOfChidt / OOPSEConstant::energyConvert;
274  
275 <    SquareMatrix<double, 3> tmp = eta.transpose() * eta;
275 >    SquareMatrix<RealType, 3> tmp = eta.transpose() * eta;
276      trEta = tmp.trace();
277      
278      barostat_kinetic = NkBT * tb2 * trEta /(2.0 * OOPSEConstant::energyConvert);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines