--- trunk/mdtools/md_code/Verlet.cpp 2003/01/27 19:28:21 248 +++ trunk/mdtools/md_code/Verlet.cpp 2003/01/30 15:20:21 253 @@ -30,7 +30,7 @@ extern "C"{ } -Verlet::Verlet( SimInfo &info, ForceField* the_ff ){ +Verlet::Verlet( SimInfo &info, ForceFields* the_ff ){ // get what information we need from the SimInfo object @@ -41,7 +41,6 @@ Verlet::Verlet( SimInfo &info, ForceField* the_ff ){ c_natoms = info.n_atoms; c_atoms = info.atoms; c_sr_interactions = info.sr_interactions; - longRange = info.longRange; c_n_SRI = info.n_SRI; c_is_constrained = 0; c_box_x = info.box_x; @@ -128,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]; @@ -164,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++){ @@ -213,7 +215,7 @@ void Verlet::integrate( void ){ // calculate the forces - myFF->doForces(); + myFF->doForces(calcPot); // finish the constrain move ( same as above. ) @@ -255,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{ @@ -265,7 +268,7 @@ void Verlet::integrate( void ){ // calculate the forces - myFF->doForces(); + myFF->doForces(calcPot); // complete the verlet move @@ -276,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; } } }