ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/libmdtools/Atom.hpp
Revision: 1113
Committed: Thu Apr 15 16:18:26 2004 UTC (21 years ago) by tim
File size: 2057 byte(s)
Log Message:
fix whole bunch of bugs :-)

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
11 class Atom : public StuntDouble {
12 public:
13
14 Atom(int theIndex, SimState* theConfig );
15 virtual ~Atom() {}
16
17 virtual void setCoords(void);
18
19 void getPos( double theP[3] );
20 void setPos( double theP[3] );
21
22 void getVel( double theV[3] );
23 void setVel( double theV[3] );
24
25 void getFrc( double theF[3] );
26 void addFrc( double theF[3] );
27
28 virtual void zeroForces();
29
30 double getMass() {return c_mass;}
31 void setMass(double mass) {c_mass = mass;}
32
33 int getIndex() const {return index;}
34 void setIndex(int theIndex);
35
36 char *getType() {return c_name;}
37 void setType(char * name) {strcpy(c_name,name);}
38
39 int getIdent( void ) { return ident; }
40 void setIdent( int info ) { ident = info; }
41
42 #ifdef IS_MPI
43 int getGlobalIndex( void ) { return myGlobalIndex; }
44 void setGlobalIndex( int info ) { myGlobalIndex = info; }
45 #endif // is_mpi
46
47 void setHasDipole( int value ) { has_dipole = value; }
48 int hasDipole( void ) { return has_dipole; }
49
50 void setHasCharge(int value) {has_charge = value;}
51 int hasCharge(void) {return has_charge;}
52
53 protected:
54
55 SimState* myConfig;
56
57 double* pos; // the position array
58 double* vel; // the velocity array
59 double* frc; // the forc array
60 double* trq; // the torque vector ( space fixed )
61 double* Amat; // the rotation matrix
62 double* mu; // the array of dipole moments
63 double* ul; // the lab frame unit directional vector
64
65 double c_mass; /* the mass of the atom in amu */
66
67 int index; /* set the atom's index */
68 int offset; // the atom's offset in the storage array
69 int offsetX, offsetY, offsetZ;
70
71 int Axx, Axy, Axz; // the rotational matrix indices
72 int Ayx, Ayy, Ayz;
73 int Azx, Azy, Azz;
74
75 char c_name[100]; /* it's name */
76 int ident; // it's unique numeric identity.
77
78 int has_dipole; // dipole boolean
79 int has_charge; // charge boolean
80
81 bool hasCoords;
82
83 #ifdef IS_MPI
84 int myGlobalIndex;
85 #endif
86
87 };
88
89 #endif