ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-1.0/utils/sysbuilder/MoLocator.cpp
(Generate patch)

Comparing trunk/OOPSE-1.0/utils/sysbuilder/MoLocator.cpp (file contents):
Revision 1429 by tim, Wed Jul 28 20:29:49 2004 UTC vs.
Revision 1432 by tim, Thu Jul 29 03:31:50 2004 UTC

# Line 61 | Line 61 | void MoLocator::calcRefCoords( void ){
61    int nAtomsInRb;
62    double totMassInRb;
63    double currAtomMass;
64 <
65 <  double totMass;
64 >  double molMass;
65    
66    mass.resize(nIntegrableObjects);
67    
68    nAtoms= myStamp->getNAtoms();
69    nRigidBodies = myStamp->getNRigidBodies();
70  
72  //
71    for(size_t i=0; i<nAtoms; i++){
72  
73      currAtomStamp = myStamp->getAtom(i);
# Line 122 | Line 120 | void MoLocator::calcRefCoords( void ){
120      refCoords.push_back(coor);
121    }
122  
123 +
124    //calculate the reference center of mass
125 +  molMass = 0;
126 +  refMolCom.x = 0;
127 +  refMolCom.y = 0;
128 +  refMolCom.z = 0;
129 +  
130    for(int i = 0; i < nIntegrableObjects; i++){
131      refMolCom += refCoords[i] * mass[i];
132 <    totMass += mass[i];
132 >   molMass += mass[i];
133    }
134    
135 <  refMolCom /= totMass;
135 >  refMolCom /= molMass;
136  
137    //move the reference center of mass to (0,0,0) and adjust the reference coordinate
138    //of the integrabel objects

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines