--- trunk/src/brains/SimInfo.cpp 2005/05/30 14:01:52 555 +++ trunk/src/brains/SimInfo.cpp 2005/08/30 18:23:50 580 @@ -462,7 +462,8 @@ namespace oopse { //setup fortran force field /** @deprecate */ int isError = 0; - initFortranFF( &fInfo_.SIM_uses_RF , &isError ); + initFortranFF( &fInfo_.SIM_uses_RF, &fInfo_.SIM_uses_UW, + &fInfo_.SIM_uses_DW, &isError ); if(isError){ sprintf( painCave.errMsg, "ForceField error: There was an error initializing the forceField in fortran.\n" ); @@ -519,6 +520,8 @@ namespace oopse { //usePBC and useRF are from simParams int usePBC = simParams_->getPBC(); int useRF = simParams_->getUseRF(); + int useUW = simParams_->getUseUndampedWolf(); + int useDW = simParams_->getUseDampedWolf(); //loop over all of the atom types for (i = atomTypes.begin(); i != atomTypes.end(); ++i) { @@ -583,6 +586,12 @@ namespace oopse { temp = useRF; MPI_Allreduce(&temp, &useRF, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD); + + temp = useUW; + MPI_Allreduce(&temp, &useUW, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD); + + temp = useDW; + MPI_Allreduce(&temp, &useDW, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD); #endif @@ -599,6 +608,8 @@ namespace oopse { fInfo_.SIM_uses_Shapes = useShape; fInfo_.SIM_uses_FLARB = useFLARB; fInfo_.SIM_uses_RF = useRF; + fInfo_.SIM_uses_UW = useUW; + fInfo_.SIM_uses_DW = useDW; if( fInfo_.SIM_uses_Dipoles && fInfo_.SIM_uses_RF) { @@ -981,6 +992,11 @@ namespace oopse { /* Return intertia tensor for entire system and angular momentum Vector. + + + [ Ixx -Ixy -Ixz ] + J =| -Iyx Iyy -Iyz | + [ -Izx -Iyz Izz ] */ void SimInfo::getInertiaTensor(Mat3x3d &inertiaTensor, Vector3d &angularMomentum){ @@ -1032,7 +1048,7 @@ namespace oopse { inertiaTensor(0,1) = -xy; inertiaTensor(0,2) = -xz; inertiaTensor(1,0) = -xy; - inertiaTensor(2,0) = xx + zz; + inertiaTensor(1,1) = xx + zz; inertiaTensor(1,2) = -yz; inertiaTensor(2,0) = -xz; inertiaTensor(2,1) = -yz; @@ -1060,17 +1076,18 @@ namespace oopse { SimInfo::MoleculeIterator i; Molecule* mol; - Vector3d thisq(0.0); - Vector3d thisv(0.0); + Vector3d thisr(0.0); + Vector3d thisp(0.0); - double thisMass = 0.0; + double thisMass; for (mol = beginMolecule(i); mol != NULL; mol = nextMolecule(i)) { - thisq = mol->getCom()-com; - thisv = mol->getComVel()-comVel; - thisMass = mol->getMass(); - angularMomentum += cross( thisq, thisv ) * thisMass; + thisMass = mol->getMass(); + thisr = mol->getCom()-com; + thisp = (mol->getComVel()-comVel)*thisMass; + angularMomentum += cross( thisr, thisp ); + } #ifdef IS_MPI