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

Comparing trunk/OOPSE/libmdtools/Molecule.cpp (file contents):
Revision 1166 by tim, Tue May 11 21:14:26 2004 UTC vs.
Revision 1167 by tim, Wed May 12 16:38:45 2004 UTC

# Line 16 | Line 16 | Molecule::~Molecule( void ){
16  
17   Molecule::~Molecule( void ){
18    int i;
19 +  CutoffGroup* cg;
20 +  vector<CutoffGroup*>::iterator iter;
21    
22    if( myAtoms != NULL ){
23      for(i=0; i<nAtoms; i++) if(myAtoms[i] != NULL ) delete myAtoms[i];
# Line 37 | Line 39 | Molecule::~Molecule( void ){
39      delete[] myTorsions;
40    }
41  
42 +  for(cg = beginCutoffGroup(iter);  cg != NULL; cg = nextCutoffGroup(iter))
43 +    delete cg;
44 +  myCutoffGroups.clear();
45 +  
46   }
47  
48  
# Line 55 | Line 61 | void Molecule::initialize( molInit &theInit ){
61    nTorsions = theInit.nTorsions;
62    nRigidBodies = theInit.nRigidBodies;
63    nOriented = theInit.nOriented;
58  nCutoffGroups = theInit.nCutoffGroups;
64  
65    myAtoms = theInit.myAtoms;
66    myBonds = theInit.myBonds;
# Line 69 | Line 74 | void Molecule::initialize( molInit &theInit ){
74        myRigidBodies[i]->calcRefCoords();
75  
76    myCutoffGroups = theInit.myCutoffGroups;
77 <
73 <  //creat a global index set of atoms which belong to cutoff group.
74 <  //it will be use to speed up the query whether an atom belongs to cutoff group or not
75 <  cutoffAtomSet.clear();
76 <
77 <  for(curCutoffGroup = beginCutoffGroup(iterCutoff); curCutoffGroup != NULL;
78 <                                                  curCutoffGroup = nextCutoffGroup(iterCutoff)){
79 <
80 <      for(cutoffAtom = curCutoffGroup->beginAtom(iterAtom); cutoffAtom != NULL;
81 <                                           cutoffAtom = curCutoffGroup->nextAtom(iterAtom)){
82 < #ifdef IS_MPI
83 <        atomIndex = cutoffAtom->getGlobalIndex();
84 < #else
85 <        atomIndex = cutoffAtom->getIndex();
86 < #endif
87 <        cutoffAtomSet.insert(atomIndex);
88 <     }// end for(cutoffAtom)    
89 <  }//end for(curCutoffGroup)
77 >  nCutoffGroups = myCutoffGroups.size();
78    
79   }
80  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines