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

Comparing trunk/OOPSE/libmdtools/NPTf.cpp (file contents):
Revision 847 by mmeineke, Fri Oct 31 18:28:52 2003 UTC vs.
Revision 855 by mmeineke, Thu Nov 6 22:01:37 2003 UTC

# Line 39 | Line 39 | template<typename T> NPTf<T>::NPTf ( SimInfo *theInfo,
39      }
40    }
41  
42 +
43 +  if( theInfo->useInitXSstate ){
44      // retrieve eta array from simInfo if it exists
45      data = info->getProperty(ETAVALUE_ID);
46      if(data){
47        etaValue = dynamic_cast<DoubleArrayData*>(data);
48 <
48 >      
49        if(etaValue){
50 <        etaArray = etaValue->getData();
51 <
52 <        for(i = 0; i < 3; i++){
53 <          for (j = 0; j < 3; j++){
54 <            eta[i][j] = etaArray[3*i+j];
55 <            oldEta[i][j] = eta[i][j];
56 <          }
57 <        }
56 <
50 >        etaArray = etaValue->getData();
51 >        
52 >        for(i = 0; i < 3; i++){
53 >          for (j = 0; j < 3; j++){
54 >            eta[i][j] = etaArray[3*i+j];
55 >            oldEta[i][j] = eta[i][j];
56 >          }
57 >        }
58        }
59      }
60 +  }
61  
62   }
63  
# Line 208 | Line 210 | template<typename T> void NPTf<T>::scaleSimBox( void )
210      if (scaleMat[i][i] < smallScale) smallScale = scaleMat[i][i];
211    }
212  
213 <  if ((bigScale > 1.1) || (smallScale < 0.9)) {
213 >  if ((bigScale > 1.01) || (smallScale < 0.99)) {
214      sprintf( painCave.errMsg,
215 <             "NPTf error: Attempting a Box scaling of more than 10 percent.\n"
215 >             "NPTf error: Attempting a Box scaling of more than 1 percent.\n"
216               " Check your tauBarostat, as it is probably too small!\n\n"
217               " scaleMat = [%lf\t%lf\t%lf]\n"
218               "            [%lf\t%lf\t%lf]\n"
# Line 220 | Line 222 | template<typename T> void NPTf<T>::scaleSimBox( void )
222               scaleMat[2][0],scaleMat[2][1],scaleMat[2][2]);
223      painCave.isFatal = 1;
224      simError();
225 <  } else if (offDiagMax > 0.1) {
225 >  } else if (offDiagMax > 0.01) {
226      sprintf( painCave.errMsg,
227 <             "NPTf error: Attempting an off-diagonal Box scaling of more than 10 percent.\n"
227 >             "NPTf error: Attempting an off-diagonal Box scaling of more than 1 percent.\n"
228               " Check your tauBarostat, as it is probably too small!\n\n"
229               " scaleMat = [%lf\t%lf\t%lf]\n"
230               "            [%lf\t%lf\t%lf]\n"
# Line 283 | Line 285 | template<typename T> double NPTf<T>::getConservedQuant
285    conservedQuantity = totalEnergy + thermostat_kinetic + thermostat_potential +
286      barostat_kinetic + barostat_potential;
287  
286 //   cout.width(8);
287 //   cout.precision(8);
288
289 //   cerr << info->getTime() << "\t" << Energy << "\t" << thermostat_kinetic <<
290 //       "\t" << thermostat_potential << "\t" << barostat_kinetic <<
291 //       "\t" << barostat_potential << "\t" << conservedQuantity << endl;
292
288    return conservedQuantity;
289  
290   }
# Line 299 | Line 294 | template<typename T> string NPTf<T>::getAdditionalPara
294    const int BUFFERSIZE = 2000; // size of the read buffer
295    char buffer[BUFFERSIZE];
296  
297 <  sprintf(buffer,"\t%lf\t%lf;", chi, integralOfChidt);
297 >  sprintf(buffer,"\t%G\t%G;", chi, integralOfChidt);
298    parameters += buffer;
299  
300    for(int i = 0; i < 3; i++){
301 <    sprintf(buffer,"\t%lf\t%lf\t%lf;", eta[3*i], eta[3*i+1], eta[3*i+2]);
301 >    sprintf(buffer,"\t%G\t%G\t%G;", eta[i][0], eta[i][1], eta[i][2]);
302      parameters += buffer;
303    }
304  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines