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 1113 by tim, Thu Apr 15 16:18:26 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
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 61 | Line 72 | void Molecule::initialize( molInit &theInit ){
72  
73    for (int i = 0; i < myRigidBodies.size(); i++)
74        myRigidBodies[i]->calcRefCoords();
75 <    
75 >
76 >  myCutoffGroups = theInit.myCutoffGroups;
77 >  nCutoffGroups = myCutoffGroups.size();
78 >
79 >  myConstraintPairs = theInit.myConstraintPairs;
80 >  
81   }
82  
83   void Molecule::calcForces( void ){
84    
85    int i;
86 +  double com[3];
87  
88    for(i=0; i<myRigidBodies.size(); i++) {
89      myRigidBodies[i]->updateAtoms();
90    }
91  
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);  
96 +  
97 +
98    for(i=0; i<nBonds; i++){
99      myBonds[i]->calc_forces();
100    }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines