--- trunk/OOPSE/libmdtools/ZConstraint.cpp 2003/08/20 14:50:32 702 +++ trunk/OOPSE/libmdtools/ZConstraint.cpp 2003/08/22 20:04:39 711 @@ -509,6 +509,8 @@ template void ZConstraint::integrate(){ //zero out the velocities of center of mass of unconstrained molecules //and the velocities of center of mass of every single z-constrained molecueles zeroOutVel(); + + curZconsTime = zconsTime + info->getTime(); T::integrate(); @@ -530,10 +532,35 @@ template void ZConstraint::calcForce(in T::calcForce(calcPot, calcStress); if (checkZConsState()){ + +#ifdef IS_MPI + if(worldRank == 0){ +#endif + std::cerr << "\n" + << "*******************************************\n" + << " about to call zeroOutVel()\n" + << "*******************************************\n" + << "\n"; +#ifdef IS_MPI + } +#endif zeroOutVel(); - forcePolicy->update(); + +#ifdef IS_MPI + if(worldRank == 0){ +#endif + std::cerr << "\n" + << "*******************************************\n" + << " finished zeroOutVel()\n" + << "*******************************************\n" + << "\n"; +#ifdef IS_MPI + } +#endif + + forcePolicy->update(); } - + zsys = calcZSys(); zSysCOMVel = calcSysCOMVel(); #ifdef IS_MPI @@ -798,9 +825,9 @@ template void ZConstraint::doZconstrain } totalFZ_local += fz[i]; - cout << "Fixed Molecule\tindex: " << indexOfZConsMols[i] - <<"\tcurrent zpos: " << COM[whichDirection] - << "\tcurrent fz: " < void ZConstraint::doZconstrain } - //cout << "after zero out z-constraint force on fixed z-constraint molecuels " - // << "total force is " << calcTotalForce() << endl; +// cout << "after zero out z-constraint force on fixed z-constraint molecuels " +// << "total force is " << calcTotalForce() << endl; //calculate the number of atoms of moving z-constrained molecules int nMovingZAtoms_local; @@ -915,7 +942,8 @@ template void ZConstraint::doHarmonic() if (states[i] == zcsMoving){ zconsMols[i]->getCOM(COM); - cout << "Moving Molecule\tindex: " << indexOfZConsMols[i] <<"\tcurrent zpos: " << COM[whichDirection] << endl; + cout << "Moving Molecule\tindex: " << indexOfZConsMols[i] + << "\tcurrent zpos: " << COM[whichDirection] << endl; diff = COM[whichDirection] -zPos[i]; @@ -995,8 +1023,8 @@ template bool ZConstraint::checkZConsSt #else MPI_Allreduce(&changed_local, &changed, 1, MPI_INT,MPI_SUM, MPI_COMM_WORLD); #endif - - return changed > 0 ? true : false; + + return (changed > 0); } template bool ZConstraint::haveFixedZMols(){ @@ -1175,6 +1203,18 @@ template void ZConstraint::PolicyByNumb nMovingZAtoms = nMovingZAtoms_local; #endif totNumOfMovingAtoms = nMovingZAtoms + zconsIntegrator->totNumOfUnconsAtoms; + +#ifdef IS_MPI + if(worldRank == 0){ +#endif + std::cerr << "\n" + << "*******************************************\n" + << " fiished Policy by numbr()\n" + << "*******************************************\n" + << "\n"; +#ifdef IS_MPI + } +#endif } templatedouble ZConstraint::PolicyByNumber::getZFOfFixedZMols(Molecule* mol, Atom* atom, double totalForce){