ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/libmdtools/Atom.hpp
Revision: 1187
Committed: Sat May 22 18:16:18 2004 UTC (20 years, 3 months ago) by chrisfen
File size: 2210 byte(s)
Log Message:
Fixed Thermodynamic integration code.

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 tim 1126 virtual void accept(BaseVisitor* v) {v->visit(this);}
56 tim 1118
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 chrisfen 1187 double zAngle; // the rotation about the z-axis ( body-fixed )
70    
71 mmeineke 377 double c_mass; /* the mass of the atom in amu */
72    
73     int index; /* set the atom's index */
74     int offset; // the atom's offset in the storage array
75     int offsetX, offsetY, offsetZ;
76    
77     int Axx, Axy, Axz; // the rotational matrix indices
78     int Ayx, Ayy, Ayz;
79     int Azx, Azy, Azz;
80    
81     char c_name[100]; /* it's name */
82     int ident; // it's unique numeric identity.
83    
84     int has_dipole; // dipole boolean
85 tim 1113 int has_charge; // charge boolean
86 mmeineke 377
87 mmeineke 670 bool hasCoords;
88    
89 mmeineke 377 #ifdef IS_MPI
90     int myGlobalIndex;
91     #endif
92    
93     };
94    
95     #endif