--- trunk/OOPSE/libmdtools/NPTi.cpp 2003/07/15 17:10:50 611 +++ trunk/OOPSE/libmdtools/NPTi.cpp 2003/09/04 21:48:35 746 @@ -20,8 +20,8 @@ NPTi::NPTi ( SimInfo *theInfo, ForceFields* the_ff): // // Hoover, W. G., 1986, Phys. Rev. A, 34, 2499. -NPTi::NPTi ( SimInfo *theInfo, ForceFields* the_ff): - Integrator( theInfo, the_ff ) +template NPTi::NPTi ( SimInfo *theInfo, ForceFields* the_ff): + T( theInfo, the_ff ) { chi = 0.0; eta = 0.0; @@ -31,7 +31,7 @@ void NPTi::moveA() { have_target_pressure = 0; } -void NPTi::moveA() { +template void NPTi::moveA() { int i, j; DirectionalAtom* dAtom; @@ -76,10 +76,8 @@ void NPTi::moveA() { for (j = 0; j < 3; j++) pos[j] += dt * (vel[j] + eta*rj[j]); - atoms[i]->setPos( pos ); - if( atoms[i]->isDirectional() ){ dAtom = (DirectionalAtom *)atoms[i]; @@ -132,7 +130,7 @@ void NPTi::moveA() { scaleFactor = exp(dt*eta); - if (scaleFactor > 1.1 || scaleFactor < 0.9) { + if ((scaleFactor > 1.1) || (scaleFactor < 0.9)) { sprintf( painCave.errMsg, "NPTi error: Attempting a Box scaling of more than 10 percent" " check your tauBarostat, as it is probably too small!\n" @@ -143,9 +141,10 @@ void NPTi::moveA() { } else { info->scaleBox(exp(dt*eta)); } + } -void NPTi::moveB( void ){ +template void NPTi::moveB( void ){ int i, j; DirectionalAtom* dAtom; @@ -201,7 +200,16 @@ int NPTi::readyCheck() { } } -int NPTi::readyCheck() { +template void NPTi::resetIntegrator() { + chi = 0.0; + eta = 0.0; +} + +template int NPTi::readyCheck() { + + //check parent's readyCheck() first + if (T::readyCheck() == -1) + return -1; // First check to see if we have a target temperature. // Not having one is fatal.