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, 2 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

# 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 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 #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 void setHasCharge(int value) {has_charge = value;}
58 int hasCharge(void) {return has_charge;}
59
60
61 virtual void accept(BaseVisitor* v) {v->visit(this);}
62
63 protected:
64
65 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 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
77 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 int has_charge; // charge boolean
92
93 bool hasCoords;
94
95 #ifdef IS_MPI
96 int myGlobalIndex;
97 #endif
98
99 };
100
101 #endif