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

Comparing trunk/OOPSE-4/src/primitives/RigidBody.cpp (file contents):
Revision 1930 by gezelter, Wed Jan 12 22:41:40 2005 UTC vs.
Revision 1957 by tim, Tue Jan 25 17:45:23 2005 UTC

# Line 39 | Line 39
39   * such damages.
40   */
41   #include <algorithm>
42 + #include <math.h>
43   #include "primitives/RigidBody.hpp"
44   #include "utils/simError.h"
45   namespace oopse {
# Line 173 | Line 174 | void  RigidBody::calcRefCoords() {
174          Itmp(2, 2) += mtmp * r2;
175      }
176  
177 +    //project the inertial moment of directional atoms into this rigid body
178 +    for (std::size_t i = 0; i < atoms_.size(); i++) {
179 +        if (atoms_[i]->isDirectional()) {
180 +            RectMatrix<double, 3, 3> Iproject = refOrients_[i].transpose() * atoms_[i]->getI();
181 +            Itmp(0, 0) += Iproject(0, 0);
182 +            Itmp(1, 1) += Iproject(1, 1);
183 +            Itmp(2, 2) += Iproject(2, 2);
184 +        }
185 +    }
186 +
187      //diagonalize
188      Vector3d evals;
189      Mat3x3d::diagonalize(Itmp, evals, sU_);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines