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 1140 by tim, Wed Apr 28 22:34:02 2004 UTC vs.
Revision 1234 by tim, Fri Jun 4 03:15:31 2004 UTC

# Line 12 | Line 12 | Molecule::Molecule( void ){
12    myBonds = NULL;
13    myBends = NULL;
14    myTorsions = NULL;
15  hasMassRatio = false;
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  
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;
59    nBonds = theInit.nBonds;
# Line 62 | Line 73 | void Molecule::initialize( molInit &theInit ){
73    for (int i = 0; i < myRigidBodies.size(); i++)
74        myRigidBodies[i]->calcRefCoords();
75  
76 +  myCutoffGroups = theInit.myCutoffGroups;
77 +  nCutoffGroups = myCutoffGroups.size();
78 +
79 +  myConstraintPairs = theInit.myConstraintPairs;
80 +  
81   }
82  
83   void Molecule::calcForces( void ){
# Line 73 | Line 89 | void Molecule::calcForces( void ){
89      myRigidBodies[i]->updateAtoms();
90    }
91  
76  //the mass ratio will never change during the simulation. Thus, we could
77  //just calculate it at the begining of the simulation
78  if (!hasMassRatio){
79    double totMass = getTotalMass();
80    for(int i = 0; i < nAtoms; i ++)
81      myAtoms[i]->setMassRatio(myAtoms[i]->getMass()/totMass);  
82    hasMassRatio =  true;
83  }
84
92    //calculate the center of mass of the molecule
93 <  getCOM(com);  
94 <  for(int i = 0; i < nAtoms; i ++)
95 <    myAtoms[i]->setRc(com);  
93 >  //getCOM(com);  
94 >  //for(int i = 0; i < nAtoms; i ++)
95 >  //  myAtoms[i]->setRc(com);  
96    
97  
98    for(i=0; i<nBonds; i++){

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines