ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/libmdtools/SimSetup.cpp
(Generate patch)

Comparing trunk/OOPSE/libmdtools/SimSetup.cpp (file contents):
Revision 1104 by gezelter, Tue Apr 13 16:26:03 2004 UTC vs.
Revision 1108 by tim, Wed Apr 14 15:37:41 2004 UTC

# Line 190 | Line 190 | void SimSetup::makeMolecules(void){
190    set<int> skipList;
191  
192    double phi, theta, psi;
193 +  char* molName;
194 +  char rbName[100];
195  
196    //init the forceField paramters
197  
# Line 206 | Line 208 | void SimSetup::makeMolecules(void){
208  
209      for (i = 0; i < info[k].n_mol; i++){
210        stampID = info[k].molecules[i].getStampID();
211 +      molName = comp_stamps[stampID]->getID();
212  
213        molInfo.nAtoms = comp_stamps[stampID]->getNAtoms();
214        molInfo.nBonds = comp_stamps[stampID]->getNBonds();
# Line 265 | Line 268 | void SimSetup::makeMolecules(void){
268  
269   #ifdef IS_MPI
270  
271 <        molInfo.myAtoms[j]->setGlobalIndex(globalIndex[j + atomOffset]);
271 >        molInfo.myAtoms[j]->setGlobalIndex(globalAtomIndex[j + atomOffset]);
272  
273   #endif // is_mpi
274        }
# Line 414 | Line 417 | void SimSetup::makeMolecules(void){
417          // Create the Rigid Body:
418  
419          myRB = new RigidBody();
420 +
421 +        sprintf(rbName,"%s_RB_%s", molName, j);
422 +        myRB->setType(rbName);
423          
424          for (rb1 = 0; rb1 < nMembers; rb1++) {
425  
# Line 1346 | Line 1352 | void SimSetup::mpiMolDivide(void){
1352    int localMol, allMol;
1353    int local_atoms, local_bonds, local_bends, local_torsions, local_SRI;
1354    int local_rigid;
1355 +  vector<int> globalAtomIndex;
1356 +  vector<int> globalMolIndex;
1357  
1358    mpiSim = new mpiSimulation(info);
1359  
1360 <  globalIndex = mpiSim->divideLabor();
1360 >  mpiSim->divideLabor();
1361 >  globalAtomIndex = mpiSim->getGlobalAtomIndex();
1362 >  globalMolIndex = mpiSim->getGlobalMolIndex();
1363  
1364    // set up the local variables
1365  
# Line 1363 | Line 1373 | void SimSetup::mpiMolDivide(void){
1373    local_bends = 0;
1374    local_torsions = 0;
1375    local_rigid = 0;
1376 <  globalAtomIndex = 0;
1376 >  globalAtomCounter = 0;
1377  
1378    for (i = 0; i < n_components; i++){
1379      for (j = 0; j < components_nmol[i]; j++){
# Line 1376 | Line 1386 | void SimSetup::mpiMolDivide(void){
1386          localMol++;
1387        }      
1388        for (k = 0; k < comp_stamps[i]->getNAtoms(); k++){
1389 <        info[0].molMembershipArray[globalAtomIndex] = allMol;
1390 <        globalAtomIndex++;
1389 >        info[0].molMembershipArray[globalAtomCounter] = allMol;
1390 >        globalAtomCounter++;
1391        }
1392  
1393        allMol++;
# Line 1445 | Line 1455 | void SimSetup::makeSysArrays(void){
1455   #else // is_mpi
1456  
1457      molIndex = 0;
1458 <    globalAtomIndex = 0;
1458 >    globalAtomCounter = 0;
1459      for (i = 0; i < n_components; i++){
1460        for (j = 0; j < components_nmol[i]; j++){
1461          the_molecules[molIndex].setStampID(i);
1462          the_molecules[molIndex].setMyIndex(molIndex);
1463          the_molecules[molIndex].setGlobalIndex(molIndex);
1464          for (k = 0; k < comp_stamps[i]->getNAtoms(); k++){
1465 <          info[l].molMembershipArray[globalAtomIndex] = molIndex;
1466 <          globalAtomIndex++;
1465 >          info[l].molMembershipArray[globalAtomCounter] = molIndex;
1466 >          globalAtomCounter++;
1467          }
1468          molIndex++;
1469        }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines