# | Line 87 | Line 87 | namespace oopse { | |
---|---|---|
87 | return inertiaTensor_; | |
88 | } | |
89 | ||
90 | < | std::vector<double> RigidBody::getGrad() { |
91 | < | std::vector<double> grad(6, 0.0); |
90 | > | std::vector<RealType> RigidBody::getGrad() { |
91 | > | std::vector<RealType> grad(6, 0.0); |
92 | Vector3d force; | |
93 | Vector3d torque; | |
94 | Vector3d myEuler; | |
95 | < | double phi, theta, psi; |
96 | < | double cphi, sphi, ctheta, stheta; |
95 | > | RealType phi, theta, psi; |
96 | > | RealType cphi, sphi, ctheta, stheta; |
97 | Vector3d ephi; | |
98 | Vector3d etheta; | |
99 | Vector3d epsi; | |
# | Line 146 | Line 146 | namespace oopse { | |
146 | ||
147 | /**@todo need modification */ | |
148 | void RigidBody::calcRefCoords() { | |
149 | < | double mtmp; |
149 | > | RealType mtmp; |
150 | Vector3d refCOM(0.0); | |
151 | mass_ = 0.0; | |
152 | for (std::size_t i = 0; i < atoms_.size(); ++i) { | |
# | Line 167 | Line 167 | namespace oopse { | |
167 | Mat3x3d IAtom(0.0); | |
168 | mtmp = atoms_[i]->getMass(); | |
169 | IAtom -= outProduct(refCoords_[i], refCoords_[i]) * mtmp; | |
170 | < | double r2 = refCoords_[i].lengthSquare(); |
170 | > | RealType r2 = refCoords_[i].lengthSquare(); |
171 | IAtom(0, 0) += mtmp * r2; | |
172 | IAtom(1, 1) += mtmp * r2; | |
173 | IAtom(2, 2) += mtmp * r2; | |
# | Line 245 | Line 245 | namespace oopse { | |
245 | ||
246 | } | |
247 | ||
248 | < | setFrc(frc); |
249 | < | setTrq(trq); |
248 | > | addFrc(frc); |
249 | > | addTrq(trq); |
250 | ||
251 | } | |
252 |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |