ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/libmdtools/AtomVisitor.cpp
(Generate patch)

Comparing trunk/OOPSE/libmdtools/AtomVisitor.cpp (file contents):
Revision 1126 by tim, Tue Apr 20 05:39:38 2004 UTC vs.
Revision 1129 by tim, Thu Apr 22 03:29:30 2004 UTC

# Line 44 | Line 44 | void SSDAtomVisitor::visit(DirectionalAtom* datom){
44    double ox[3] = {0.0, 0.0, -0.0654};
45    double u[3] = {0, 0, 1};
46    double rotMatrix[3][3];
47 +  double rotTrans[3][3];
48    AtomInfo* atomInfo;
49    double pos[3];
50    double vel[3];
# Line 78 | Line 79 | void SSDAtomVisitor::visit(DirectionalAtom* datom){
79    datom->getPos(pos);
80    datom->getQ(q);
81    datom->getA(rotMatrix);
82 +
83 +  // We need A^T to convert from body-fixed to space-fixed:
84 +  transposeMat3(rotMatrix, rotTrans);
85    
86    //center of mass of the water molecule
87 <  matVecMul3(rotMatrix, u, newVec);
87 >  matVecMul3(rotTrans, u, newVec);
88    atomInfo = new AtomInfo;
89    atomInfo->AtomType = "X";
90    atomInfo->pos[0] = pos[0];
# Line 93 | Line 97 | void SSDAtomVisitor::visit(DirectionalAtom* datom){
97    atomData->addAtomInfo(atomInfo);
98  
99    //oxygen
100 <  matVecMul3(rotMatrix, ox, newVec);
100 >  matVecMul3(rotTrans, ox, newVec);
101    atomInfo = new AtomInfo;
102    atomInfo->AtomType = "O";
103    atomInfo->pos[0] = pos[0] + newVec[0];
# Line 106 | Line 110 | void SSDAtomVisitor::visit(DirectionalAtom* datom){
110  
111  
112    //hydrogen1
113 <    matVecMul3(rotMatrix, h1, newVec);
113 >    matVecMul3(rotTrans, h1, newVec);
114    atomInfo = new AtomInfo;
115    atomInfo->AtomType = "H";
116    atomInfo->pos[0] = pos[0] + newVec[0];
# Line 118 | Line 122 | void SSDAtomVisitor::visit(DirectionalAtom* datom){
122    atomData->addAtomInfo(atomInfo);
123  
124    //hydrogen2
125 <  matVecMul3(rotMatrix, h2, newVec);
125 >  matVecMul3(rotTrans, h2, newVec);
126    atomInfo = new AtomInfo;
127    atomInfo->AtomType = "H";
128    atomInfo->pos[0] = pos[0] + newVec[0];

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines