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

Comparing trunk/OOPSE/utils/sysbuilder/MoLocator.cpp (file contents):
Revision 986 by gezelter, Mon Jan 26 22:01:23 2004 UTC vs.
Revision 1099 by gezelter, Mon Apr 12 20:33:12 2004 UTC

# Line 27 | Line 27 | void MoLocator::placeMol( double pos[3], double A[3][3
27                            int atomIndex, SimState* myConfig ){
28  
29    int i,j,k;
30 <  double r[3];
30 >  double r[3], ji[3];
31    double phi, theta, psi;
32    double sux, suy, suz;
33    double Axx, Axy, Axz, Ayx, Ayy, Ayz, Azx, Azy, Azz;
# Line 50 | Line 50 | void MoLocator::placeMol( double pos[3], double A[3][3
50        atomArray[j]->setCoords();
51  
52        // Directional Atoms have standard unit vectors which are oriented
53 <      // in space using the three Euler angles.  We assume the standard
54 <      // unit vector was originally along the z axis below.
53 >      // in space using the three Euler angles.
54        
55        phi = currAtom->getEulerPhi() * M_PI / 180.0;
56        theta = currAtom->getEulerTheta() * M_PI / 180.0;
57        psi = currAtom->getEulerPsi()* M_PI / 180.0;
58 <      
59 <      Axx = (cos(phi) * cos(psi)) - (sin(phi) * cos(theta) * sin(psi));
61 <      Axy = (sin(phi) * cos(psi)) + (cos(phi) * cos(theta) * sin(psi));
62 <      Axz = sin(theta) * sin(psi);
63 <      
64 <      Ayx = -(cos(phi) * sin(psi)) - (sin(phi) * cos(theta) * cos(psi));
65 <      Ayy = -(sin(phi) * sin(psi)) + (cos(phi) * cos(theta) * cos(psi));
66 <      Ayz = sin(theta) * cos(psi);
67 <      
68 <      Azx = sin(phi) * sin(theta);
69 <      Azy = -cos(phi) * sin(theta);
70 <      Azz = cos(theta);
71 <      
72 <      sux = 0.0;
73 <      suy = 0.0;
74 <      suz = 1.0;
75 <      
76 <      ux = (Axx * sux) + (Ayx * suy) + (Azx * suz);
77 <      uy = (Axy * sux) + (Ayy * suy) + (Azy * suz);
78 <      uz = (Axz * sux) + (Ayz * suy) + (Azz * suz);
79 <          
80 <      uSqr = (ux * ux) + (uy * uy) + (uz * uz);
81 <      
82 <      u = sqrt( uSqr );
83 <      ux = ux / u;
84 <      uy = uy / u;
85 <      uz = uz / u;
86 <      
87 <      dAtom->setSUx( ux );
88 <      dAtom->setSUy( uy );
89 <      dAtom->setSUz( uz );
90 <      
58 >
59 >      dAtom->setUnitFrameFromEuler(phi, theta, psi);      
60        dAtom->setA( A );
61 +
62 +      ji[0] = 0.0;
63 +      ji[1] = 0.0;
64 +      ji[2] = 0.0;
65 +      dAtom->setJ( ji );
66        
93      dAtom->setJx( 0.0 );
94      dAtom->setJy( 0.0 );
95      dAtom->setJz( 0.0 );
96      
67      }
68      else{
69 <      atomArray[j] = new GeneralAtom( j, myConfig);
69 >      atomArray[j] = new Atom( j, myConfig);
70        atomArray[j]->setCoords();
71      }
72      

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines