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 1811 by tim, Wed Dec 1 03:11:29 2004 UTC vs.
Revision 1813 by tim, Wed Dec 1 17:38:32 2004 UTC

# 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_).unitFrame[localIndex_] = a.transpose() * sU_;
36 >    //((snapshotMan_->getPrevSnapshot())->*storage_).electroFrame[localIndex_] = a.transpose() * sU_;
37  
38 <    std::vector<Atom*>::iterator i;
39 <    for (i = atoms_.begin(); i != atoms_.end(); ++i) {
40 <        if ((*i)->isDirectional()) {
41 <            (*i)->setPrevA(a * (*i)->getPrevA());
42 <        }
43 <    }
38 >    //for (int i =0 ; i < atoms_.size(); ++i){
39 >    //    if (atoms_[i]->isDirectional()) {
40 >    //        atoms_[i]->setPrevA(a * refOrients_[i]);
41 >    //    }
42 >    //}
43  
44   }
45  
46        
47   void RigidBody::setA(const RotMat3x3d& a) {
48      ((snapshotMan_->getCurrentSnapshot())->*storage_).aMat[localIndex_] = a;
49 <    ((snapshotMan_->getCurrentSnapshot())->*storage_).unitFrame[localIndex_] = a.transpose() * sU_;
49 >    //((snapshotMan_->getCurrentSnapshot())->*storage_).electroFrame[localIndex_] = a.transpose() * sU_;
50  
51 <    std::vector<Atom*>::iterator i;
52 <    for (i = atoms_.begin(); i != atoms_.end(); ++i) {
53 <        if ((*i)->isDirectional()) {
54 <            (*i)->setA(a * (*i)->getA());
55 <        }
57 <    }
51 >    //for (int i =0 ; i < atoms_.size(); ++i){
52 >    //    if (atoms_[i]->isDirectional()) {
53 >    //        atoms_[i]->setA(a * refOrients_[i]);
54 >    //    }
55 >    //}
56   }    
57      
58   void RigidBody::setA(const RotMat3x3d& a, int snapshotNo) {
59      ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).aMat[localIndex_] = a;
60 <    ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).unitFrame[localIndex_] = a.transpose() * sU_;    
60 >    //((snapshotMan_->getSnapshot(snapshotNo))->*storage_).electroFrame[localIndex_] = a.transpose() * sU_;    
61  
62 <    std::vector<Atom*>::iterator i;
63 <    for (i = atoms_.begin(); i != atoms_.end(); ++i) {
64 <        if ((*i)->isDirectional()) {
65 <            (*i)->setA(a * (*i)->getA(snapshotNo), snapshotNo);
66 <        }
69 <    }
62 >    //for (int i =0 ; i < atoms_.size(); ++i){
63 >    //    if (atoms_[i]->isDirectional()) {
64 >    //        atoms_[i]->setA(a * refOrients_[i], snapshotNo);
65 >    //    }
66 >    //}
67  
68   }  
69  
73 void  DirectionalAtom::setUnitFrameFromEuler(double phi, double theta, double psi) {
74    sU_.setupRotMat(phi,theta,psi);
75 }
76
70   Mat3x3d RigidBody::getI() {
71      return inertiaTensor_;
72   }    
# Line 247 | Line 240 | void  RigidBody::updateAtoms() {
240      Vector3d apos;
241      DirectionalAtom* dAtom;
242      Vector3d pos = getPos();
243 <    RotMat3x3d A = getA();
243 >    RotMat3x3d a = getA();
244      
245      for (i = 0; i < atoms_.size(); i++) {
246      
# Line 260 | Line 253 | void  RigidBody::updateAtoms() {
253          if (atoms_[i]->isDirectional()) {
254            
255            dAtom = (DirectionalAtom *) atoms_[i];
256 <          dAtom->rotateBy( A );      
256 >          dAtom->setA(a * refOrients_[i]);
257 >          //dAtom->rotateBy( A );      
258          }
259  
260      }
# Line 377 | Line 371 | void RigidBody::addAtom(Atom* at, AtomStamp* ats) {
371  
372    Vector3d coords;
373    Vector3d euler;
374 <  Mat3x3d Atmp;
374 >  
375  
376    atoms_.push_back(at);
377  
# Line 397 | Line 391 | void RigidBody::addAtom(Atom* at, AtomStamp* ats) {
391  
392    refCoords_.push_back(coords);
393  
394 <  /*
394 >  RotMat3x3d identMat = RotMat3x3d::identity();
395 >  
396    if (at->isDirectional()) {  
397  
398      if( !ats->haveOrientation() ){
# Line 413 | Line 408 | void RigidBody::addAtom(Atom* at, AtomStamp* ats) {
408      euler[0] = ats->getEulerPhi();
409      euler[1] = ats->getEulerTheta();
410      euler[2] = ats->getEulerPsi();
411 +
412 +    RotMat3x3d Atmp(euler);
413 +    refOrients_.push_back(Atmp);
414      
415 <    doEulerToRotMat(euler, Atmp);
416 <    refOrients.push_back(Atmp);
419 <    
415 >  }else {
416 >    refOrients_.push_back(identMat);
417    }
421  */
418    
419 +  
420   }
421  
422   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines