--- trunk/OOPSE/libmdtools/SimInfo.cpp 2004/04/12 20:32:20 1097 +++ trunk/OOPSE/libmdtools/SimInfo.cpp 2004/04/15 16:18:26 1113 @@ -322,6 +322,8 @@ 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()) @@ -350,6 +352,7 @@ 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; @@ -381,6 +384,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(){