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

Comparing trunk/OOPSE/libmdtools/Atom.hpp (file contents):
Revision 999 by chrisfen, Fri Jan 30 15:01:09 2004 UTC vs.
Revision 1097 by gezelter, Mon Apr 12 20:32:20 2004 UTC

# Line 6 | Line 6
6   #include <iostream>
7  
8   #include "SimState.hpp"
9 + #include "StuntDouble.hpp"
10  
11 < class Atom{
11 > class Atom : public StuntDouble {
12   public:
13  
14    Atom(int theIndex, SimState* theConfig );
# Line 24 | Line 25 | class Atom{ (public)
25    void getFrc( double theF[3] );
26    void addFrc( double theF[3] );
27  
28 <  virtual void zeroForces() = 0;
28 >  virtual void zeroForces();
29  
30 <  double getMass() const {return c_mass;}
30 >  double getMass() {return c_mass;}
31    void setMass(double mass) {c_mass = mass;}
31
32  double getEamRcut() const {return myEamRcut;}
33  void setEamRcut(double eamRcut) {myEamRcut = eamRcut;}
32    
35  double getSigma() const {return c_sigma;}
36  void setSigma(double sigma) {c_sigma = sigma;}
37
38  double getEpslon() const {return c_epslon;}
39  void setEpslon(double epslon) {c_epslon = epslon;}
40  
41  double getCovalent() const {return c_covalent;}
42  void setCovalent(double covalent) {c_covalent = covalent;}
43  
33    int getIndex() const {return index;}
34    void setIndex(int theIndex);
35 +
36    char *getType() {return c_name;}
37    void setType(char * name) {strcpy(c_name,name);}
38    
# Line 54 | Line 44 | class Atom{ (public)
44    void setGlobalIndex( int info ) { myGlobalIndex = info; }
45   #endif // is_mpi
46  
57  void set_n_hydrogens( int n_h ) {c_n_hyd = n_h;}
58  int get_n_hydrogens() const {return c_n_hyd;}
59
47    void setHasDipole( int value ) { has_dipole = value; }
48    int hasDipole( void ) { return has_dipole; }
49  
63  void setLJ( void )        { is_LJ = 1; is_VDW = 0; }
64  int isLJ( void )    { return is_LJ; }
65
66  void setVDW( void )        { is_VDW = 1; is_LJ = 0; }
67  int isVDW( void )    { return is_VDW; }
68
69  void setEAM( void ) { is_EAM = 1; }
70  int  isEAM( void ) { return is_EAM; }
71
72  void setCharged( void ) { is_charged = 1; }
73  int isCharged( void ) { return is_charged; }
74
75  virtual int isDirectional( void ) = 0;
76
77
50   protected:
51    
52    SimState* myConfig;
# Line 88 | Line 60 | class Atom{ (public)
60    double* ul;   // the lab frame unit directional vector
61  
62    double c_mass; /* the mass of the atom in amu */
91  double c_sigma; /* the sigma parameter for van der walls interactions */
92  double c_epslon; /* the esplon parameter for VDW interactions */
93  double c_covalent; // The covalent radius of the atom.
63  
95  double myEamRcut; // Atom rcut for eam defined by the forcefield.
96
64    int index; /* set the atom's index */
65    int offset; // the atom's offset in the storage array
66    int offsetX, offsetY, offsetZ;
# Line 104 | Line 71 | class Atom{ (public)
71  
72    char c_name[100]; /* it's name */
73    int ident;  // it's unique numeric identity.
107
108  int c_n_hyd; // the number of hydrogens bonded to the atom
74    
75    int has_dipole; // dipole boolean
111  int is_VDW;     // VDW boolean
112  int is_LJ;      // LJ boolean
113  int is_EAM;     // EAM boolean
114  int is_charged;   // isCharge boolean
76  
77    bool hasCoords;
78  
# Line 121 | Line 82 | class Atom{ (public)
82    
83   };
84  
124 class GeneralAtom : public Atom{
125
126 public:
127  GeneralAtom(int theIndex, SimState* theConfig): Atom(theIndex, theConfig){}
128  virtual ~GeneralAtom(){}
129
130  int isDirectional( void ){ return 0; }
131  void zeroForces( void );
132 };
133
134 class DirectionalAtom : public Atom {
135  
136 public:
137  DirectionalAtom(int theIndex, SimState* theConfig) : Atom(theIndex,
138                                                            theConfig)
139  {
140    ssdIdentity = 0;
141    sux = 0.0;
142    suy = 0.0;
143    suz = 0.0;
144    myMu = 0.0;
145  }
146  virtual ~DirectionalAtom() {}
147
148  virtual void setCoords(void);
149
150  void printAmatIndex( void );
151
152  int isDirectional(void) { return 1; }
153  
154  void setSSD( int value) { ssdIdentity = value; }
155  int isSSD(void) {return ssdIdentity; }
156
157  
158  void setEuler( double phi, double theta, double psi );
159
160  double getSUx( void ) { return sux; }
161  double getSUy( void ) { return suy; }
162  double getSUz( void ) { return suz; }
163  
164  void setSUx( double the_sux ) { sux = the_sux; }
165  void setSUy( double the_suy ) { suy = the_suy; }
166  void setSUz( double the_suz ) { suz = the_suz; }
167
168  void zeroForces();
169
170  void getA( double the_A[3][3] ); // get the full rotation matrix
171  void setA( double the_A[3][3] );
172
173  void getU( double the_u[3] ); // get the unit vetor
174  void updateU( void );
175
176  void getQ( double the_q[4] ); // get the quanternions
177  void setQ( double the_q[4] );
178
179  void getJ( double theJ[3] );
180  void setJ( double theJ[3] );
181
182  double getJx( void ) { return jx; }
183  double getJy( void ) { return jy; }
184  double getJz( void ) { return jz; }
185
186  void setJx( double the_jx ) { jx = the_jx; }
187  void setJy( double the_jy ) { jy = the_jy; }
188  void setJz( double the_jz ) { jz = the_jz; }
189
190  void getTrq( double theT[3] );
191  void addTrq( double theT[3] );
192
193  //  double getTx( void ) { return trq[offsetX];}
194  //  double getTy( void ) { return trq[offsetY]; }
195  //  double getTz( void ) { return trq[offsetZ]; }
196
197  void setI( double the_I[3][3] );
198  void getI( double the_I[3][3] );
199  
200  double getIxx( void ) { return Ixx; }
201  double getIxy( void ) { return Ixy; }
202  double getIxz( void ) { return Ixz; }
203  
204  double getIyx( void ) { return Iyx; }
205  double getIyy( void ) { return Iyy; }
206  double getIyz( void ) { return Iyz; }
207  
208  double getIzx( void ) { return Izx; }
209  double getIzy( void ) { return Izy; }
210  double getIzz( void ) { return Izz; }
211
212  double getMu( void );
213  void setMu( double the_mu );
214
215  void lab2Body( double r[3] );
216  void body2Lab( double r[3] );
217
218
219  // Four functions added for derivatives with respect to Euler Angles:
220  // (Needed for minimization routines):
221
222  void getGrad(double gradient[6] );
223  void getEulerAngles( double myEuler[3] );
224
225  double max(double x, double y);
226  double min(double x, double y);
227  
228
229 private:
230  int dIndex;
231
232  double myMu;
233
234  double sux, suy, suz; // the standard unit vector    ( body fixed )
235  double jx, jy, jz;    // the angular momentum vector ( body fixed )
236  
237  double Ixx, Ixy, Ixz; // the inertial tensor matrix  ( body fixed )
238  double Iyx, Iyy, Iyz;
239  double Izx, Izy, Izz;
240
241  int ssdIdentity; // boolean of whether atom is ssd
242
243 };
244
85   #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines