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

Comparing branches/new_design/OOPSE-3.0/src/primitives/RigidBody.cpp (file contents):
Revision 1738 by tim, Sat Nov 13 05:08:12 2004 UTC vs.
Revision 1809 by tim, Wed Dec 1 02:24:57 2004 UTC

# Line 24 | Line 24
24   */
25  
26   #include "primitives/RigidBody.hpp"
27 <
27 > #include "utils/simError.h"
28   namespace oopse {
29  
30   RigidBody::RigidBody() : StuntDouble(otRigidBody, &Snapshot::rigidbodyData){
# Line 33 | Line 33 | void RigidBody::setPrevA(const RotMat3x3d& a) {
33  
34   void RigidBody::setPrevA(const RotMat3x3d& a) {
35      ((snapshotMan_->getPrevSnapshot())->*storage_).aMat[localIndex_] = a;
36 <    ((snapshotMan_->getPrevSnapshot())->*storage_).unitVector[localIndex_] = a.inverse() * sU_.getColum(2);
36 >    ((snapshotMan_->getPrevSnapshot())->*storage_).unitFrame[localIndex_] = a.transpose() * sU_;
37  
38      std::vector<Atom*>::iterator i;
39      for (i = atoms_.begin(); i != atoms_.end(); ++i) {
# Line 47 | Line 47 | void RigidBody::setA(const RotMat3x3d& a) {
47        
48   void RigidBody::setA(const RotMat3x3d& a) {
49      ((snapshotMan_->getCurrentSnapshot())->*storage_).aMat[localIndex_] = a;
50 <    ((snapshotMan_->getCurrentSnapshot())->*storage_).unitVector[localIndex_] = a.inverse() * sU_.getColum(2);
50 >    ((snapshotMan_->getCurrentSnapshot())->*storage_).unitFrame[localIndex_] = a.transpose() * sU_;
51  
52      std::vector<Atom*>::iterator i;
53      for (i = atoms_.begin(); i != atoms_.end(); ++i) {
# Line 59 | Line 59 | void RigidBody::setA(const RotMat3x3d& a, int snapshot
59      
60   void RigidBody::setA(const RotMat3x3d& a, int snapshotNo) {
61      ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).aMat[localIndex_] = a;
62 <    ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).unitVector[localIndex_] = a.inverse() * sU_.getColum(2);    
62 >    ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).unitFrame[localIndex_] = a.transpose() * sU_;    
63  
64      std::vector<Atom*>::iterator i;
65      for (i = atoms_.begin(); i != atoms_.end(); ++i) {
# Line 135 | Line 135 | void  RigidBody::calcRefCoords() {
135      v->visit(this);
136   }    
137  
138 + /**@todo need modification */
139   void  RigidBody::calcRefCoords() {
140    /*
141    double mtmp;
# Line 420 | Line 421 | bool RigidBody::getAtomRefCoor(Vector3d& coor, Atom* a
421      }
422  
423   }
424 +
425 +
426 + void RigidBody::addAtom(Atom* at, AtomStamp* ats) {
427  
428 +  Vector3d coords;
429 +  Vector3d euler;
430 +  Mat3x3d Atmp;
431 +
432 +  atoms_.push_back(at);
433 +
434 +  if( !ats->havePosition() ){
435 +    sprintf( painCave.errMsg,
436 +             "RigidBody error.\n"
437 +             "\tAtom %s does not have a position specified.\n"
438 +             "\tThis means RigidBody cannot set up reference coordinates.\n",
439 +             ats->getType() );
440 +    painCave.isFatal = 1;
441 +    simError();
442 +  }
443 +  
444 +  coords[0] = ats->getPosX();
445 +  coords[1] = ats->getPosY();
446 +  coords[2] = ats->getPosZ();
447 +
448 +  refCoords_.push_back(coords);
449 +
450 +  /*
451 +  if (at->isDirectional()) {  
452 +
453 +    if( !ats->haveOrientation() ){
454 +      sprintf( painCave.errMsg,
455 +               "RigidBody error.\n"
456 +               "\tAtom %s does not have an orientation specified.\n"
457 +               "\tThis means RigidBody cannot set up reference orientations.\n",
458 +               ats->getType() );
459 +      painCave.isFatal = 1;
460 +      simError();
461 +    }    
462 +    
463 +    euler[0] = ats->getEulerPhi();
464 +    euler[1] = ats->getEulerTheta();
465 +    euler[2] = ats->getEulerPsi();
466 +    
467 +    doEulerToRotMat(euler, Atmp);
468 +    refOrients.push_back(Atmp);
469 +    
470 +  }
471 +  */
472 +  
473   }
474  
475 + }
476 +

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines