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 |
|
|
protected: |
51 |
|
|
|
52 |
mmeineke |
670 |
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 |
mmeineke |
377 |
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 |
mmeineke |
670 |
bool hasCoords; |
78 |
|
|
|
79 |
mmeineke |
377 |
#ifdef IS_MPI |
80 |
|
|
int myGlobalIndex; |
81 |
|
|
#endif |
82 |
|
|
|
83 |
|
|
}; |
84 |
|
|
|
85 |
|
|
#endif |