--- trunk/OOPSE/libmdtools/SimInfo.cpp 2004/05/11 20:33:41 1157 +++ trunk/OOPSE/libmdtools/SimInfo.cpp 2004/06/01 17:15:43 1212 @@ -62,7 +62,9 @@ SimInfo::SimInfo(){ useReactionField = 0; useGB = 0; useEAM = 0; - + useSolidThermInt = 0; + useLiquidThermInt = 0; + haveCutoffGroups = false; excludes = Exclude::Instance(); @@ -444,7 +446,7 @@ void SimInfo::refreshSim(){ excl = excludes->getFortranArray(); #ifdef IS_MPI - n_global = mpiSim->getTotAtoms(); + n_global = mpiSim->getNAtomsGlobal(); #else n_global = n_atoms; #endif @@ -453,8 +455,8 @@ void SimInfo::refreshSim(){ getFortranGroupArray(this, mfact, ngroup, groupList, groupStart); //it may not be a good idea to pass the address of first element in vector - //since c++ standard does not require vector to be stored continously in meomory - //Most of the compilers will organize the memory of vector continously + //since c++ standard does not require vector to be stored continuously in meomory + //Most of the compilers will organize the memory of vector continuously setFsimulation( &fInfo, &n_global, &n_atoms, identArray, &n_exclude, excl, &nGlobalExcludes, globalExcludes, molMembershipArray, &mfact[0], &ngroup, &groupList[0], &groupStart[0], &isError); @@ -579,6 +581,7 @@ void getFortranGroupArray(SimInfo* info, vector::iterator iterAtom; int atomIndex; + double totalMass; mfact.clear(); groupList.clear(); @@ -590,42 +593,30 @@ void getFortranGroupArray(SimInfo* info, vectormolecules; numMol = info->n_mol; for(int i = 0; i < numMol; i++){ - numAtom = myMols[i].getNAtoms(); - myAtoms = myMols[i].getMyAtoms(); - - - for(int j = 0; j < numAtom; j++){ - - -#ifdef IS_MPI - atomIndex = myAtoms[j]->getGlobalIndex(); -#else - atomIndex = myAtoms[j]->getIndex(); -#endif - - if(myMols[i].belongToCutoffGroup(atomIndex)) - continue; - else{ - mfact.push_back(myAtoms[j]->getMass()); - groupList.push_back(myAtoms[j]->getIndex() + 1); - groupStart.push_back(curIndex++); - } - } - numCutoffGroups = myMols[i].getNCutoffGroups(); for(myCutoffGroup =myMols[i].beginCutoffGroup(iterCutoff); myCutoffGroup != NULL; myCutoffGroup =myMols[i].nextCutoffGroup(iterCutoff)){ + + totalMass = myCutoffGroup->getMass(); for(cutoffAtom = myCutoffGroup->beginAtom(iterAtom); cutoffAtom != NULL; - cutoffAtom = myCutoffGroup->beginAtom(iterAtom)){ + cutoffAtom = myCutoffGroup->nextAtom(iterAtom)){ + mfact.push_back(cutoffAtom->getMass()/totalMass); +#ifdef IS_MPI + groupList.push_back(cutoffAtom->getGlobalIndex() + 1); +#else groupList.push_back(cutoffAtom->getIndex() + 1); +#endif } groupStart.push_back(curIndex); curIndex += myCutoffGroup->getNumAtom(); - } - - } + }//end for(myCutoffGroup =myMols[i].beginCutoffGroup(iterCutoff)) + + }//end for(int i = 0; i < numMol; i++) + + + //The last cutoff group need more element to indicate the end of the cutoff ngroup = groupStart.size(); }