--- trunk/OOPSE/libmdtools/SimInfo.cpp 2003/09/15 16:52:02 763 +++ trunk/OOPSE/libmdtools/SimInfo.cpp 2003/09/16 20:02:11 767 @@ -385,7 +385,23 @@ int SimInfo::getNDFraw() { return ndfRaw; } - + +int SimInfo::getNDFtranslational() { + int ndfTrans_local, ndfTrans; + + ndfTrans_local = 3 * n_atoms - n_constraints; + +#ifdef IS_MPI + MPI_Allreduce(&ndfTrans_local,&ndfTrans,1,MPI_INT,MPI_SUM, MPI_COMM_WORLD); +#else + ndfTrans = ndfTrans_local; +#endif + + ndfTrans = ndfTrans - 3 - nZconstraints; + + return ndfTrans; +} + void SimInfo::refreshSim(){ simtype fInfo; @@ -441,7 +457,7 @@ void SimInfo::refreshSim(){ this->ndf = this->getNDF(); this->ndfRaw = this->getNDFraw(); - + this->ndfTrans = this->getNDFtranslational(); } @@ -500,7 +516,7 @@ void SimInfo::checkCutOffs( void ){ if( maxCutoff > ecr ){ if( ecr < origEcr ){ - rCut = origEcr; + ecr = origEcr; if (ecr > maxCutoff) ecr = maxCutoff; sprintf( painCave.errMsg, @@ -533,23 +549,29 @@ void SimInfo::checkCutOffs( void ){ ecr = maxCutoff; } - - } - - - if( (oldEcr != ecr) || ( oldRcut != rCut ) ) cutChanged = 1; + + if( (oldEcr != ecr) || ( oldRcut != rCut ) ) cutChanged = 1; - // rlist is the 1.0 plus max( rcut, ecr ) - - ( rCut > ecr )? rList = rCut + 1.0: rList = ecr + 1.0; - - if( cutChanged ){ + // rlist is the 1.0 plus max( rcut, ecr ) - notifyFortranCutOffs( &rCut, &rList, &ecr, &est ); + ( rCut > ecr )? rList = rCut + 1.0: rList = ecr + 1.0; + + if( cutChanged ){ + + notifyFortranCutOffs( &rCut, &rList, &ecr, &est ); + } + + oldEcr = ecr; + oldRcut = rCut; + + } else { + // initialize this stuff before using it, OK? + sprintf( painCave.errMsg, + "Trying to check cutoffs without a box. Be smarter.\n" ); + painCave.isFatal = 1; + simError(); } - oldEcr = ecr; - oldRcut = rCut; } void SimInfo::addProperty(GenericData* prop){