| 7 |
|
|
| 8 |
|
class Atom{ |
| 9 |
|
public: |
| 10 |
– |
Atom(int theIndex) { |
| 11 |
– |
c_n_hyd = 0; |
| 12 |
– |
has_dipole = 0; |
| 13 |
– |
is_VDW = 0; |
| 14 |
– |
is_LJ = 0; |
| 10 |
|
|
| 11 |
< |
index = theIndex; |
| 12 |
< |
offset = 3 * index; |
| 18 |
< |
offsetX = offset; |
| 19 |
< |
offsetY = offset+1; |
| 20 |
< |
offsetZ = offset+2; |
| 11 |
> |
Atom(int theIndex); |
| 12 |
> |
virtual ~Atom() {} |
| 13 |
|
|
| 14 |
< |
Axx = index*9; |
| 15 |
< |
Axy = Axx+1; |
| 16 |
< |
Axz = Axx+2; |
| 17 |
< |
|
| 18 |
< |
Ayx = Axx+3; |
| 19 |
< |
Ayy = Axx+4; |
| 20 |
< |
Ayz = Axx+5; |
| 14 |
> |
static double* pos; // the position array |
| 15 |
> |
static double* vel; // the velocity array |
| 16 |
> |
static double* frc; // the forc array |
| 17 |
> |
static double* trq; // the torque vector ( space fixed ) |
| 18 |
> |
static double* Amat; // the rotation matrix |
| 19 |
> |
static double* mu; // the dipole moment array |
| 20 |
> |
static double* ul; // the lab frame unit directional vector |
| 21 |
> |
static int nElements; |
| 22 |
|
|
| 23 |
< |
Azx = Axx+6; |
| 24 |
< |
Azy = Axx+7; |
| 25 |
< |
Azz = Axx+8; |
| 26 |
< |
} |
| 27 |
< |
virtual ~Atom() {} |
| 28 |
< |
|
| 29 |
< |
static void createArrays (int nElements) { |
| 37 |
< |
int i; |
| 38 |
< |
|
| 39 |
< |
pos = new double[nElements*3]; |
| 40 |
< |
vel = new double[nElements*3]; |
| 41 |
< |
frc = new double[nElements*3]; |
| 42 |
< |
trq = new double[nElements*3]; |
| 43 |
< |
Amat = new double[nElements*9]; |
| 44 |
< |
mu = new double[nElements]; |
| 45 |
< |
ul = new double[nElements*3]; |
| 46 |
< |
|
| 47 |
< |
// init directional values to zero |
| 48 |
< |
|
| 49 |
< |
for( i=0; i<nElements; i++){ |
| 50 |
< |
trq[i] = 0.0; |
| 51 |
< |
trq[i+1] = 0.0; |
| 52 |
< |
trq[i+2] = 0.0; |
| 53 |
< |
|
| 54 |
< |
Amat[i] = 1.0; |
| 55 |
< |
Amat[i+1] = 0.0; |
| 56 |
< |
Amat[i+2] = 0.0; |
| 57 |
< |
|
| 58 |
< |
Amat[i+3] = 0.0; |
| 59 |
< |
Amat[i+4] = 1.0; |
| 60 |
< |
Amat[i+5] = 0.0; |
| 61 |
< |
|
| 62 |
< |
Amat[i+6] = 0.0; |
| 63 |
< |
Amat[i+7] = 0.0; |
| 64 |
< |
Amat[i+8] = 1.0; |
| 65 |
< |
|
| 66 |
< |
mu[i] = 0.0; |
| 67 |
< |
|
| 68 |
< |
ul[i] = 1.0; |
| 69 |
< |
ul[i+1] = 0.0; |
| 70 |
< |
ul[i+2] = 0.0; |
| 71 |
< |
} |
| 72 |
< |
} |
| 73 |
< |
static void destroyArrays(void) { |
| 74 |
< |
delete[] pos; |
| 75 |
< |
delete[] vel; |
| 76 |
< |
delete[] frc; |
| 77 |
< |
delete[] trq; |
| 78 |
< |
delete[] Amat; |
| 79 |
< |
delete[] mu; |
| 80 |
< |
} |
| 23 |
> |
static void createArrays (int nElements); |
| 24 |
> |
static void destroyArrays(void); |
| 25 |
> |
void addAtoms(int nAdded, double* Apos, double* Avel, double* Afrc, |
| 26 |
> |
double* Atrq, double* AAmat, double* Amu, |
| 27 |
> |
double* Aul); |
| 28 |
> |
void deleteAtom(int theIndex); |
| 29 |
> |
void deleteRange(int startIndex, int stopIndex); |
| 30 |
|
|
| 31 |
|
static double* getPosArray( void ) { return pos; } |
| 32 |
|
static double* getVelArray( void ) { return vel; } |
| 71 |
|
void setCovalent(double covalent) {c_covalent = covalent;} |
| 72 |
|
|
| 73 |
|
int getIndex() const {return index;} |
| 74 |
< |
void setIndex(int theIndex) { |
| 126 |
< |
index = theIndex; |
| 127 |
< |
offset = index*3; |
| 128 |
< |
offsetX = offset; |
| 129 |
< |
offsetY = offset+1; |
| 130 |
< |
offsetZ = offset+2; |
| 131 |
< |
|
| 132 |
< |
Axx = index*9; |
| 133 |
< |
Axy = Axx+1; |
| 134 |
< |
Axz = Axx+2; |
| 135 |
< |
|
| 136 |
< |
Ayx = Axx+3; |
| 137 |
< |
Ayy = Axx+4; |
| 138 |
< |
Ayz = Axx+5; |
| 139 |
< |
|
| 140 |
< |
Azx = Axx+6; |
| 141 |
< |
Azy = Axx+7; |
| 142 |
< |
Azz = Axx+8; |
| 143 |
< |
} |
| 144 |
< |
|
| 74 |
> |
void setIndex(int theIndex); |
| 75 |
|
char *getType() {return c_name;} |
| 76 |
|
void setType(char * name) {strcpy(c_name,name);} |
| 77 |
|
|
| 97 |
|
|
| 98 |
|
virtual int isDirectional( void ) = 0; |
| 99 |
|
|
| 170 |
– |
static double* pos; // the position array |
| 171 |
– |
static double* vel; // the velocity array |
| 172 |
– |
static double* frc; // the forc array |
| 173 |
– |
static double* trq; // the torque vector ( space fixed ) |
| 174 |
– |
static double* Amat; // the rotation matrix |
| 175 |
– |
static double* mu; // the dipole moment array |
| 176 |
– |
static double* ul; // the lab frame unit directional vector |
| 100 |
|
|
| 101 |
|
protected: |
| 102 |
|
|
| 128 |
|
|
| 129 |
|
}; |
| 130 |
|
|
| 208 |
– |
|
| 209 |
– |
|
| 131 |
|
class GeneralAtom : public Atom{ |
| 132 |
|
|
| 133 |
|
public: |