ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/libmdtools/Atom.hpp
Revision: 1136
Committed: Tue Apr 27 16:26:44 2004 UTC (20 years, 4 months ago) by tim
File size: 2456 byte(s)
Log Message:
add center of mass of the molecule and massRation into atom class

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 tim 1136 void getRc(double theRc[3]);
44     void setRc(double theRc[3]);
45    
46     double getMassRatio() { return *massRatio;}
47     void setMassRatio(double theMassRatio) { *massRatio = theMassRatio;}
48    
49 mmeineke 377 #ifdef IS_MPI
50     int getGlobalIndex( void ) { return myGlobalIndex; }
51     void setGlobalIndex( int info ) { myGlobalIndex = info; }
52     #endif // is_mpi
53    
54     void setHasDipole( int value ) { has_dipole = value; }
55     int hasDipole( void ) { return has_dipole; }
56    
57 tim 1113 void setHasCharge(int value) {has_charge = value;}
58     int hasCharge(void) {return has_charge;}
59    
60 tim 1118
61 tim 1126 virtual void accept(BaseVisitor* v) {v->visit(this);}
62 tim 1118
63 mmeineke 377 protected:
64    
65 mmeineke 670 SimState* myConfig;
66    
67     double* pos; // the position array
68     double* vel; // the velocity array
69     double* frc; // the forc array
70     double* trq; // the torque vector ( space fixed )
71     double* Amat; // the rotation matrix
72     double* mu; // the array of dipole moments
73     double* ul; // the lab frame unit directional vector
74 tim 1136 double* rc; //the center of mass of the molecule
75     double* massRatio; //the ratio of this atom to the total mass of the molecule
76 mmeineke 670
77 mmeineke 377 double c_mass; /* the mass of the atom in amu */
78    
79     int index; /* set the atom's index */
80     int offset; // the atom's offset in the storage array
81     int offsetX, offsetY, offsetZ;
82    
83     int Axx, Axy, Axz; // the rotational matrix indices
84     int Ayx, Ayy, Ayz;
85     int Azx, Azy, Azz;
86    
87     char c_name[100]; /* it's name */
88     int ident; // it's unique numeric identity.
89    
90     int has_dipole; // dipole boolean
91 tim 1113 int has_charge; // charge boolean
92 mmeineke 377
93 mmeineke 670 bool hasCoords;
94    
95 mmeineke 377 #ifdef IS_MPI
96     int myGlobalIndex;
97     #endif
98    
99     };
100    
101     #endif