ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/libmdtools/Symplectic.cpp
(Generate patch)

Comparing trunk/OOPSE/libmdtools/Symplectic.cpp (file contents):
Revision 466 by gezelter, Mon Apr 7 14:30:36 2003 UTC vs.
Revision 469 by mmeineke, Mon Apr 7 20:06:31 2003 UTC

# Line 38 | Line 38 | Symplectic::Symplectic( SimInfo* the_entry_plug, Force
38    myES = the_es;
39    isFirst = 1;
40  
41 +  std::cerr<< "calling symplectic constructor\n";
42 +
43    molecules = entry_plug->molecules;
44    nMols = entry_plug->n_mol;
45  
# Line 184 | Line 186 | void Symplectic::integrate( void ){
186    int status_n = (int)( statusTime / dt );
187    int vel_n    = (int)( thermalTime / dt );
188  
189 <  int calcPot;
189 >  int calcPot, calcStress;
190  
191 <   Thermo *tStats = new Thermo( entry_plug );
191 >  Thermo *tStats;
192 >  StatWriter*  e_out;
193 >  DumpWriter*  dump_out;
194  
195 <  StatWriter*  e_out    = new StatWriter( entry_plug );
192 <  DumpWriter*  dump_out = new DumpWriter( entry_plug );
195 >  std::cerr << "about to call new thermo\n";
196  
197 +  tStats   = new Thermo( entry_plug );
198 +  e_out    = new StatWriter( entry_plug );
199 +
200 +  std::cerr << "calling dumpWriter \n";
201 +  dump_out = new DumpWriter( entry_plug );
202 +  std::cerr << "called dumpWriter \n";
203 +
204    Atom** atoms = entry_plug->atoms;
205    DirectionalAtom* dAtom;
206    dt2 = 0.5 * dt;
207  
208    // initialize the forces the before the first step
209  
210 <  myFF->doForces(1,0);
210 >  myFF->doForces(1,1);
211    
212    if( entry_plug->setTemp ){
213      
# Line 325 | Line 335 | void Symplectic::integrate( void ){
335        
336        // calculate the forces
337        
338 <      myFF->doForces(calcPot, 0);
338 >      myFF->doForces(calcPot, calcStress);
339        
340        // move b
341  
# Line 396 | Line 406 | void Symplectic::integrate( void ){
406          if( !(time % vel_n) ) tStats->velocitize();
407        }
408        if( !(time % sample_n) ) dump_out->writeDump( time * dt );
409 <      if( !((time+1) % status_n) ) calcPot = 1;
410 <      if( !(time % status_n) ){ e_out->writeStat( time * dt ); calcPot = 0; }
409 >      if( !((time+1) % status_n) ) {
410 >        calcPot = 1;
411 >        calcStress = 1;
412 >      }
413 >      if( !(time % status_n) ){
414 >        e_out->writeStat( time * dt );
415 >        calcPot = 0;
416 >        calcStress = 0;
417 >      }
418      }
419    }
420    else{
# Line 495 | Line 512 | void Symplectic::integrate( void ){
512        
513        // calculate the forces
514        
515 <      myFF->doForces(calcPot,0);
515 >      myFF->doForces(calcPot,calcStress);
516        
517        for( i=0; i< nAtoms; i++ ){
518          
# Line 554 | Line 571 | void Symplectic::integrate( void ){
571          if( !(time % vel_n) ) tStats->velocitize();
572        }
573        if( !(time % sample_n) ) dump_out->writeDump( time * dt );
574 <      if( !((time+1) % status_n) ) calcPot = 1;
575 <      if( !(time % status_n) ){ e_out->writeStat( time * dt ); calcPot = 0; }
574 >      if( !((time+1) % status_n) ) {
575 >        calcPot = 1;
576 >        calcStress = 1;
577 >      }
578 >      if( !(time % status_n) ){
579 >        e_out->writeStat( time * dt );
580 >        calcPot = 0;
581 >        calcStress = 0;
582 >      }      
583      }
584    }
585  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines