ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/libmdtools/NPTi.cpp
(Generate patch)

Comparing trunk/OOPSE/libmdtools/NPTi.cpp (file contents):
Revision 600 by gezelter, Mon Jul 14 22:38:13 2003 UTC vs.
Revision 617 by gezelter, Tue Jul 15 19:56:08 2003 UTC

# Line 42 | Line 42 | void NPTi::moveA() {
42  
43    double rj[3];
44    double instaTemp, instaPress, instaVol;
45 <  double tt2, tb2;
45 >  double tt2, tb2, scaleFactor;
46  
47    tt2 = tauThermostat * tauThermostat;
48    tb2 = tauBarostat * tauBarostat;
# Line 76 | Line 76 | void NPTi::moveA() {
76      for (j = 0; j < 3; j++)
77        pos[j] += dt * (vel[j] + eta*rj[j]);
78  
79
79      atoms[i]->setPos( pos );
80  
82
81      if( atoms[i]->isDirectional() ){
82  
83        dAtom = (DirectionalAtom *)atoms[i];
# Line 127 | Line 125 | void NPTi::moveA() {
125      }                
126  
127    }
128 +
129    // Scale the box after all the positions have been moved:
130    
131 <  cerr << "eta = " << eta
132 <       << "; exp(dt*eta) = " << exp(eta*dt) << "\n";
133 <  
134 <  info->scaleBox(exp(dt*eta));  
131 >  scaleFactor = exp(dt*eta);
132 >
133 >  if ((scaleFactor > 1.1) || (scaleFactor < 0.9)) {
134 >    sprintf( painCave.errMsg,
135 >             "NPTi error: Attempting a Box scaling of more than 10 percent"
136 >             " check your tauBarostat, as it is probably too small!\n"
137 >             " eta = %lf, scaleFactor = %lf\n", eta, scaleFactor
138 >             );
139 >    painCave.isFatal = 1;
140 >    simError();
141 >  } else {        
142 >    info->scaleBox(exp(dt*eta));      
143 >  }
144 >
145   }
146  
147   void NPTi::moveB( void ){

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines