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 736 by tim, Thu Aug 28 21:09:47 2003 UTC

# Line 58 | Line 58 | template<typename T> ZConstraint<T>::ZConstraint(SimIn
58        else{
59          sprintf( painCave.errMsg,
60                    "ZConstraint Warning: unknown force substraction policy, "
61 <                  "average force substraction policy is used\n");
61 >                  "PolicyByMass is used\n");
62          painCave.isFatal = 0;
63          simError();      
64 +        forcePolicy = (ForceSubstractionPolicy*) new PolicyByMass(this);
65        }  
66      }
67    }
# Line 249 | Line 250 | template<typename T> ZConstraint<T>::ZConstraint(SimIn
250            (*parameters)[i].zPos = COM[whichDirection];
251  
252            sprintf( painCave.errMsg,
253 <                     "ZConstraint warningr: Does not specify zpos for z-constraint molecule "
253 >                     "ZConstraint warning: Does not specify zpos for z-constraint molecule "
254                       "initial z coornidate will be used \n");
255             painCave.isFatal = 0;
256             simError();  
# Line 578 | Line 579 | template<typename T> void ZConstraint<T>::calcForce(in
579    //do zconstraint force;
580    if (haveFixedZMols())
581      this->doZconstraintForce();
582 <    
582 >
583    //use harmonical poteintial to move the molecules to the specified positions
584    if (haveMovingZMols())
585      this->doHarmonic();
# Line 612 | Line 613 | template<typename T> void ZConstraint<T>::calcForce(in
613   #ifdef IS_MPI
614    }
615   #endif
615
616   }
617  
618  
# Line 802 | Line 802 | template<typename T> void ZConstraint<T>::doZconstrain
802    double COM[3];
803    double force[3];
804  
805
806
805    //constrain the molecules which do not reach the specified positions  
806      
807    //Zero Out the force of z-contrained molecules    
# Line 866 | Line 864 | template<typename T> void ZConstraint<T>::doZconstrain
864  
865   //   cout << "after zero out z-constraint force on fixed z-constraint molecuels "
866   //        << "total force is " << calcTotalForce() << endl;
869
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
867  
868    force[0]= 0;
869    force[1]= 0;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines