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 821 by mmeineke, Fri Oct 24 22:17:45 2003 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;
34    double ux, uy, uz, u, uSqr;
35    
36    AtomStamp* currAtom;
# Line 45 | Line 48 | void MoLocator::placeMol( double pos[3], double A[3][3
48        dAtom = new DirectionalAtom( j, myConfig);
49        atomArray[j] = dAtom;
50        atomArray[j]->setCoords();
51 <          
52 <      ux = currAtom->getOrntX();
53 <      uy = currAtom->getOrntY();
51 <      uz = currAtom->getOrntZ();
51 >
52 >      // Directional Atoms have standard unit vectors which are oriented
53 >      // in space using the three Euler angles.
54        
55 <      uSqr = (ux * ux) + (uy * uy) + (uz * uz);
56 <      
57 <      u = sqrt( uSqr );
58 <      ux = ux / u;
59 <      uy = uy / u;
58 <      uz = uz / u;
59 <      
60 <      dAtom->setSUx( ux );
61 <      dAtom->setSUy( uy );
62 <      dAtom->setSUz( uz );
63 <      
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 >      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        
66      dAtom->setJx( 0.0 );
67      dAtom->setJy( 0.0 );
68      dAtom->setJz( 0.0 );
69      
67      }
68      else{
69 <      atomArray[j] = new GeneralAtom( j, myConfig);
69 >      atomArray[j] = new Atom( j, myConfig);
70        atomArray[j]->setCoords();
71      }
72      
# Line 216 | Line 213 | void getEulerRot( double theta, double phi, double psi
213    rot[2][2] = cos(theta);  
214   }
215  
219
220 void getUnitRot( double u[3], double rot[3][3] ){
221
222  double theta, phi, psi;
223
224  theta = acos(u[2]);
225  phi = atan(u[1] / u[0]);
226  psi = 0.0;
227
228  getEulerRot( theta, phi, psi, rot );
229 }
230                        
231

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines