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 855 by mmeineke, Thu Nov 6 22:01:37 2003 UTC vs.
Revision 1097 by gezelter, Mon Apr 12 20:32:20 2004 UTC

# Line 1 | Line 1
1   #include <math.h>
2 +
3 + #include "MatVec3.h"
4   #include "Atom.hpp"
5   #include "SRI.hpp"
6   #include "AbstractClasses.hpp"
# Line 116 | Line 118 | template<typename T> void NPTf<T>::getVelScaleA(double
118    }
119   }
120  
121 < template<typename T> void NPTf<T>::getVelScaleA(double sc[3], double vel[3]) {
121 > template<typename T> void NPTf<T>::calcVelScale(void){
122    int i,j;
121  double vScale[3][3];
123  
124    for (i = 0; i < 3; i++ ) {
125      for (j = 0; j < 3; j++ ) {
# Line 129 | Line 130 | template<typename T> void NPTf<T>::getVelScaleA(double
130        }
131      }
132    }
133 + }
134  
135 <  info->matVecMul3( vScale, vel, sc );
135 > template<typename T> void NPTf<T>::getVelScaleA(double sc[3], double vel[3]) {
136 >
137 >  matVecMul3( vScale, vel, sc );
138   }
139  
140   template<typename T> void NPTf<T>::getVelScaleB(double sc[3], int index ){
141 <  int i,j;
141 >  int j;
142    double myVel[3];
143    double vScale[3][3];
140
141  for (i = 0; i < 3; i++ ) {
142    for (j = 0; j < 3; j++ ) {
143      vScale[i][j] = eta[i][j];
144
145      if (i == j) {
146        vScale[i][j] += chi;
147      }
148    }
149  }
144  
145    for (j = 0; j < 3; j++)
146      myVel[j] = oldVel[3*index + j];
147  
148 <  info->matVecMul3( vScale, myVel, sc );
148 >  matVecMul3( vScale, myVel, sc );
149   }
150  
151   template<typename T> void NPTf<T>::getPosScale(double pos[3], double COM[3],
# Line 162 | Line 156 | template<typename T> void NPTf<T>::getPosScale(double
156    for(j=0; j<3; j++)
157      rj[j] = ( oldPos[index*3+j] + pos[j]) / 2.0 - COM[j];
158  
159 <  info->matVecMul3( eta, rj, sc );
159 >  matVecMul3( eta, rj, sc );
160   }
161  
162   template<typename T> void NPTf<T>::scaleSimBox( void ){
# Line 236 | Line 230 | template<typename T> void NPTf<T>::scaleSimBox( void )
230      simError();
231    } else {
232      info->getBoxM(hm);
233 <    info->matMul3(hm, scaleMat, hmnew);
233 >    matMul3(hm, scaleMat, hmnew);
234      info->setBoxM(hmnew);
235    }
236   }
# Line 272 | Line 266 | template<typename T> double NPTf<T>::getConservedQuant
266  
267    thermostat_potential = fkBT* integralOfChidt / eConvert;
268  
269 <  info->transposeMat3(eta, a);
270 <  info->matMul3(a, eta, b);
271 <  trEta = info->matTrace3(b);
269 >  transposeMat3(eta, a);
270 >  matMul3(a, eta, b);
271 >  trEta = matTrace3(b);
272  
273    barostat_kinetic = NkBT * tb2 * trEta /
274      (2.0 * eConvert);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines