ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/libmdtools/Atom.hpp
Revision: 1097
Committed: Mon Apr 12 20:32:20 2004 UTC (21 years, 1 month ago) by gezelter
File size: 1924 byte(s)
Log Message:
Changes for RigidBody dynamics (Somewhat extensive)

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 protected:
51
52 SimState* myConfig;
53
54 double* pos; // the position array
55 double* vel; // the velocity array
56 double* frc; // the forc array
57 double* trq; // the torque vector ( space fixed )
58 double* Amat; // the rotation matrix
59 double* mu; // the array of dipole moments
60 double* ul; // the lab frame unit directional vector
61
62 double c_mass; /* the mass of the atom in amu */
63
64 int index; /* set the atom's index */
65 int offset; // the atom's offset in the storage array
66 int offsetX, offsetY, offsetZ;
67
68 int Axx, Axy, Axz; // the rotational matrix indices
69 int Ayx, Ayy, Ayz;
70 int Azx, Azy, Azz;
71
72 char c_name[100]; /* it's name */
73 int ident; // it's unique numeric identity.
74
75 int has_dipole; // dipole boolean
76
77 bool hasCoords;
78
79 #ifdef IS_MPI
80 int myGlobalIndex;
81 #endif
82
83 };
84
85 #endif