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 853 by mmeineke, Thu Nov 6 19:11:38 2003 UTC vs.
Revision 857 by mmeineke, Fri Nov 7 17:09:48 2003 UTC

# Line 1 | Line 1
1   #include <math.h>
2 +
3   #include "Atom.hpp"
4   #include "SRI.hpp"
5   #include "AbstractClasses.hpp"
# Line 39 | Line 40 | template<typename T> NPTf<T>::NPTf ( SimInfo *theInfo,
40      }
41    }
42  
43 +
44 +  if( theInfo->useInitXSstate ){
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 <
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 <        }
56 <
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 +  }
62  
63   }
64  
# Line 114 | Line 117 | template<typename T> void NPTf<T>::getVelScaleA(double
117    }
118   }
119  
120 < template<typename T> void NPTf<T>::getVelScaleA(double sc[3], double vel[3]) {
120 > template<typename T> void NPTf<T>::calcVelScale(void){
121    int i,j;
119  double vScale[3][3];
122  
123    for (i = 0; i < 3; i++ ) {
124      for (j = 0; j < 3; j++ ) {
# Line 127 | Line 129 | template<typename T> void NPTf<T>::getVelScaleA(double
129        }
130      }
131    }
132 + }
133  
134 + template<typename T> void NPTf<T>::getVelScaleA(double sc[3], double vel[3]) {
135 +
136    info->matVecMul3( vScale, vel, sc );
137   }
138  
139   template<typename T> void NPTf<T>::getVelScaleB(double sc[3], int index ){
140 <  int i,j;
140 >  int j;
141    double myVel[3];
142    double vScale[3][3];
143  
139  for (i = 0; i < 3; i++ ) {
140    for (j = 0; j < 3; j++ ) {
141      vScale[i][j] = eta[i][j];
142
143      if (i == j) {
144        vScale[i][j] += chi;
145      }
146    }
147  }
148
144    for (j = 0; j < 3; j++)
145      myVel[j] = oldVel[3*index + j];
146  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines