--- trunk/OOPSE/libmdtools/SimInfo.cpp 2004/04/12 20:32:20 1097 +++ trunk/OOPSE/libmdtools/SimInfo.cpp 2004/04/22 21:33:55 1131 @@ -322,10 +322,16 @@ int SimInfo::getNDF(){ int SimInfo::getNDF(){ int ndf_local; + ndf_local = 0; + for(int i = 0; i < integrableObjects.size(); i++){ ndf_local += 3; - if (integrableObjects[i]->isDirectional()) - ndf_local += 3; + if (integrableObjects[i]->isDirectional()) { + if (integrableObjects[i]->isLinear()) + ndf_local += 2; + else + ndf_local += 3; + } } // n_constraints is local, so subtract them on each processor: @@ -350,11 +356,16 @@ int SimInfo::getNDFraw() { int ndfRaw_local; // Raw degrees of freedom that we have to set + ndfRaw_local = 0; for(int i = 0; i < integrableObjects.size(); i++){ ndfRaw_local += 3; - if (integrableObjects[i]->isDirectional()) - ndfRaw_local += 3; + if (integrableObjects[i]->isDirectional()) { + if (integrableObjects[i]->isLinear()) + ndfRaw_local += 2; + else + ndfRaw_local += 3; + } } #ifdef IS_MPI @@ -381,6 +392,23 @@ int SimInfo::getNDFtranslational() { ndfTrans = ndfTrans - 3 - nZconstraints; return ndfTrans; +} + +int SimInfo::getTotIntegrableObjects() { + int nObjs_local; + int nObjs; + + nObjs_local = integrableObjects.size(); + + +#ifdef IS_MPI + MPI_Allreduce(&nObjs_local,&nObjs,1,MPI_INT,MPI_SUM, MPI_COMM_WORLD); +#else + nObjs = nObjs_local; +#endif + + + return nObjs; } void SimInfo::refreshSim(){ @@ -482,11 +510,11 @@ void SimInfo::checkCutOffs( void ){ "\tCurrent Value of LJrcut = %G at time %G\n " "\tThis is larger than half of at least one of the\n" "\tperiodic box vectors. Right now, the Box matrix is:\n" - "\n, %G" + "\n" "\t[ %G %G %G ]\n" "\t[ %G %G %G ]\n" "\t[ %G %G %G ]\n", - rCut, currentTime, maxCutoff, + rCut, currentTime, Hmat[0][0], Hmat[0][1], Hmat[0][2], Hmat[1][0], Hmat[1][1], Hmat[1][2], Hmat[2][0], Hmat[2][1], Hmat[2][2]); @@ -561,13 +589,3 @@ GenericData* SimInfo::getProperty(const string& propNa return NULL; } -vector SimInfo::getProperties(){ - - vector result; - map::iterator i; - - for(i = properties.begin(); i != properties.end(); i++) - result.push_back((*i).second); - - return result; -}