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 (21 years ago) by tim
File size: 2127 byte(s)
Log Message:
new implement of quickLate using visitor and composite pattern

File Contents

# Content
1 #ifndef _ATOM_H_
2 #define _ATOM_H_
3
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 : public StuntDouble {
13 public:
14
15 Atom(int theIndex, SimState* theConfig );
16 virtual ~Atom() {}
17
18 virtual void setCoords(void);
19
20 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 virtual void zeroForces();
30
31 double getMass() {return c_mass;}
32 void setMass(double mass) {c_mass = mass;}
33
34 int getIndex() const {return index;}
35 void setIndex(int theIndex);
36
37 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 void setHasCharge(int value) {has_charge = value;}
52 int hasCharge(void) {return has_charge;}
53
54
55 virtual void accept(BaseVisitor* v);
56
57 protected:
58
59 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 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 int has_charge; // charge boolean
84
85 bool hasCoords;
86
87 #ifdef IS_MPI
88 int myGlobalIndex;
89 #endif
90
91 };
92
93 #endif