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

Comparing trunk/OOPSE/libmdtools/NPTxyz.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 39 | Line 39 | template<typename T> NPTxyz<T>::NPTxyz ( SimInfo *theI
39      }
40    }
41  
42  // retrieve eta array from simInfo if it exists
43  data = info->getProperty(ETAVALUE_ID);
44  if(data){
45    etaValue = dynamic_cast<DoubleArrayData*>(data);
42  
43 <    if(etaValue){
48 <      etaArray = etaValue->getData();
43 >  if( theInfo->useInitXSstate ){
44  
45 <      for(i = 0; i < 3; i++){
46 <        for (j = 0; j < 3; j++){
47 <          eta[i][j] = etaArray[3*i+j];
48 <          oldEta[i][j] = eta[i][j];
49 <        }
45 >    // retrieve eta array from simInfo if it exists
46 >    data = info->getProperty(ETAVALUE_ID);
47 >    if(data){
48 >      etaValue = dynamic_cast<DoubleArrayData*>(data);
49 >      
50 >      if(etaValue){
51 >        etaArray = etaValue->getData();
52 >        
53 >        for(i = 0; i < 3; i++){
54 >          for (j = 0; j < 3; j++){
55 >            eta[i][j] = etaArray[3*i+j];
56 >            oldEta[i][j] = eta[i][j];
57 >          }
58 >        }
59        }
60      }
61    }
58
62   }
63  
64   template<typename T> NPTxyz<T>::~NPTxyz() {
# Line 113 | Line 116 | template<typename T> void NPTxyz<T>::getVelScaleA(doub
116    }
117   }
118  
119 < template<typename T> void NPTxyz<T>::getVelScaleA(double sc[3], double vel[3]) {
119 > template<typename T> void NPTxyz<T>::calcVelScale(void) {
120    int i,j;
118  double vScale[3][3];
121  
122    for (i = 0; i < 3; i++ ) {
123      for (j = 0; j < 3; j++ ) {
# Line 126 | Line 128 | template<typename T> void NPTxyz<T>::getVelScaleA(doub
128        }
129      }
130    }
131 + }
132  
133 + template<typename T> void NPTxyz<T>::getVelScaleA(double sc[3], double vel[3]) {
134    info->matVecMul3( vScale, vel, sc );
135   }
136  
137   template<typename T> void NPTxyz<T>::getVelScaleB(double sc[3], int index ){
138 <  int i,j;
138 >  int j;
139    double myVel[3];
136  double vScale[3][3];
137
138  for (i = 0; i < 3; i++ ) {
139    for (j = 0; j < 3; j++ ) {
140      vScale[i][j] = eta[i][j];
140  
142      if (i == j) {
143        vScale[i][j] += chi;
144      }
145    }
146  }
147
141    for (j = 0; j < 3; j++)
142      myVel[j] = oldVel[3*index + j];
143  
# Line 305 | Line 298 | template<typename T> string NPTxyz<T>::getAdditionalPa
298    const int BUFFERSIZE = 2000; // size of the read buffer
299    char buffer[BUFFERSIZE];
300  
301 <  sprintf(buffer,"\t%f\t%f;", chi, integralOfChidt);
301 >  sprintf(buffer,"\t%G\t%G;", chi, integralOfChidt);
302    parameters += buffer;
303  
304    for(int i = 0; i < 3; i++){
305 <    sprintf(buffer,"\t%g\t%g\t%g;", eta[3*i], eta[3*i+1], eta[3*i+2]);
305 >    sprintf(buffer,"\t%G\t%G\t%G;", eta[i][0], eta[i][1], eta[i][2]);
306      parameters += buffer;
307    }
308  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines