ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/libmdtools/Atom.hpp
Revision: 1452
Committed: Mon Aug 23 15:11:36 2004 UTC (20 years ago) by tim
File size: 2285 byte(s)
Log Message:
*** empty log message ***

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 tim 1452 void setFrc( double theF[3] );
28 mmeineke 599 void addFrc( double theF[3] );
29    
30 gezelter 1097 virtual void zeroForces();
31 mmeineke 377
32 gezelter 1097 double getMass() {return c_mass;}
33 mmeineke 377 void setMass(double mass) {c_mass = mass;}
34    
35     int getIndex() const {return index;}
36 gezelter 409 void setIndex(int theIndex);
37 gezelter 1097
38 mmeineke 377 char *getType() {return c_name;}
39     void setType(char * name) {strcpy(c_name,name);}
40    
41     int getIdent( void ) { return ident; }
42     void setIdent( int info ) { ident = info; }
43    
44     #ifdef IS_MPI
45     int getGlobalIndex( void ) { return myGlobalIndex; }
46     void setGlobalIndex( int info ) { myGlobalIndex = info; }
47     #endif // is_mpi
48    
49     void setHasDipole( int value ) { has_dipole = value; }
50     int hasDipole( void ) { return has_dipole; }
51    
52 tim 1113 void setHasCharge(int value) {has_charge = value;}
53     int hasCharge(void) {return has_charge;}
54    
55 tim 1118
56 tim 1126 virtual void accept(BaseVisitor* v) {v->visit(this);}
57 tim 1118
58 mmeineke 377 protected:
59    
60 mmeineke 670 SimState* myConfig;
61    
62     double* pos; // the position array
63     double* vel; // the velocity array
64     double* frc; // the forc array
65     double* trq; // the torque vector ( space fixed )
66     double* Amat; // the rotation matrix
67     double* mu; // the array of dipole moments
68     double* ul; // the lab frame unit directional vector
69 tim 1452 double* quat; // the quaternion array
70 mmeineke 670
71 chrisfen 1187 double zAngle; // the rotation about the z-axis ( body-fixed )
72    
73 mmeineke 377 double c_mass; /* the mass of the atom in amu */
74    
75     int index; /* set the atom's index */
76     int offset; // the atom's offset in the storage array
77     int offsetX, offsetY, offsetZ;
78    
79     int Axx, Axy, Axz; // the rotational matrix indices
80     int Ayx, Ayy, Ayz;
81     int Azx, Azy, Azz;
82    
83     char c_name[100]; /* it's name */
84     int ident; // it's unique numeric identity.
85    
86     int has_dipole; // dipole boolean
87 tim 1113 int has_charge; // charge boolean
88 mmeineke 377
89 mmeineke 670 bool hasCoords;
90    
91 mmeineke 377 #ifdef IS_MPI
92     int myGlobalIndex;
93     #endif
94    
95     };
96    
97     #endif