--- trunk/OOPSE/libmdtools/Integrator.cpp 2003/09/22 23:07:57 781 +++ trunk/OOPSE/libmdtools/Integrator.cpp 2003/10/28 16:03:37 829 @@ -1,6 +1,6 @@ #include -#include -#include +#include +#include #ifdef IS_MPI #include "mpiSimulation.hpp" @@ -25,8 +25,7 @@ template Integrator::Integrator(SimInfo if (info->the_integrator != NULL){ delete info->the_integrator; } - info->the_integrator = this; - + nAtoms = info->n_atoms; // check for constraints @@ -147,7 +146,6 @@ template void Integrator::integrate(voi template void Integrator::integrate(void){ - int i, j; // loop counters double runTime = info->run_time; double sampleTime = info->sampleTime; @@ -162,18 +160,18 @@ template void Integrator::integrate(voi double currReset; int calcPot, calcStress; - int isError; tStats = new Thermo(info); statOut = new StatWriter(info); dumpOut = new DumpWriter(info); atoms = info->atoms; - DirectionalAtom* dAtom; dt = info->dt; dt2 = 0.5 * dt; + readyCheck(); + // initialize the forces before the first step calcForce(1, 1); @@ -199,8 +197,8 @@ template void Integrator::integrate(voi dumpOut->writeDump(info->getTime()); statOut->writeStat(info->getTime()); - readyCheck(); + #ifdef IS_MPI strcpy(checkPointMsg, "The integrator is ready to go."); MPIcheckPoint(); @@ -248,8 +246,10 @@ template void Integrator::integrate(voi #endif // is_mpi } - dumpOut->writeFinal(info->getTime()); + // write the last frame + dumpOut->writeDump(info->getTime()); + delete dumpOut; delete statOut; } @@ -404,7 +404,7 @@ template void Integrator::constrainA(){ } template void Integrator::constrainA(){ - int i, j, k; + int i, j; int done; double posA[3], posB[3]; double velA[3], velB[3]; @@ -548,7 +548,7 @@ template void Integrator::constrainB(vo } template void Integrator::constrainB(void){ - int i, j, k; + int i, j; int done; double posA[3], posB[3]; double velA[3], velB[3]; @@ -557,8 +557,7 @@ template void Integrator::constrainB(vo int a, b, ax, ay, az, bx, by, bz; double rma, rmb; double dx, dy, dz; - double rabsq, pabsq, rvab; - double diffsq; + double rvab; double gab; int iteration;