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

Comparing trunk/mdtools/md_code/Symplectic.cpp (file contents):
Revision 11 by mmeineke, Tue Jul 9 18:40:59 2002 UTC vs.
Revision 238 by mmeineke, Fri Jan 17 21:53:36 2003 UTC

# Line 4 | Line 4
4   #include "Integrator.hpp"
5   #include "Thermo.hpp"
6   #include "ReadWrite.hpp"
7 + #include "ForceField.hpp"
8 + #include "simError.h"
9  
8
10   extern "C"{
11    
12    void v_constrain_a_( double &dt, int &n_atoms, double* mass,
# Line 34 | Line 35 | Symplectic::Symplectic( SimInfo* the_entry_plug ){
35    isFirst = 1;
36  
37    srInteractions = entry_plug->sr_interactions;
37  longRange      =       entry_plug->longRange;
38    nSRI           =           entry_plug->n_SRI;
39  
40    // give a little love back to the SimInfo object
# Line 120 | Line 120 | void Symplectic::integrate( void ){
120    double dt2;                       // half the dt
121  
122    double vx, vy, vz;    // the velocities
123 <  double vx2, vy2, vz2; // the square of the velocities
123 > //  double vx2, vy2, vz2; // the square of the velocities
124    double rx, ry, rz;    // the postitions
125    
126    double ji[3];   // the body frame angular momentum
# Line 129 | Line 129 | void Symplectic::integrate( void ){
129    double angle;   // the angle through which to rotate the rotation matrix
130    double A[3][3]; // the rotation matrix
131  
132 +  int time;
133  
134    double dt          = entry_plug->dt;
135    double runTime     = entry_plug->run_time;
# Line 141 | Line 142 | void Symplectic::integrate( void ){
142    int status_n = (int)( statusTime / dt );
143    int vel_n    = (int)( thermalTime / dt );
144  
145 +  ForceFields *ff = entry_plug->
146 +
147    Thermo *tStats = new Thermo( entry_plug );
148  
149    StatWriter*  e_out    = new StatWriter( entry_plug );
150    DumpWriter*  dump_out = new DumpWriter( entry_plug );
151  
149
152    Atom** atoms = entry_plug->atoms;
153    DirectionalAtom* dAtom;
154    dt2 = 0.5 * dt;
# Line 154 | Line 156 | void Symplectic::integrate( void ){
156    // initialize the forces the before the first step
157  
158    
159 +  
160    for(i = 0; i < nAtoms; i++){
161      atoms[i]->zeroForces();
162    }
# Line 170 | Line 173 | void Symplectic::integrate( void ){
173      tStats->velocitize();
174    }
175    
176 +  dump_out->writeDump( 0.0 );
177 +  e_out->writeStat( 0.0 );
178 +
179    if( n_constrained ){
180  
181      double *Rx = new double[nAtoms];
# Line 358 | Line 364 | void Symplectic::integrate( void ){
364            dAtom->setJz( ji[2] );
365          }
366        }
367 <    
367 >    
368 >      time = tl + 1;
369 >      
370        if( entry_plug->setTemp ){
371 <        if( !(tl % vel_n) ) tStats->velocitize();
371 >        if( !(time % vel_n) ) tStats->velocitize();
372        }
373 <      if( !(tl % sample_n) ) dump_out->writeDump( tl * dt );
374 <      if( !(tl % status_n) ) e_out->writeStat( tl * dt );
373 >      if( !(time % sample_n) ) dump_out->writeDump( time * dt );
374 >      if( !(time % status_n) ) e_out->writeStat( time * dt );
375      }
376    }
377    else{
# Line 486 | Line 494 | void Symplectic::integrate( void ){
494          atoms[i]->set_vy( vy );
495          atoms[i]->set_vz( vz );
496          
497 <        vx2 = vx * vx;
498 <        vy2 = vy * vy;
499 <        vz2 = vz * vz;
497 > //      vx2 = vx * vx;
498 > //      vy2 = vy * vy;
499 > //      vz2 = vz * vz;
500          
501          if( atoms[i]->isDirectional() ){
502  
# Line 521 | Line 529 | void Symplectic::integrate( void ){
529            dAtom->setJz( ji[2] );
530          }
531        }
532 <    
532 >      
533 >      time = tl + 1;
534 >      
535        if( entry_plug->setTemp ){
536 <        if( !(tl % vel_n) ) tStats->velocitize();
536 >        if( !(time % vel_n) ) tStats->velocitize();
537        }
538 <      if( !(tl % sample_n) ) dump_out->writeDump( tl * dt );
539 <      if( !(tl % status_n) ) e_out->writeStat( tl * dt );
538 >      if( !(time % sample_n) ) dump_out->writeDump( time * dt );
539 >      if( !(time % status_n) ) e_out->writeStat( time * dt );
540      }
541    }
542  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines