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 (20 years, 5 months ago) by tim
File size: 2057 byte(s)
Log Message:
fix whole bunch of bugs :-)

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 mmeineke 670
11 gezelter 1097 class Atom : public StuntDouble {
12 mmeineke 377 public:
13    
14 mmeineke 670 Atom(int theIndex, SimState* theConfig );
15 gezelter 409 virtual ~Atom() {}
16 mmeineke 377
17 tim 689 virtual void setCoords(void);
18 mmeineke 377
19 mmeineke 599 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 gezelter 1097 virtual void zeroForces();
29 mmeineke 377
30 gezelter 1097 double getMass() {return c_mass;}
31 mmeineke 377 void setMass(double mass) {c_mass = mass;}
32    
33     int getIndex() const {return index;}
34 gezelter 409 void setIndex(int theIndex);
35 gezelter 1097
36 mmeineke 377 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 tim 1113 void setHasCharge(int value) {has_charge = value;}
51     int hasCharge(void) {return has_charge;}
52    
53 mmeineke 377 protected:
54    
55 mmeineke 670 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 mmeineke 377 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 tim 1113 int has_charge; // charge boolean
80 mmeineke 377
81 mmeineke 670 bool hasCoords;
82    
83 mmeineke 377 #ifdef IS_MPI
84     int myGlobalIndex;
85     #endif
86    
87     };
88    
89     #endif