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 689 by tim, Tue Aug 12 19:56:49 2003 UTC vs.
Revision 1452 by tim, Mon Aug 23 15:11:36 2004 UTC

# Line 1 | Line 1
1   #ifndef _ATOM_H_
2   #define _ATOM_H_
3  
4 < #include <cstring>
5 < #include <cstdlib>
4 > #include <string.h>
5 > #include <stdlib.h>
6   #include <iostream>
7  
8   #include "SimState.hpp"
9 + #include "StuntDouble.hpp"
10 + #include "BaseVisitor.hpp"
11  
12 < class Atom{
12 > class Atom : public StuntDouble {
13   public:
14  
15    Atom(int theIndex, SimState* theConfig );
# Line 15 | Line 17 | class Atom{ (public)
17  
18    virtual void setCoords(void);
19  
18 //   void addAtoms(int nAdded, double* Apos, double* Avel, double* Afrc,
19 //                 double* Atrq, double* AAmat, double* Amu,
20 //                 double* Aul);
21 //   void deleteAtom(int theIndex);
22 //   void deleteRange(int startIndex, int stopIndex);
23
20    void getPos( double theP[3] );
21    void setPos( double theP[3] );
22  
# Line 28 | Line 24 | class Atom{ (public)
24    void setVel( double theV[3] );
25  
26    void getFrc( double theF[3] );
27 +  void setFrc( double theF[3] );  
28    void addFrc( double theF[3] );
29  
30 <  virtual void zeroForces() = 0;
30 >  virtual void zeroForces();
31  
32 <  double getMass() const {return c_mass;}
32 >  double getMass() {return c_mass;}
33    void setMass(double mass) {c_mass = mass;}
37
38  double getEamRcut() const {return myEamRcut;}
39  void setEamRcut(double eamRcut) {myEamRcut = eamRcut;}
34    
41  double getSigma() const {return c_sigma;}
42  void setSigma(double sigma) {c_sigma = sigma;}
43
44  double getEpslon() const {return c_epslon;}
45  void setEpslon(double epslon) {c_epslon = epslon;}
46  
47  double getCovalent() const {return c_covalent;}
48  void setCovalent(double covalent) {c_covalent = covalent;}
49  
35    int getIndex() const {return index;}
36    void setIndex(int theIndex);
37 +
38    char *getType() {return c_name;}
39    void setType(char * name) {strcpy(c_name,name);}
40    
# Line 60 | Line 46 | class Atom{ (public)
46    void setGlobalIndex( int info ) { myGlobalIndex = info; }
47   #endif // is_mpi
48  
63  void set_n_hydrogens( int n_h ) {c_n_hyd = n_h;}
64  int get_n_hydrogens() const {return c_n_hyd;}
65
49    void setHasDipole( int value ) { has_dipole = value; }
50    int hasDipole( void ) { return has_dipole; }
51  
52 <  void setLJ( void )        { is_LJ = 1; is_VDW = 0; }
53 <  int isLJ( void )    { return is_LJ; }
52 >  void setHasCharge(int value) {has_charge = value;}
53 >  int hasCharge(void) {return has_charge;}
54  
72  void seVDW( void )        { is_VDW = 1; is_LJ = 0; }
73  int isVDW( void )    { return is_VDW; }
55  
56 <  void setEAM( void ) { is_EAM = 1; }
57 <  int  isEAM( void ) { return is_EAM; }
77 <
78 <  virtual int isDirectional( void ) = 0;
79 <
80 <
56 >  virtual void accept(BaseVisitor* v) {v->visit(this);}
57 >  
58   protected:
59    
60    SimState* myConfig;
# Line 89 | Line 66 | class Atom{ (public)
66    double* Amat; // the rotation matrix
67    double* mu;   // the array of dipole moments
68    double* ul;   // the lab frame unit directional vector
69 +  double* quat; // the quaternion array
70  
71 +  double zAngle; // the rotation about the z-axis ( body-fixed )
72 +
73    double c_mass; /* the mass of the atom in amu */
94  double c_sigma; /* the sigma parameter for van der walls interactions */
95  double c_epslon; /* the esplon parameter for VDW interactions */
96  double c_covalent; // The covalent radius of the atom.
74  
98  double myEamRcut; // Atom rcut for eam defined by the forcefield.
99
75    int index; /* set the atom's index */
76    int offset; // the atom's offset in the storage array
77    int offsetX, offsetY, offsetZ;
# Line 107 | Line 82 | class Atom{ (public)
82  
83    char c_name[100]; /* it's name */
84    int ident;  // it's unique numeric identity.
110
111  int c_n_hyd; // the number of hydrogens bonded to the atom
85    
86    int has_dipole; // dipole boolean
87 <  int is_VDW;    // VDW boolean
115 <  int is_LJ;    // LJ boolean
116 <  int is_EAM; //EAM boolean
87 >  int has_charge; // charge boolean
88  
89    bool hasCoords;
90  
# Line 123 | Line 94 | class Atom{ (public)
94    
95   };
96  
126 class GeneralAtom : public Atom{
127
128 public:
129  GeneralAtom(int theIndex, SimState* theConfig): Atom(theIndex, theConfig){}
130  virtual ~GeneralAtom(){}
131
132  int isDirectional( void ){ return 0; }
133  void zeroForces( void );
134 };
135
136 class DirectionalAtom : public Atom {
137  
138 public:
139  DirectionalAtom(int theIndex, SimState* theConfig) : Atom(theIndex,
140                                                            theConfig)
141  {
142    ssdIdentity = 0;
143    sux = 0.0;
144    suy = 0.0;
145    suz = 0.0;
146    myMu = 0.0;
147  }
148  virtual ~DirectionalAtom() {}
149
150  virtual void setCoords(void);
151
152  void printAmatIndex( void );
153
154  int isDirectional(void) { return 1; }
155  
156  void setSSD( int value) { ssdIdentity = value; }
157  int isSSD(void) {return ssdIdentity; }
158
159  
160  void setEuler( double phi, double theta, double psi );
161
162  double getSUx( void ) { return sux; }
163  double getSUy( void ) { return suy; }
164  double getSUz( void ) { return suz; }
165  
166  void setSUx( double the_sux ) { sux = the_sux; }
167  void setSUy( double the_suy ) { suy = the_suy; }
168  void setSUz( double the_suz ) { suz = the_suz; }
169
170  void zeroForces();
171
172  void getA( double the_A[3][3] ); // get the full rotation matrix
173  void setA( double the_A[3][3] );
174
175  void getU( double the_u[3] ); // get the unit vetor
176  void updateU( void );
177
178  void getQ( double the_q[4] ); // get the quanternions
179  void setQ( double the_q[4] );
180
181  void getJ( double theJ[3] );
182  void setJ( double theJ[3] );
183
184  double getJx( void ) { return jx; }
185  double getJy( void ) { return jy; }
186  double getJz( void ) { return jz; }
187
188  void setJx( double the_jx ) { jx = the_jx; }
189  void setJy( double the_jy ) { jy = the_jy; }
190  void setJz( double the_jz ) { jz = the_jz; }
191
192  void getTrq( double theT[3] );
193  void addTrq( double theT[3] );
194
195  //  double getTx( void ) { return trq[offsetX];}
196  //  double getTy( void ) { return trq[offsetY]; }
197  //  double getTz( void ) { return trq[offsetZ]; }
198
199  void setI( double the_I[3][3] );
200  void getI( double the_I[3][3] );
201  
202  double getIxx( void ) { return Ixx; }
203  double getIxy( void ) { return Ixy; }
204  double getIxz( void ) { return Ixz; }
205  
206  double getIyx( void ) { return Iyx; }
207  double getIyy( void ) { return Iyy; }
208  double getIyz( void ) { return Iyz; }
209  
210  double getIzx( void ) { return Izx; }
211  double getIzy( void ) { return Izy; }
212  double getIzz( void ) { return Izz; }
213
214  double getMu( void );
215  void setMu( double the_mu );
216
217  void lab2Body( double r[3] );
218  void body2Lab( double r[3] );
219
220
221 private:
222  int dIndex;
223
224  double myMu;
225
226  double sux, suy, suz; // the standard unit vector    ( body fixed )
227  double jx, jy, jz;    // the angular momentum vector ( body fixed )
228  
229  double Ixx, Ixy, Ixz; // the inertial tensor matrix  ( body fixed )
230  double Iyx, Iyy, Iyz;
231  double Izx, Izy, Izz;
232
233  int ssdIdentity; // boolean of whether atom is ssd
234
235 };
236
97   #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines