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 837 by tim, Wed Oct 29 00:19:10 2003 UTC vs.
Revision 857 by mmeineke, Fri Nov 7 17:09:48 2003 UTC

# Line 33 | Line 33 | template<typename T> NPTi<T>::NPTi ( SimInfo *theInfo,
33    eta = 0.0;
34    oldEta = 0.0;
35  
36 <  // retrieve eta from simInfo if
37 <  data = info->getProperty(ETAVALUE_ID);
38 <  if(data){
39 <    etaValue = dynamic_cast<DoubleArrayData*>(data);
40 <
41 <    if(etaValue){
42 <      etaArray = etaValue->getData();
43 <      eta = etaArray[0];
44 <      oldEta = eta;
36 >  if( theInfo->useInitXSstate ){
37 >    // retrieve eta from simInfo if
38 >    data = info->getProperty(ETAVALUE_ID);
39 >    if(data){
40 >      etaValue = dynamic_cast<DoubleArrayData*>(data);
41 >      
42 >      if(etaValue){
43 >        etaArray = etaValue->getData();
44 >        eta = etaArray[0];
45 >        oldEta = eta;
46 >      }
47      }
48    }
47
49   }
50  
51   template<typename T> NPTi<T>::~NPTi() {
# Line 69 | Line 70 | template<typename T> void NPTi<T>::getVelScaleA(double
70                   (p_convert*NkBT*tb2));
71   }
72  
73 + template<typename T> void NPTi<T>::calcVelScale(void) {
74 +  vScale = chi + eta;
75 + }
76 +
77   template<typename T> void NPTi<T>::getVelScaleA(double sc[3], double vel[3]) {
78    int i;
79  
80 <  for(i=0; i<3; i++) sc[i] = vel[i] * ( chi + eta );
80 >  for(i=0; i<3; i++) sc[i] = vel[i] * vScale;
81   }
82  
83   template<typename T> void NPTi<T>::getVelScaleB(double sc[3], int index ){
84    int i;
85  
86 <  for(i=0; i<3; i++) sc[i] = oldVel[index*3 + i] * ( chi + eta );
86 >  for(i=0; i<3; i++) sc[i] = oldVel[index*3 + i] * vScale;
87   }
88  
89  
# Line 158 | Line 163 | template<typename T> string NPTi<T>::getAdditionalPara
163    const int BUFFERSIZE = 2000; // size of the read buffer
164    char buffer[BUFFERSIZE];
165  
166 <  sprintf(buffer,"\t%g\t%g;", chi, integralOfChidt);
166 >  sprintf(buffer,"\t%G\t%G;", chi, integralOfChidt);
167    parameters += buffer;
168  
169 <  sprintf(buffer,"\t%g\t0\t0;", eta);
169 >  sprintf(buffer,"\t%G\t0\t0;", eta);
170    parameters += buffer;
171  
172 <  sprintf(buffer,"\t0\t%g\t0;", eta);
172 >  sprintf(buffer,"\t0\t%G\t0;", eta);
173    parameters += buffer;
174  
175 <  sprintf(buffer,"\t0\t0\t%g;", eta);
175 >  sprintf(buffer,"\t0\t0\t%G;", eta);
176    parameters += buffer;
177  
178    return parameters;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines