ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/branches/new_design/OOPSE-3.0/src/primitives/RigidBody.cpp
(Generate patch)

Comparing branches/new_design/OOPSE-3.0/src/primitives/RigidBody.cpp (file contents):
Revision 1882 by tim, Thu Dec 9 15:45:21 2004 UTC vs.
Revision 1883 by tim, Mon Dec 13 22:30:27 2004 UTC

# Line 133 | Line 133 | void  RigidBody::calcRefCoords() {
133      double mtmp;
134      Vector3d refCOM(0.0);
135      mass_ = 0.0;
136 <    for (int i = 0; i < atoms_.size(); ++i) {
136 >    for (std::size_t i = 0; i < atoms_.size(); ++i) {
137          mtmp = atoms_[i]->getMass();
138          mass_ += mtmp;
139          refCOM += refCoords_[i]*mtmp;
# Line 141 | Line 141 | void  RigidBody::calcRefCoords() {
141      refCOM /= mass_;
142  
143      // Next, move the origin of the reference coordinate system to the COM:
144 <    for (int i = 0; i < atoms_.size(); ++i) {
144 >    for (std::size_t i = 0; i < atoms_.size(); ++i) {
145          refCoords_[i] -= refCOM;
146      }
147  
148   // Moment of Inertia calculation
149      Mat3x3d Itmp(0.0);
150    
151 <    for (int i = 0; i < atoms_.size(); i++) {
151 >    for (std::size_t i = 0; i < atoms_.size(); i++) {
152          mtmp = atoms_[i]->getMass();
153          Itmp -= outProduct(refCoords_[i], refCoords_[i]) * mtmp;
154          double r2 = refCoords_[i].lengthSquare();
# Line 228 | Line 228 | void  RigidBody::updateAtoms() {
228  
229   void  RigidBody::updateAtoms() {
230      unsigned int i;
231    unsigned int j;
231      Vector3d ref;
232      Vector3d apos;
233      DirectionalAtom* dAtom;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines