ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/mdtools/md_code/Verlet.cpp
(Generate patch)

Comparing trunk/mdtools/md_code/Verlet.cpp (file contents):
Revision 252 by chuckv, Mon Jan 27 21:28:19 2003 UTC vs.
Revision 253 by chuckv, Thu Jan 30 15:20:21 2003 UTC

# Line 127 | Line 127 | void Verlet::integrate( void ){
127   void Verlet::integrate( void ){
128    
129    int i, j; /* loop counters */
130 <  
130 >  int calcPot;
131 >
132    double kE;
133  
134    double *Rx = new double[c_natoms];
# Line 163 | Line 164 | void Verlet::integrate( void ){
164    // the first time integrate is called, the forces need to be initialized
165  
166    
167 <  myFF->doForces();
167 >  myFF->doForces(1);
168    
169    if( entry_plug->setTemp ){
170      tStats->velocitize();
171    }
172    
173    dump_out->writeDump( 0.0 );
174 +
175    e_out->writeStat( 0.0 );
176 +  calcPot = 0;
177  
178    if( c_is_constrained ){
179      for(i = 0; i < n_loops; i++){
# Line 212 | Line 215 | void Verlet::integrate( void ){
215  
216        // calculate the forces
217        
218 <      myFF->doForces();
218 >      myFF->doForces(calcPot);
219        
220        // finish the constrain move ( same as above. )
221  
# Line 254 | Line 257 | void Verlet::integrate( void ){
257          if( !(time % vel_n) ) tStats->velocitize();
258        }
259        if( !(time % sample_n) ) dump_out->writeDump( time * dt );
260 <      if( !(time % status_n) ) e_out->writeStat( time * dt );
260 >      if( !((time+1) % status_n) ) calcPot = 1;
261 >      if( !(time % status_n) ){ e_out->writeStat( time * dt ); calcPot = 0; }
262      }
263    }
264    else{
# Line 264 | Line 268 | void Verlet::integrate( void ){
268        
269        // calculate the forces
270        
271 <      myFF->doForces();
271 >      myFF->doForces(calcPot);
272              
273        // complete the verlet move
274        
# Line 275 | Line 279 | void Verlet::integrate( void ){
279        if( entry_plug->setTemp ){
280          if( !(time % vel_n) ) tStats->velocitize();
281        }
282 <      if( !(time % sample_n) ) dump_out->writeDump( time * dt );
283 <      if( !(time % status_n) ) e_out->writeStat( time * dt );
282 >      if( !(time % sample_n) )  dump_out->writeDump( time * dt );
283 >      if( !((time+1) % status_n) ) calcPot = 1;
284 >      if( !(time % status_n) ){ e_out->writeStat( time * dt ); calcPot = 0; }
285      }
286    }
287    

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines