--- trunk/OOPSE/libmdtools/NPTi.cpp 2003/07/08 20:56:10 574 +++ trunk/OOPSE/libmdtools/NPTi.cpp 2003/07/09 01:41:11 577 @@ -65,21 +65,15 @@ void NPTi::moveA() { // position whole step - for( j=atomIndex; j<(atomIndex+3); j=j+3 ) { - rj[0] = pos[j]; - rj[1] = pos[j+1]; - rj[2] = pos[j+2]; + rj[0] = pos[atomIndex]; + rj[1] = pos[atomIndex+1]; + rj[2] = pos[atomIndex+2]; + + info->wrapVector(rj); - info->wrapVector(rj); - - pos[j] += dt * (vel[j] + eta*rj[0]); - pos[j+1] += dt * (vel[j+1] + eta*rj[1]); - pos[j+2] += dt * (vel[j+2] + eta*rj[2]); - } - - // Scale the box after all the positions have been moved: - - info->scaleBox(dt*eta); + pos[atomIndex] += dt * (vel[atomIndex] + eta*rj[0]); + pos[atomIndex+1] += dt * (vel[atomIndex+1] + eta*rj[1]); + pos[atomIndex+2] += dt * (vel[atomIndex+2] + eta*rj[2]); if( atoms[i]->isDirectional() ){ @@ -132,6 +126,10 @@ void NPTi::moveA() { } } + // Scale the box after all the positions have been moved: + + info->scaleBox(exp(dt*eta)); + } void NPTi::moveB( void ){