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 726 by tim, Tue Aug 26 20:37:30 2003 UTC vs.
Revision 733 by tim, Wed Aug 27 19:23:29 2003 UTC

# Line 578 | Line 578 | template<typename T> void ZConstraint<T>::calcForce(in
578    //do zconstraint force;
579    if (haveFixedZMols())
580      this->doZconstraintForce();
581 <    
581 >
582    //use harmonical poteintial to move the molecules to the specified positions
583    if (haveMovingZMols())
584      this->doHarmonic();
# Line 612 | Line 612 | template<typename T> void ZConstraint<T>::calcForce(in
612   #ifdef IS_MPI
613    }
614   #endif
615
615   }
616  
617  
# Line 801 | Line 800 | template<typename T> void ZConstraint<T>::doZconstrain
800    double COMvel[3];  
801    double COM[3];
802    double force[3];
804
805
803  
804    //constrain the molecules which do not reach the specified positions  
805      
# Line 867 | Line 864 | template<typename T> void ZConstraint<T>::doZconstrain
864   //   cout << "after zero out z-constraint force on fixed z-constraint molecuels "
865   //        << "total force is " << calcTotalForce() << endl;
866  
870  //calculate the number of atoms of moving z-constrained molecules
871  int nMovingZAtoms_local;
872  int nMovingZAtoms;
873  
874  nMovingZAtoms_local = 0;
875  for(int i = 0; i < zconsMols.size(); i++)
876    if(states[i] == zcsMoving)
877     nMovingZAtoms_local += zconsMols[i]->getNAtoms();
878  
879 #ifdef IS_MPI
880  MPI_Allreduce(&nMovingZAtoms_local, &nMovingZAtoms, 1,
881                      MPI_DOUBLE,MPI_SUM, MPI_COMM_WORLD);
882 #else
883  nMovingZAtoms = nMovingZAtoms_local;
884 #endif
885
867    force[0]= 0;
868    force[1]= 0;
869    force[2]= 0;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines