2 |
|
#define _ATOM_H_ |
3 |
|
|
4 |
|
#include <cstring> |
5 |
+ |
#include <cstdlib> |
6 |
|
#include <iostream> |
7 |
|
|
8 |
|
class Atom{ |
12 |
|
has_dipole = 0; |
13 |
|
is_VDW = 0; |
14 |
|
is_LJ = 0; |
15 |
+ |
pos = NULL; |
16 |
+ |
|
17 |
|
index = theIndex; |
18 |
|
offset = 3 * index; |
19 |
|
offsetX = offset; |
35 |
|
virtual ~Atom() {} |
36 |
|
|
37 |
|
static void createArrays (int nElements) { |
38 |
+ |
|
39 |
+ |
if( pos != NULL ) destroyArrays(); |
40 |
+ |
|
41 |
|
pos = new double[nElements*3]; |
42 |
|
vel = new double[nElements*3]; |
43 |
|
frc = new double[nElements*3]; |
52 |
|
trq[offsetY] = 0.0; |
53 |
|
trq[offsetZ] = 0.0; |
54 |
|
|
55 |
< |
Amat[Axx] = 0.0; |
55 |
> |
Amat[Axx] = 1.0; |
56 |
|
Amat[Axy] = 0.0; |
57 |
|
Amat[Axz] = 0.0; |
58 |
|
|
59 |
|
Amat[Ayx] = 0.0; |
60 |
< |
Amat[Ayy] = 0.0; |
60 |
> |
Amat[Ayy] = 1.0; |
61 |
|
Amat[Ayz] = 0.0; |
62 |
|
|
63 |
|
Amat[Azx] = 0.0; |
64 |
|
Amat[Azy] = 0.0; |
65 |
< |
Amat[Azz] = 0.0; |
65 |
> |
Amat[Azz] = 1.0; |
66 |
|
|
67 |
|
mu[index] = 0.0; |
68 |
|
|
215 |
|
|
216 |
|
int isDirectional( void ){ return 0; } |
217 |
|
void zeroForces() { |
218 |
< |
frc[offsetX] = 0.0; |
218 |
> |
frc[offsetX] = 0.0; |
219 |
|
frc[offsetY] = 0.0; |
220 |
|
frc[offsetZ] = 0.0; |
221 |
|
} |
227 |
|
DirectionalAtom(int theIndex) : Atom(theIndex) |
228 |
|
{ |
229 |
|
ssdIdentity = 0; |
230 |
< |
|
230 |
> |
sux = 0.0; |
231 |
> |
suy = 0.0; |
232 |
> |
suz = 0.0; |
233 |
|
} |
234 |
|
virtual ~DirectionalAtom() {} |
235 |
|
|
259 |
|
void addTz( double the_tz ) { trq[offsetZ] += the_tz;} |
260 |
|
|
261 |
|
void zeroForces() { |
262 |
< |
frc[offsetX] = 0.0; |
262 |
> |
frc[offsetX] = 0.0; |
263 |
|
frc[offsetY] = 0.0; |
264 |
|
frc[offsetZ] = 0.0; |
265 |
|
|
266 |
< |
trq[offsetX] = 0.0; |
266 |
> |
trq[offsetX] = 0.0; |
267 |
|
trq[offsetY] = 0.0; |
268 |
|
trq[offsetZ] = 0.0; |
269 |
|
} |
314 |
|
|
315 |
|
void lab2Body( double r[3] ); |
316 |
|
void body2Lab( double r[3] ); |
317 |
+ |
void updateU( void ); |
318 |
|
|
319 |
|
private: |
320 |
|
int dIndex; |