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

Comparing branches/new_design/OOPSE-3.0/src/visitors/AtomVisitor.cpp (file contents):
Revision 1695 by tim, Mon Nov 1 22:52:57 2004 UTC vs.
Revision 1701 by tim, Wed Nov 3 16:08:43 2004 UTC

# Line 18 | Line 18 | void BaseAtomVisitor::setVisited(Atom* atom){
18  
19   void BaseAtomVisitor::setVisited(Atom* atom){
20    GenericData* data;
21 <  data = atom->getProperty("VISITED");
21 >  data = atom->getPropertyByName("VISITED");
22  
23    //if visited property is not existed, add it as new property
24    if(data == NULL){
# Line 30 | Line 30 | bool BaseAtomVisitor::isVisited(Atom* atom){
30  
31   bool BaseAtomVisitor::isVisited(Atom* atom){
32    GenericData* data;
33 <  data = atom->getProperty("VISITED");
33 >  data = atom->getPropertyByName("VISITED");
34    return data == NULL ?  false : true;
35   }
36  
# Line 55 | Line 55 | void SSDAtomVisitor::visit(DirectionalAtom* datom){
55    Vector3d h2(0.0, 0.75695, 0.5206);
56    Vector3d ox(0.0, 0.0, -0.0654);
57    Vector3d u(0, 0, 1);
58 <  double rotMatrix[3][3];
59 <  double rotTrans[3][3];
58 >  RotMat3x3d rotMatrix;
59 >  RotMat3x3d rotTrans;
60    AtomInfo* atomInfo;
61    Vector3d pos;
62    Vector3d newVec;
# Line 69 | Line 69 | void SSDAtomVisitor::visit(DirectionalAtom* datom){
69    if(!isSSDAtom(datom->getType()))
70      return;
71  
72 <  data = datom->getProperty("ATOMDATA");
72 >  data = datom->getPropertyByName("ATOMDATA");
73    if(data != NULL){
74  
75      atomData = dynamic_cast<AtomData*>(data);  
# Line 89 | Line 89 | void SSDAtomVisitor::visit(DirectionalAtom* datom){
89    
90    pos = datom->getPos();
91    q = datom->getQ();
92 <  datom->getA(rotMatrix);
92 >  rotMatrix= datom->getA();
93  
94    // We need A^T to convert from body-fixed to space-fixed:
95 <  transposeMat3(rotMatrix, rotTrans);
95 >  //transposeMat3(rotMatrix, rotTrans);
96 >  rotTrans = rotMatrix.transpose();
97    
98    //center of mass of the water molecule
99 <  matVecMul3(rotTrans, u, newVec);
99 >  //matVecMul3(rotTrans, u, newVec);
100 >  newVec = rotTrans * u;
101 >  
102    atomInfo = new AtomInfo;
103    atomInfo->AtomType = "X";
104    atomInfo->pos[0] = pos[0];
# Line 108 | Line 111 | void SSDAtomVisitor::visit(DirectionalAtom* datom){
111    atomData->addAtomInfo(atomInfo);
112  
113    //oxygen
114 <  matVecMul3(rotTrans, ox, newVec);
114 >  //matVecMul3(rotTrans, ox, newVec);
115 >  newVec = rotTrans * ox;
116 >
117    atomInfo = new AtomInfo;
118    atomInfo->AtomType = "O";
119    atomInfo->pos[0] = pos[0] + newVec[0];
# Line 121 | Line 126 | void SSDAtomVisitor::visit(DirectionalAtom* datom){
126  
127  
128    //hydrogen1
129 <    matVecMul3(rotTrans, h1, newVec);
129 >  //matVecMul3(rotTrans, h1, newVec);
130 >  newVec = rotTrans * h1;
131    atomInfo = new AtomInfo;
132    atomInfo->AtomType = "H";
133    atomInfo->pos[0] = pos[0] + newVec[0];
# Line 133 | Line 139 | void SSDAtomVisitor::visit(DirectionalAtom* datom){
139    atomData->addAtomInfo(atomInfo);
140  
141    //hydrogen2
142 <  matVecMul3(rotTrans, h2, newVec);
142 >  //matVecMul3(rotTrans, h2, newVec);
143 >  newVec = rotTrans * h2;
144    atomInfo = new AtomInfo;
145    atomInfo->AtomType = "H";
146    atomInfo->pos[0] = pos[0] + newVec[0];
# Line 179 | Line 186 | void DefaultAtomVisitor::visit(Atom* atom){
186   void DefaultAtomVisitor::visit(Atom* atom){
187    AtomData* atomData;
188    AtomInfo* atomInfo;
189 <  double pos[3];
189 >  Vector3d pos;
190  
191    if(isVisited(atom))
192      return;
# Line 208 | Line 215 | void DefaultAtomVisitor::visit(DirectionalAtom* datom)
215   void DefaultAtomVisitor::visit(DirectionalAtom* datom){
216    AtomData* atomData;
217    AtomInfo* atomInfo;
218 <  double pos[3];
219 <  double u[3];
218 >  Vector3d pos;
219 >  Vector3d u;
220  
221    if(isVisited(datom))
222      return;
223    
224    pos = datom->getPos();
225 <  u = datom->getU();
225 >  u = datom->getUnitVector();
226  
227    atomData = new AtomData;
228    atomData->setID("ATOMDATA");

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines