--- trunk/OOPSE/libmdtools/Integrator.cpp 2003/07/14 23:06:09 601 +++ trunk/OOPSE/libmdtools/Integrator.cpp 2003/07/22 19:54:52 645 @@ -11,7 +11,7 @@ Integrator::Integrator( SimInfo *theInfo, ForceFields* #include "simError.h" -Integrator::Integrator( SimInfo *theInfo, ForceFields* the_ff ){ +template Integrator::Integrator( SimInfo *theInfo, ForceFields* the_ff ) { info = theInfo; myFF = the_ff; @@ -41,7 +41,7 @@ Integrator::~Integrator() { checkConstraints(); } -Integrator::~Integrator() { +template Integrator::~Integrator() { if( nConstrained ){ delete[] constrainedA; @@ -54,7 +54,7 @@ void Integrator::checkConstraints( void ){ } -void Integrator::checkConstraints( void ){ +template void Integrator::checkConstraints( void ){ isConstrained = 0; @@ -73,12 +73,7 @@ void Integrator::checkConstraints( void ){ constrained = theArray[j]->is_constrained(); - std::cerr << "Is the folowing bond constrained \n"; - theArray[j]->printMe(); - if(constrained){ - - std::cerr << "Yes\n"; dummy_plug = theArray[j]->get_constraint(); temp_con[nConstrained].set_a( dummy_plug->get_a() ); @@ -88,7 +83,6 @@ void Integrator::checkConstraints( void ){ nConstrained++; constrained = 0; } - else std::cerr << "No.\n"; } theArray = (SRI**) molecules[i].getMyBends(); @@ -161,7 +155,7 @@ void Integrator::integrate( void ){ } -void Integrator::integrate( void ){ +template void Integrator::integrate( void ){ int i, j; // loop counters @@ -173,7 +167,6 @@ void Integrator::integrate( void ){ double currSample; double currThermal; double currStatus; - double currTime; int calcPot, calcStress; int isError; @@ -197,16 +190,14 @@ void Integrator::integrate( void ){ tStats->velocitize(); } - dumpOut->writeDump( 0.0 ); - statOut->writeStat( 0.0 ); - calcPot = 0; calcStress = 0; currSample = sampleTime; currThermal = thermalTime; currStatus = statusTime; - currTime = 0.0;; + dumpOut->writeDump( info->getTime() ); + statOut->writeStat( info->getTime() ); readyCheck(); @@ -216,31 +207,31 @@ void Integrator::integrate( void ){ MPIcheckPoint(); #endif // is_mpi - while( currTime < runTime ){ + while( info->getTime() < runTime ){ - if( (currTime+dt) >= currStatus ){ + if( (info->getTime()+dt) >= currStatus ){ calcPot = 1; calcStress = 1; } integrateStep( calcPot, calcStress ); - currTime += dt; + info->incrTime(dt); if( info->setTemp ){ - if( currTime >= currThermal ){ + if( info->getTime() >= currThermal ){ tStats->velocitize(); currThermal += thermalTime; } } - if( currTime >= currSample ){ - dumpOut->writeDump( currTime ); + if( info->getTime() >= currSample ){ + dumpOut->writeDump( info->getTime() ); currSample += sampleTime; } - if( currTime >= currStatus ){ - statOut->writeStat( currTime ); + if( info->getTime() >= currStatus ){ + statOut->writeStat( info->getTime() ); calcPot = 0; calcStress = 0; currStatus += statusTime; @@ -254,13 +245,13 @@ void Integrator::integrate( void ){ } - dumpOut->writeFinal(currTime); + dumpOut->writeFinal(info->getTime()); delete dumpOut; delete statOut; } -void Integrator::integrateStep( int calcPot, int calcStress ){ +template void Integrator::integrateStep( int calcPot, int calcStress ){ @@ -270,19 +261,38 @@ void Integrator::integrateStep( int calcPot, int calcS moveA(); if( nConstrained ) constrainA(); + +#ifdef IS_MPI + strcpy( checkPointMsg, "Succesful moveA\n" ); + MPIcheckPoint(); +#endif // is_mpi + + // calc forces myFF->doForces(calcPot,calcStress); +#ifdef IS_MPI + strcpy( checkPointMsg, "Succesful doForces\n" ); + MPIcheckPoint(); +#endif // is_mpi + + // finish the velocity half step moveB(); if( nConstrained ) constrainB(); - + +#ifdef IS_MPI + strcpy( checkPointMsg, "Succesful moveB\n" ); + MPIcheckPoint(); +#endif // is_mpi + + } -void Integrator::moveA( void ){ +template void Integrator::moveA( void ){ int i, j; DirectionalAtom* dAtom; @@ -361,7 +371,7 @@ void Integrator::moveB( void ){ } -void Integrator::moveB( void ){ +template void Integrator::moveB( void ){ int i, j; DirectionalAtom* dAtom; double Tb[3], ji[3]; @@ -403,7 +413,7 @@ void Integrator::preMove( void ){ } } -void Integrator::preMove( void ){ +template void Integrator::preMove( void ){ int i, j; double pos[3]; @@ -421,7 +431,7 @@ void Integrator::constrainA(){ } } -void Integrator::constrainA(){ +template void Integrator::constrainA(){ int i,j,k; int done; @@ -572,7 +582,7 @@ void Integrator::constrainB( void ){ } -void Integrator::constrainB( void ){ +template void Integrator::constrainB( void ){ int i,j,k; int done; @@ -681,7 +691,7 @@ void Integrator::rotate( int axes1, int axes2, double } -void Integrator::rotate( int axes1, int axes2, double angle, double ji[3], +template void Integrator::rotate( int axes1, int axes2, double angle, double ji[3], double A[3][3] ){ int i,j,k;