ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-2.0/src/brains/SimInfo.cpp
(Generate patch)

Comparing trunk/OOPSE-2.0/src/brains/SimInfo.cpp (file contents):
Revision 2252 by chuckv, Mon May 30 14:01:52 2005 UTC vs.
Revision 2279 by chrisfen, Tue Aug 30 18:23:50 2005 UTC

# Line 462 | Line 462 | namespace oopse {
462      //setup fortran force field
463      /** @deprecate */    
464      int isError = 0;
465 <    initFortranFF( &fInfo_.SIM_uses_RF , &isError );
465 >    initFortranFF( &fInfo_.SIM_uses_RF, &fInfo_.SIM_uses_UW,
466 >                   &fInfo_.SIM_uses_DW, &isError );
467      if(isError){
468        sprintf( painCave.errMsg,
469                 "ForceField error: There was an error initializing the forceField in fortran.\n" );
# Line 519 | Line 520 | namespace oopse {
520      //usePBC and useRF are from simParams
521      int usePBC = simParams_->getPBC();
522      int useRF = simParams_->getUseRF();
523 +    int useUW = simParams_->getUseUndampedWolf();
524 +    int useDW = simParams_->getUseDampedWolf();
525  
526      //loop over all of the atom types
527      for (i = atomTypes.begin(); i != atomTypes.end(); ++i) {
# Line 583 | Line 586 | namespace oopse {
586  
587      temp = useRF;
588      MPI_Allreduce(&temp, &useRF, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD);    
589 +
590 +    temp = useUW;
591 +    MPI_Allreduce(&temp, &useUW, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD);  
592 +
593 +    temp = useDW;
594 +    MPI_Allreduce(&temp, &useDW, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD);  
595      
596   #endif
597  
# Line 599 | Line 608 | namespace oopse {
608      fInfo_.SIM_uses_Shapes = useShape;
609      fInfo_.SIM_uses_FLARB = useFLARB;
610      fInfo_.SIM_uses_RF = useRF;
611 +    fInfo_.SIM_uses_UW = useUW;
612 +    fInfo_.SIM_uses_DW = useDW;
613  
614      if( fInfo_.SIM_uses_Dipoles && fInfo_.SIM_uses_RF) {
615  
# Line 981 | Line 992 | namespace oopse {
992    
993     /*
994     Return intertia tensor for entire system and angular momentum Vector.
995 +
996 +
997 +       [  Ixx -Ixy  -Ixz ]
998 +  J =| -Iyx  Iyy  -Iyz |
999 +       [ -Izx -Iyz   Izz ]
1000      */
1001  
1002     void SimInfo::getInertiaTensor(Mat3x3d &inertiaTensor, Vector3d &angularMomentum){
# Line 1032 | Line 1048 | namespace oopse {
1048        inertiaTensor(0,1) = -xy;
1049        inertiaTensor(0,2) = -xz;
1050        inertiaTensor(1,0) = -xy;
1051 <      inertiaTensor(2,0) = xx + zz;
1051 >      inertiaTensor(1,1) = xx + zz;
1052        inertiaTensor(1,2) = -yz;
1053        inertiaTensor(2,0) = -xz;
1054        inertiaTensor(2,1) = -yz;
# Line 1060 | Line 1076 | namespace oopse {
1076        SimInfo::MoleculeIterator i;
1077        Molecule* mol;
1078        
1079 <      Vector3d thisq(0.0);
1080 <      Vector3d thisv(0.0);
1079 >      Vector3d thisr(0.0);
1080 >      Vector3d thisp(0.0);
1081        
1082 <      double thisMass = 0.0;
1082 >      double thisMass;
1083        
1084        for (mol = beginMolecule(i); mol != NULL; mol = nextMolecule(i)) {        
1085 <         thisq = mol->getCom()-com;
1086 <         thisv = mol->getComVel()-comVel;
1087 <         thisMass = mol->getMass();
1072 <         angularMomentum += cross( thisq, thisv ) * thisMass;
1085 >        thisMass = mol->getMass();
1086 >        thisr = mol->getCom()-com;
1087 >        thisp = (mol->getComVel()-comVel)*thisMass;
1088          
1089 +        angularMomentum += cross( thisr, thisp );
1090 +        
1091        }  
1092        
1093   #ifdef IS_MPI

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines