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 1136 by tim, Tue Apr 27 16:26:44 2004 UTC vs.
Revision 1167 by tim, Wed May 12 16:38:45 2004 UTC

# Line 12 | Line 12 | Molecule::Molecule( void ){
12    myBonds = NULL;
13    myBends = NULL;
14    myTorsions = NULL;
15
15   }
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 38 | 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  
49   void Molecule::initialize( molInit &theInit ){
50 <  double totMass;
50 >
51 >  CutoffGroup* curCutoffGroup;
52 >  vector<CutoffGroup*>::iterator iterCutoff;
53 >  Atom* cutoffAtom;
54 >  vector<Atom*>::iterator iterAtom;
55 >  int atomIndex;
56    
57    nAtoms = theInit.nAtoms;
58    nMembers = nAtoms;
# Line 63 | Line 73 | void Molecule::initialize( molInit &theInit ){
73    for (int i = 0; i < myRigidBodies.size(); i++)
74        myRigidBodies[i]->calcRefCoords();
75  
76 <
77 <  //the mass ratio will never change during the simulation. Thus, we could
78 <  //just calculate it at the begining of the simulation
69 <  totMass = getTotalMass();
70 <  for(int i = 0; i < nAtoms; i ++)
71 <    myAtoms[i]->setMassRatio(myAtoms[i]->getMass()/totMass);  
76 >  myCutoffGroups = theInit.myCutoffGroups;
77 >  nCutoffGroups = myCutoffGroups.size();
78 >  
79   }
80  
81   void Molecule::calcForces( void ){
# Line 81 | Line 88 | void Molecule::calcForces( void ){
88    }
89  
90    //calculate the center of mass of the molecule
91 <  getCOM(com);  
92 <  for(int i = 0; i < nAtoms; i ++)
93 <    myAtoms[i]->setRc(com);  
91 >  //getCOM(com);  
92 >  //for(int i = 0; i < nAtoms; i ++)
93 >  //  myAtoms[i]->setRc(com);  
94    
95  
96    for(i=0; i<nBonds; i++){

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines