323 |
|
|
324 |
|
char *foo; // the pointer to the current string token |
325 |
|
|
326 |
< |
double rx, ry, rz; // position place holders |
327 |
< |
double vx, vy, vz; // velocity placeholders |
326 |
> |
double pos[3]; // position place holders |
327 |
> |
double vel[3]; // velocity placeholders |
328 |
|
double q[4]; // the quaternions |
329 |
|
double jx, jy, jz; // angular velocity placeholders; |
330 |
|
double qSqr, qLength; // needed to normalize the quaternion vector. |
377 |
|
c_in_name, n_atoms, atomIndex ); |
378 |
|
return strdup( painCave.errMsg ); |
379 |
|
} |
380 |
< |
rx = atof( foo ); |
380 |
> |
pos[0] = atof( foo ); |
381 |
|
|
382 |
|
foo = strtok(NULL, " ,;\t"); |
383 |
|
if(foo == NULL){ |
387 |
|
c_in_name, n_atoms, atomIndex ); |
388 |
|
return strdup( painCave.errMsg ); |
389 |
|
} |
390 |
< |
ry = atof( foo ); |
390 |
> |
pos[1] = atof( foo ); |
391 |
|
|
392 |
|
foo = strtok(NULL, " ,;\t"); |
393 |
|
if(foo == NULL){ |
397 |
|
c_in_name, n_atoms, atomIndex ); |
398 |
|
return strdup( painCave.errMsg ); |
399 |
|
} |
400 |
< |
rz = atof( foo ); |
400 |
> |
pos[2] = atof( foo ); |
401 |
|
|
402 |
|
|
403 |
|
// get the velocities |
410 |
|
c_in_name, n_atoms, atomIndex ); |
411 |
|
return strdup( painCave.errMsg ); |
412 |
|
} |
413 |
< |
vx = atof( foo ); |
413 |
> |
vel[0] = atof( foo ); |
414 |
|
|
415 |
|
foo = strtok(NULL, " ,;\t"); |
416 |
|
if(foo == NULL){ |
420 |
|
c_in_name, n_atoms, atomIndex ); |
421 |
|
return strdup( painCave.errMsg ); |
422 |
|
} |
423 |
< |
vy = atof( foo ); |
423 |
> |
vel[1] = atof( foo ); |
424 |
|
|
425 |
|
foo = strtok(NULL, " ,;\t"); |
426 |
|
if(foo == NULL){ |
430 |
|
c_in_name, n_atoms, atomIndex ); |
431 |
|
return strdup( painCave.errMsg ); |
432 |
|
} |
433 |
< |
vz = atof( foo ); |
433 |
> |
vel[2] = atof( foo ); |
434 |
|
|
435 |
|
|
436 |
|
// get the quaternions |
532 |
|
|
533 |
|
// add the positions and velocities to the atom |
534 |
|
|
535 |
< |
atoms[atomIndex]->setX( rx ); |
536 |
< |
atoms[atomIndex]->setY( ry ); |
537 |
< |
atoms[atomIndex]->setZ( rz ); |
538 |
< |
|
539 |
< |
atoms[atomIndex]->set_vx( vx ); |
540 |
< |
atoms[atomIndex]->set_vy( vy ); |
541 |
< |
atoms[atomIndex]->set_vz( vz ); |
535 |
> |
atoms[atomIndex]->setPos( pos ); |
536 |
> |
atoms[atomIndex]->setVel( vel ); |
537 |
|
|
538 |
|
return NULL; |
539 |
|
} |