--- trunk/mdtools/md_code/Verlet.cpp 2003/01/28 22:16:55 252 +++ trunk/mdtools/md_code/Verlet.cpp 2003/01/30 15:20:21 253 @@ -127,7 +127,8 @@ void Verlet::integrate( void ){ void Verlet::integrate( void ){ int i, j; /* loop counters */ - + int calcPot; + double kE; double *Rx = new double[c_natoms]; @@ -163,14 +164,16 @@ void Verlet::integrate( void ){ // the first time integrate is called, the forces need to be initialized - myFF->doForces(); + myFF->doForces(1); if( entry_plug->setTemp ){ tStats->velocitize(); } dump_out->writeDump( 0.0 ); + e_out->writeStat( 0.0 ); + calcPot = 0; if( c_is_constrained ){ for(i = 0; i < n_loops; i++){ @@ -212,7 +215,7 @@ void Verlet::integrate( void ){ // calculate the forces - myFF->doForces(); + myFF->doForces(calcPot); // finish the constrain move ( same as above. ) @@ -254,7 +257,8 @@ void Verlet::integrate( void ){ if( !(time % vel_n) ) tStats->velocitize(); } if( !(time % sample_n) ) dump_out->writeDump( time * dt ); - if( !(time % status_n) ) e_out->writeStat( time * dt ); + if( !((time+1) % status_n) ) calcPot = 1; + if( !(time % status_n) ){ e_out->writeStat( time * dt ); calcPot = 0; } } } else{ @@ -264,7 +268,7 @@ void Verlet::integrate( void ){ // calculate the forces - myFF->doForces(); + myFF->doForces(calcPot); // complete the verlet move @@ -275,8 +279,9 @@ void Verlet::integrate( void ){ if( entry_plug->setTemp ){ if( !(time % vel_n) ) tStats->velocitize(); } - if( !(time % sample_n) ) dump_out->writeDump( time * dt ); - if( !(time % status_n) ) e_out->writeStat( time * dt ); + if( !(time % sample_n) ) dump_out->writeDump( time * dt ); + if( !((time+1) % status_n) ) calcPot = 1; + if( !(time % status_n) ){ e_out->writeStat( time * dt ); calcPot = 0; } } }