--- trunk/OOPSE/libmdtools/NPTxyz.cpp 2003/11/06 22:01:37 855 +++ trunk/OOPSE/libmdtools/NPTxyz.cpp 2004/04/12 20:32:20 1097 @@ -1,4 +1,5 @@ #include +#include "MatVec3.h" #include "Atom.hpp" #include "SRI.hpp" #include "AbstractClasses.hpp" @@ -116,9 +117,8 @@ template void NPTxyz::evolveEtaB() { } } -template void NPTxyz::getVelScaleA(double sc[3], double vel[3]) { +template void NPTxyz::calcVelScale(void) { int i,j; - double vScale[3][3]; for (i = 0; i < 3; i++ ) { for (j = 0; j < 3; j++ ) { @@ -129,29 +129,20 @@ template void NPTxyz::getVelScaleA(doub } } } +} - info->matVecMul3( vScale, vel, sc ); +template void NPTxyz::getVelScaleA(double sc[3], double vel[3]) { + matVecMul3( vScale, vel, sc ); } template void NPTxyz::getVelScaleB(double sc[3], int index ){ - int i,j; + int j; double myVel[3]; - double vScale[3][3]; - for (i = 0; i < 3; i++ ) { - for (j = 0; j < 3; j++ ) { - vScale[i][j] = eta[i][j]; - - if (i == j) { - vScale[i][j] += chi; - } - } - } - for (j = 0; j < 3; j++) myVel[j] = oldVel[3*index + j]; - info->matVecMul3( vScale, myVel, sc ); + matVecMul3( vScale, myVel, sc ); } template void NPTxyz::getPosScale(double pos[3], double COM[3], @@ -162,7 +153,7 @@ template void NPTxyz::getPosScale(doubl for(j=0; j<3; j++) rj[j] = ( oldPos[index*3+j] + pos[j]) / 2.0 - COM[j]; - info->matVecMul3( eta, rj, sc ); + matVecMul3( eta, rj, sc ); } template void NPTxyz::scaleSimBox( void ){ @@ -243,7 +234,7 @@ template void NPTxyz::scaleSimBox( void simError(); } else { info->getBoxM(hm); - info->matMul3(hm, scaleMat, hmnew); + matMul3(hm, scaleMat, hmnew); info->setBoxM(hmnew); } } @@ -279,9 +270,9 @@ template double NPTxyz::getConservedQua thermostat_potential = fkBT* integralOfChidt / eConvert; - info->transposeMat3(eta, a); - info->matMul3(a, eta, b); - trEta = info->matTrace3(b); + transposeMat3(eta, a); + matMul3(a, eta, b); + trEta = matTrace3(b); barostat_kinetic = NkBT * tb2 * trEta / (2.0 * eConvert);