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 setFrc( double theF[3] ); |
28 |
void addFrc( double theF[3] ); |
29 |
|
30 |
virtual void zeroForces(); |
31 |
|
32 |
double getMass() {return c_mass;} |
33 |
void setMass(double mass) {c_mass = mass;} |
34 |
|
35 |
int getIndex() const {return index;} |
36 |
void setIndex(int theIndex); |
37 |
|
38 |
char *getType() {return c_name;} |
39 |
void setType(char * name) {strcpy(c_name,name);} |
40 |
|
41 |
int getIdent( void ) { return ident; } |
42 |
void setIdent( int info ) { ident = info; } |
43 |
|
44 |
#ifdef IS_MPI |
45 |
int getGlobalIndex( void ) { return myGlobalIndex; } |
46 |
void setGlobalIndex( int info ) { myGlobalIndex = info; } |
47 |
#endif // is_mpi |
48 |
|
49 |
void setHasDipole( int value ) { has_dipole = value; } |
50 |
int hasDipole( void ) { return has_dipole; } |
51 |
|
52 |
void setHasCharge(int value) {has_charge = value;} |
53 |
int hasCharge(void) {return has_charge;} |
54 |
|
55 |
|
56 |
virtual void accept(BaseVisitor* v) {v->visit(this);} |
57 |
|
58 |
protected: |
59 |
|
60 |
SimState* myConfig; |
61 |
|
62 |
double* pos; // the position array |
63 |
double* vel; // the velocity array |
64 |
double* frc; // the forc array |
65 |
double* trq; // the torque vector ( space fixed ) |
66 |
double* Amat; // the rotation matrix |
67 |
double* mu; // the array of dipole moments |
68 |
double* ul; // the lab frame unit directional vector |
69 |
double* quat; // the quaternion array |
70 |
|
71 |
double zAngle; // the rotation about the z-axis ( body-fixed ) |
72 |
|
73 |
double c_mass; /* the mass of the atom in amu */ |
74 |
|
75 |
int index; /* set the atom's index */ |
76 |
int offset; // the atom's offset in the storage array |
77 |
int offsetX, offsetY, offsetZ; |
78 |
|
79 |
int Axx, Axy, Axz; // the rotational matrix indices |
80 |
int Ayx, Ayy, Ayz; |
81 |
int Azx, Azy, Azz; |
82 |
|
83 |
char c_name[100]; /* it's name */ |
84 |
int ident; // it's unique numeric identity. |
85 |
|
86 |
int has_dipole; // dipole boolean |
87 |
int has_charge; // charge boolean |
88 |
|
89 |
bool hasCoords; |
90 |
|
91 |
#ifdef IS_MPI |
92 |
int myGlobalIndex; |
93 |
#endif |
94 |
|
95 |
}; |
96 |
|
97 |
#endif |