--- trunk/OOPSE/libmdtools/SimInfo.cpp 2004/05/11 20:33:41 1157 +++ trunk/OOPSE/libmdtools/SimInfo.cpp 2004/05/12 15:02:03 1164 @@ -453,8 +453,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 +579,7 @@ void getFortranGroupArray(SimInfo* info, vector::iterator iterAtom; int atomIndex; + double totalMass; mfact.clear(); groupList.clear(); @@ -606,7 +607,8 @@ void getFortranGroupArray(SimInfo* info, vectorgetMass()); + // this is a fraction of the cutoff group's mass, not the mass itself! + mfact.push_back(1.0); groupList.push_back(myAtoms[j]->getIndex() + 1); groupStart.push_back(curIndex++); } @@ -615,17 +617,21 @@ void getFortranGroupArray(SimInfo* info, vectorgetMass(); for(cutoffAtom = myCutoffGroup->beginAtom(iterAtom); cutoffAtom != NULL; - cutoffAtom = myCutoffGroup->beginAtom(iterAtom)){ + cutoffAtom = myCutoffGroup->nextAtom(iterAtom)){ + mfact.push_back(cutoffAtom->getMass()/totalMass); groupList.push_back(cutoffAtom->getIndex() + 1); } groupStart.push_back(curIndex); curIndex += myCutoffGroup->getNumAtom(); - } - - } + }//end for(myCutoffGroup =myMols[i].beginCutoffGroup(iterCutoff)) + + }//end for(int i = 0; i < numMol; i++) + ngroup = groupStart.size(); }