--- trunk/OOPSE/libmdtools/NPTxyz.cpp 2003/10/29 00:19:10 837 +++ trunk/OOPSE/libmdtools/NPTxyz.cpp 2003/11/07 17:09:48 857 @@ -39,23 +39,26 @@ template NPTxyz::NPTxyz ( SimInfo *theI } } - // retrieve eta array from simInfo if it exists - data = info->getProperty(ETAVALUE_ID); - if(data){ - etaValue = dynamic_cast(data); - if(etaValue){ - etaArray = etaValue->getData(); + if( theInfo->useInitXSstate ){ - for(i = 0; i < 3; i++){ - for (j = 0; j < 3; j++){ - eta[i][j] = etaArray[3*i+j]; - oldEta[i][j] = eta[i][j]; - } + // retrieve eta array from simInfo if it exists + data = info->getProperty(ETAVALUE_ID); + if(data){ + etaValue = dynamic_cast(data); + + if(etaValue){ + etaArray = etaValue->getData(); + + for(i = 0; i < 3; i++){ + for (j = 0; j < 3; j++){ + eta[i][j] = etaArray[3*i+j]; + oldEta[i][j] = eta[i][j]; + } + } } } } - } template NPTxyz::~NPTxyz() { @@ -113,9 +116,8 @@ template void NPTxyz::getVelScaleA(doub } } -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++ ) { @@ -126,25 +128,16 @@ template void NPTxyz::getVelScaleA(doub } } } +} +template void NPTxyz::getVelScaleA(double sc[3], double vel[3]) { info->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]; @@ -305,11 +298,11 @@ template string NPTxyz::getAdditionalPa const int BUFFERSIZE = 2000; // size of the read buffer char buffer[BUFFERSIZE]; - sprintf(buffer,"\t%f\t%f;", chi, integralOfChidt); + sprintf(buffer,"\t%G\t%G;", chi, integralOfChidt); parameters += buffer; for(int i = 0; i < 3; i++){ - sprintf(buffer,"\t%g\t%g\t%g;", eta[3*i], eta[3*i+1], eta[3*i+2]); + sprintf(buffer,"\t%G\t%G\t%G;", eta[i][0], eta[i][1], eta[i][2]); parameters += buffer; }