ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/libmdtools/ZConstraint.cpp
(Generate patch)

Comparing trunk/OOPSE/libmdtools/ZConstraint.cpp (file contents):
Revision 702 by tim, Wed Aug 20 14:50:32 2003 UTC vs.
Revision 711 by mmeineke, Fri Aug 22 20:04:39 2003 UTC

# Line 509 | Line 509 | template<typename T> void ZConstraint<T>::integrate(){
509    //zero out the velocities of center of mass of unconstrained molecules
510    //and the velocities of center of mass of every single z-constrained molecueles
511    zeroOutVel();
512 +
513 +  curZconsTime = zconsTime + info->getTime();
514    
515    T::integrate();
516  
# Line 530 | Line 532 | template<typename T> void ZConstraint<T>::calcForce(in
532    T::calcForce(calcPot, calcStress);
533  
534    if (checkZConsState()){
535 +    
536 + #ifdef IS_MPI
537 +    if(worldRank == 0){
538 + #endif
539 +      std::cerr << "\n"
540 +                << "*******************************************\n"
541 +                << " about to call zeroOutVel()\n"
542 +                << "*******************************************\n"
543 +                << "\n";
544 + #ifdef IS_MPI
545 +    }
546 + #endif
547      zeroOutVel();
548 <   forcePolicy->update();
548 >
549 > #ifdef IS_MPI
550 >    if(worldRank == 0){
551 > #endif
552 >      std::cerr << "\n"
553 >                << "*******************************************\n"
554 >                << " finished zeroOutVel()\n"
555 >                << "*******************************************\n"
556 >                << "\n";
557 > #ifdef IS_MPI
558 >    }
559 > #endif
560 >    
561 >    forcePolicy->update();
562    }  
563 <
563 >  
564    zsys = calcZSys();
565    zSysCOMVel = calcSysCOMVel();
566   #ifdef IS_MPI
# Line 798 | Line 825 | template<typename T> void ZConstraint<T>::doZconstrain
825        }
826        totalFZ_local += fz[i];
827  
828 <      cout << "Fixed Molecule\tindex: " << indexOfZConsMols[i]
829 <             <<"\tcurrent zpos: " << COM[whichDirection]
830 <             << "\tcurrent fz: " <<fz[i] << endl;
828 > //       cout << "Fixed Molecule\tindex: " << indexOfZConsMols[i]
829 > //              <<"\tcurrent zpos: " << COM[whichDirection]
830 > //              << "\tcurrent fz: " <<fz[i] << endl;
831  
832      }
833      
# Line 836 | Line 863 | template<typename T> void ZConstraint<T>::doZconstrain
863    
864    }
865  
866 <  //cout << "after zero out z-constraint force on fixed z-constraint molecuels "
867 <  //       << "total force is " << calcTotalForce() << endl;
866 > //   cout << "after zero out z-constraint force on fixed z-constraint molecuels "
867 > //        << "total force is " << calcTotalForce() << endl;
868  
869    //calculate the number of atoms of moving z-constrained molecules
870    int nMovingZAtoms_local;
# Line 915 | Line 942 | template<typename T> void ZConstraint<T>::doHarmonic()
942  
943      if (states[i] == zcsMoving){
944        zconsMols[i]->getCOM(COM);
945 <      cout << "Moving Molecule\tindex: " << indexOfZConsMols[i] <<"\tcurrent zpos: " << COM[whichDirection] << endl;
945 >      cout << "Moving Molecule\tindex: " << indexOfZConsMols[i]
946 >           << "\tcurrent zpos: " << COM[whichDirection] << endl;
947      
948      diff = COM[whichDirection] -zPos[i];
949      
# Line 995 | Line 1023 | template<typename T> bool ZConstraint<T>::checkZConsSt
1023   #else
1024    MPI_Allreduce(&changed_local, &changed, 1, MPI_INT,MPI_SUM, MPI_COMM_WORLD);
1025   #endif
1026 <
1027 <  return changed > 0 ? true : false;
1026 >  
1027 >  return (changed > 0);
1028   }
1029  
1030   template<typename T> bool ZConstraint<T>::haveFixedZMols(){
# Line 1175 | Line 1203 | template<typename T> void ZConstraint<T>::PolicyByNumb
1203    nMovingZAtoms = nMovingZAtoms_local;
1204   #endif
1205    totNumOfMovingAtoms = nMovingZAtoms + zconsIntegrator->totNumOfUnconsAtoms;
1206 +
1207 + #ifdef IS_MPI
1208 +  if(worldRank == 0){
1209 + #endif
1210 +    std::cerr << "\n"
1211 +              << "*******************************************\n"
1212 +              << " fiished Policy by numbr()\n"
1213 +              << "*******************************************\n"
1214 +              << "\n";
1215 + #ifdef IS_MPI
1216 +  }
1217 + #endif
1218   }
1219  
1220   template<typename T>double ZConstraint<T>::PolicyByNumber::getZFOfFixedZMols(Molecule* mol, Atom* atom, double totalForce){

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines