# | Line 4 | Line 4 | |
---|---|---|
4 | #include "Integrator.hpp" | |
5 | #include "Thermo.hpp" | |
6 | #include "ReadWrite.hpp" | |
7 | + | #include "simError.h" |
8 | ||
8 | – | |
9 | extern "C"{ | |
10 | ||
11 | void v_constrain_a_( double &dt, int &n_atoms, double* mass, | |
# | 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 146 | Line 147 | void Symplectic::integrate( void ){ | |
147 | StatWriter* e_out = new StatWriter( entry_plug ); | |
148 | DumpWriter* dump_out = new DumpWriter( entry_plug ); | |
149 | ||
149 | – | |
150 | Atom** atoms = entry_plug->atoms; | |
151 | DirectionalAtom* dAtom; | |
152 | dt2 = 0.5 * dt; | |
# | Line 170 | Line 170 | void Symplectic::integrate( void ){ | |
170 | tStats->velocitize(); | |
171 | } | |
172 | ||
173 | + | dump_out->writeDump( 0.0 ); |
174 | + | e_out->writeStat( 0.0 ); |
175 | + | |
176 | if( n_constrained ){ | |
177 | ||
178 | double *Rx = new double[nAtoms]; | |
# | Line 358 | Line 361 | void Symplectic::integrate( void ){ | |
361 | dAtom->setJz( ji[2] ); | |
362 | } | |
363 | } | |
364 | < | |
364 | > | |
365 | > | time = tl + 1; |
366 | > | |
367 | if( entry_plug->setTemp ){ | |
368 | < | if( !(tl % vel_n) ) tStats->velocitize(); |
368 | > | if( !(time % vel_n) ) tStats->velocitize(); |
369 | } | |
370 | < | if( !(tl % sample_n) ) dump_out->writeDump( tl * dt ); |
371 | < | if( !(tl % status_n) ) e_out->writeStat( tl * dt ); |
370 | > | if( !(time % sample_n) ) dump_out->writeDump( time * dt ); |
371 | > | if( !(time % status_n) ) e_out->writeStat( time * dt ); |
372 | } | |
373 | } | |
374 | else{ | |
# | Line 486 | Line 491 | void Symplectic::integrate( void ){ | |
491 | atoms[i]->set_vy( vy ); | |
492 | atoms[i]->set_vz( vz ); | |
493 | ||
494 | < | vx2 = vx * vx; |
495 | < | vy2 = vy * vy; |
496 | < | vz2 = vz * vz; |
494 | > | // vx2 = vx * vx; |
495 | > | // vy2 = vy * vy; |
496 | > | // vz2 = vz * vz; |
497 | ||
498 | if( atoms[i]->isDirectional() ){ | |
499 | ||
# | Line 521 | Line 526 | void Symplectic::integrate( void ){ | |
526 | dAtom->setJz( ji[2] ); | |
527 | } | |
528 | } | |
529 | < | |
529 | > | |
530 | > | time = tl + 1; |
531 | > | |
532 | if( entry_plug->setTemp ){ | |
533 | < | if( !(tl % vel_n) ) tStats->velocitize(); |
533 | > | if( !(time % vel_n) ) tStats->velocitize(); |
534 | } | |
535 | < | if( !(tl % sample_n) ) dump_out->writeDump( tl * dt ); |
536 | < | if( !(tl % status_n) ) e_out->writeStat( tl * dt ); |
535 | > | if( !(time % sample_n) ) dump_out->writeDump( time * dt ); |
536 | > | if( !(time % status_n) ) e_out->writeStat( time * dt ); |
537 | } | |
538 | } | |
539 |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |