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 248 by chuckv, Mon Jan 27 19:28:21 2003 UTC vs.
Revision 261 by chuckv, Mon Feb 3 21:15:59 2003 UTC

# Line 30 | Line 30 | Verlet::Verlet( SimInfo &info, ForceField* the_ff ){
30   }
31  
32    
33 < Verlet::Verlet( SimInfo &info, ForceField* the_ff ){
33 > Verlet::Verlet( SimInfo &info, ForceFields* the_ff ){
34    
35    // get what information we need from the SimInfo object
36  
# Line 41 | Line 41 | Verlet::Verlet( SimInfo &info, ForceField* the_ff ){
41    c_natoms = info.n_atoms;
42    c_atoms = info.atoms;
43    c_sr_interactions = info.sr_interactions;
44  longRange = info.longRange;
44    c_n_SRI = info.n_SRI;
45    c_is_constrained = 0;
46    c_box_x = info.box_x;
# Line 128 | 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 164 | 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  
177 +  calcPot = 0;
178 +
179    if( c_is_constrained ){
180      for(i = 0; i < n_loops; i++){
181        
# Line 213 | Line 216 | void Verlet::integrate( void ){
216  
217        // calculate the forces
218        
219 <      myFF->doForces();
219 >      myFF->doForces(calcPot);
220        
221        // finish the constrain move ( same as above. )
222  
# Line 255 | Line 258 | void Verlet::integrate( void ){
258          if( !(time % vel_n) ) tStats->velocitize();
259        }
260        if( !(time % sample_n) ) dump_out->writeDump( time * dt );
261 <      if( !(time % status_n) ) e_out->writeStat( time * dt );
261 >      if( !((time+1) % status_n) ) calcPot = 1;
262 >      if( !(time % status_n) ){ e_out->writeStat( time * dt ); calcPot = 0; }
263      }
264    }
265    else{
# Line 265 | Line 269 | void Verlet::integrate( void ){
269        
270        // calculate the forces
271        
272 <      myFF->doForces();
272 >      myFF->doForces(calcPot);
273              
274        // complete the verlet move
275        
# Line 276 | Line 280 | void Verlet::integrate( void ){
280        if( entry_plug->setTemp ){
281          if( !(time % vel_n) ) tStats->velocitize();
282        }
283 <      if( !(time % sample_n) ) dump_out->writeDump( time * dt );
284 <      if( !(time % status_n) ) e_out->writeStat( time * dt );
283 >      if( !(time % sample_n) )  dump_out->writeDump( time * dt );
284 >      if( !((time+1) % status_n) ) calcPot = 1;
285 >      if( !(time % status_n) ){ e_out->writeStat( time * dt ); calcPot = 0; }
286      }
287    }
288    

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines