ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/libmdtools/DirectionalAtom.hpp
Revision: 1126
Committed: Tue Apr 20 05:39:38 2004 UTC (20 years, 2 months ago) by tim
File size: 1922 byte(s)
Log Message:
DUMP2XYZ 0.99 version

File Contents

# User Rev Content
1 gezelter 1097 #ifndef _DIRECTIONALATOM_H_
2     #define _DIRECTIONALATOM_H_
3    
4     #include <string.h>
5     #include <stdlib.h>
6     #include <iostream>
7    
8     #include "StuntDouble.hpp"
9     #include "Atom.hpp"
10    
11     class DirectionalAtom : public Atom {
12    
13     public:
14     DirectionalAtom(int theIndex, SimState* theConfig) : Atom(theIndex,
15     theConfig)
16     {
17     objType = OT_DATOM;
18    
19     for (int i=0; i < 3; i++)
20     for (int j=0; j < 3; j++)
21     sU[i][j] = 0.0;
22    
23     }
24     virtual ~DirectionalAtom() {}
25    
26     virtual void setCoords(void);
27    
28     void printAmatIndex( void );
29    
30     void setUnitFrameFromEuler(double phi, double theta, double psi);
31     void setEuler( double phi, double theta, double psi );
32    
33     void zeroForces();
34    
35     void getA( double the_A[3][3] ); // get the full rotation matrix
36     void setA( double the_A[3][3] );
37     void rotateBy( double by_A[3][3] ); // rotate your frame using this matrix
38    
39     void getU( double the_u[3] ); // get the unit vetor
40     void updateU( void );
41    
42     void getQ( double the_q[4] ); // get the quanternions
43     void setQ( double the_q[4] );
44    
45     void getJ( double theJ[3] );
46     void setJ( double theJ[3] );
47    
48     void getTrq( double theT[3] );
49     void addTrq( double theT[3] );
50    
51     void setI( double the_I[3][3] );
52     void getI( double the_I[3][3] );
53    
54     void lab2Body( double r[3] );
55     void body2Lab( double r[3] );
56    
57     // Four functions added for derivatives with respect to Euler Angles:
58     // (Needed for minimization routines):
59    
60     void getGrad(double gradient[6] );
61     void getEulerAngles( double myEuler[3] );
62    
63     double max(double x, double y);
64     double min(double x, double y);
65 tim 1126
66     virtual void accept(BaseVisitor* v) {v->visit(this);}
67 gezelter 1097
68     private:
69     int dIndex;
70    
71     double sU[3][3]; // the standard unit vectors ( body fixed )
72    
73     double jx, jy, jz; // the angular momentum vector ( body fixed )
74    
75     double Ixx, Ixy, Ixz; // the inertial tensor matrix ( body fixed )
76     double Iyx, Iyy, Iyz;
77     double Izx, Izy, Izz;
78    
79     };
80    
81     #endif