| 15 |
|
void RigidBody::addAtom(VDWAtom* at) { |
| 16 |
|
|
| 17 |
|
vec3 coords; |
| 18 |
– |
vec3 euler; |
| 19 |
– |
mat3x3 Atmp; |
| 18 |
|
|
| 19 |
|
myAtoms.push_back(at); |
| 20 |
|
|
| 173 |
|
|
| 174 |
|
void RigidBody::calcRefCoords( ) { |
| 175 |
|
|
| 176 |
< |
int i,j,k, it, n_linear_coords; |
| 176 |
> |
int i, j, it, n_linear_coords; |
| 177 |
|
double mtmp; |
| 178 |
|
vec3 apos; |
| 179 |
|
double refCOM[3]; |
| 180 |
|
vec3 ptmp; |
| 181 |
|
double Itmp[3][3]; |
| 182 |
|
double evals[3]; |
| 185 |
– |
double evects[3][3]; |
| 183 |
|
double r, r2, len; |
| 184 |
|
|
| 185 |
|
// First, find the center of mass: |
| 281 |
|
} |
| 282 |
|
} |
| 283 |
|
|
| 284 |
< |
void RigidBody::doEulerToRotMat(vec3 &euler, mat3x3 &myA ){ |
| 284 |
> |
void RigidBody::doEulerToRotMat(double euler[3], double myA[3][3] ){ |
| 285 |
|
|
| 286 |
|
double phi, theta, psi; |
| 287 |
|
|
| 341 |
|
|
| 342 |
|
|
| 343 |
|
double phi,theta,psi,eps; |
| 344 |
< |
double pi; |
| 345 |
< |
double cphi,ctheta,cpsi; |
| 346 |
< |
double sphi,stheta,spsi; |
| 350 |
< |
double b[3]; |
| 351 |
< |
int flip[3]; |
| 352 |
< |
|
| 344 |
> |
double ctheta; |
| 345 |
> |
double stheta; |
| 346 |
> |
|
| 347 |
|
// set the tolerance for Euler angles and rotation elements |
| 348 |
|
|
| 349 |
|
eps = 1.0e-8; |
| 392 |
|
|
| 393 |
|
double RigidBody::min(double x, double y) { |
| 394 |
|
return (x > y) ? y : x; |
| 395 |
+ |
} |
| 396 |
+ |
|
| 397 |
+ |
double RigidBody::findMaxExtent(){ |
| 398 |
+ |
int i; |
| 399 |
+ |
double refAtomPos[3]; |
| 400 |
+ |
double maxExtent; |
| 401 |
+ |
double tempExtent; |
| 402 |
+ |
|
| 403 |
+ |
//zero the extent variables |
| 404 |
+ |
maxExtent = 0.0; |
| 405 |
+ |
tempExtent = 0.0; |
| 406 |
+ |
for (i=0; i<3; i++) |
| 407 |
+ |
refAtomPos[i] = 0.0; |
| 408 |
+ |
|
| 409 |
+ |
//loop over all atoms |
| 410 |
+ |
for (i=0; i<myAtoms.size(); i++){ |
| 411 |
+ |
getAtomRefCoor(refAtomPos, i); |
| 412 |
+ |
tempExtent = sqrt(refAtomPos[0]*refAtomPos[0] + refAtomPos[1]*refAtomPos[1] |
| 413 |
+ |
+ refAtomPos[2]*refAtomPos[2]); |
| 414 |
+ |
if (tempExtent > maxExtent) |
| 415 |
+ |
maxExtent = tempExtent; |
| 416 |
+ |
} |
| 417 |
+ |
return maxExtent; |
| 418 |
|
} |
| 419 |
|
|
| 420 |
|
void RigidBody::findCOM() { |
| 423 |
|
int j; |
| 424 |
|
double mtmp; |
| 425 |
|
double ptmp[3]; |
| 426 |
< |
double vtmp[3]; |
| 410 |
< |
|
| 426 |
> |
|
| 427 |
|
for(j = 0; j < 3; j++) { |
| 428 |
|
pos[j] = 0.0; |
| 429 |
|
} |