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" ); |
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) { |
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 |
|
|
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 |
|
|
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){ |
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; |
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 |