ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/libmdtools/Atom.hpp
Revision: 1118
Committed: Mon Apr 19 03:52:27 2004 UTC (20 years, 5 months ago) by tim
File size: 2127 byte(s)
Log Message:
new implement of quickLate using visitor and composite pattern

File Contents

# User Rev Content
1 mmeineke 377 #ifndef _ATOM_H_
2     #define _ATOM_H_
3    
4 gezelter 829 #include <string.h>
5     #include <stdlib.h>
6 mmeineke 377 #include <iostream>
7    
8 mmeineke 670 #include "SimState.hpp"
9 gezelter 1097 #include "StuntDouble.hpp"
10 tim 1118 #include "BaseVisitor.hpp"
11 mmeineke 670
12 gezelter 1097 class Atom : public StuntDouble {
13 mmeineke 377 public:
14    
15 mmeineke 670 Atom(int theIndex, SimState* theConfig );
16 gezelter 409 virtual ~Atom() {}
17 mmeineke 377
18 tim 689 virtual void setCoords(void);
19 mmeineke 377
20 mmeineke 599 void getPos( double theP[3] );
21     void setPos( double theP[3] );
22    
23     void getVel( double theV[3] );
24     void setVel( double theV[3] );
25    
26     void getFrc( double theF[3] );
27     void addFrc( double theF[3] );
28    
29 gezelter 1097 virtual void zeroForces();
30 mmeineke 377
31 gezelter 1097 double getMass() {return c_mass;}
32 mmeineke 377 void setMass(double mass) {c_mass = mass;}
33    
34     int getIndex() const {return index;}
35 gezelter 409 void setIndex(int theIndex);
36 gezelter 1097
37 mmeineke 377 char *getType() {return c_name;}
38     void setType(char * name) {strcpy(c_name,name);}
39    
40     int getIdent( void ) { return ident; }
41     void setIdent( int info ) { ident = info; }
42    
43     #ifdef IS_MPI
44     int getGlobalIndex( void ) { return myGlobalIndex; }
45     void setGlobalIndex( int info ) { myGlobalIndex = info; }
46     #endif // is_mpi
47    
48     void setHasDipole( int value ) { has_dipole = value; }
49     int hasDipole( void ) { return has_dipole; }
50    
51 tim 1113 void setHasCharge(int value) {has_charge = value;}
52     int hasCharge(void) {return has_charge;}
53    
54 tim 1118
55     virtual void accept(BaseVisitor* v);
56    
57 mmeineke 377 protected:
58    
59 mmeineke 670 SimState* myConfig;
60    
61     double* pos; // the position array
62     double* vel; // the velocity array
63     double* frc; // the forc array
64     double* trq; // the torque vector ( space fixed )
65     double* Amat; // the rotation matrix
66     double* mu; // the array of dipole moments
67     double* ul; // the lab frame unit directional vector
68    
69 mmeineke 377 double c_mass; /* the mass of the atom in amu */
70    
71     int index; /* set the atom's index */
72     int offset; // the atom's offset in the storage array
73     int offsetX, offsetY, offsetZ;
74    
75     int Axx, Axy, Axz; // the rotational matrix indices
76     int Ayx, Ayy, Ayz;
77     int Azx, Azy, Azz;
78    
79     char c_name[100]; /* it's name */
80     int ident; // it's unique numeric identity.
81    
82     int has_dipole; // dipole boolean
83 tim 1113 int has_charge; // charge boolean
84 mmeineke 377
85 mmeineke 670 bool hasCoords;
86    
87 mmeineke 377 #ifdef IS_MPI
88     int myGlobalIndex;
89     #endif
90    
91     };
92    
93     #endif