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; |
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(); |
228 |
|
|
229 |
|
void RigidBody::updateAtoms() { |
230 |
|
unsigned int i; |
231 |
– |
unsigned int j; |
231 |
|
Vector3d ref; |
232 |
|
Vector3d apos; |
233 |
|
DirectionalAtom* dAtom; |