35 |
|
virtual ~Atom() {} |
36 |
|
|
37 |
|
static void createArrays (int nElements) { |
38 |
< |
|
38 |
> |
int i; |
39 |
|
if( pos != NULL ) destroyArrays(); |
40 |
|
|
41 |
|
pos = new double[nElements*3]; |
44 |
|
trq = new double[nElements*3]; |
45 |
|
Amat = new double[nElements*9]; |
46 |
|
mu = new double[nElements]; |
47 |
< |
ul = new double[nElements]; |
47 |
> |
ul = new double[nElements*3]; |
48 |
|
|
49 |
|
// init directional values to zero |
50 |
|
|
51 |
< |
trq[offsetX] = 0.0; |
52 |
< |
trq[offsetY] = 0.0; |
53 |
< |
trq[offsetZ] = 0.0; |
54 |
< |
|
55 |
< |
Amat[Axx] = 1.0; |
56 |
< |
Amat[Axy] = 0.0; |
57 |
< |
Amat[Axz] = 0.0; |
58 |
< |
|
59 |
< |
Amat[Ayx] = 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] = 1.0; |
66 |
< |
|
67 |
< |
mu[index] = 0.0; |
68 |
< |
|
69 |
< |
ul[offsetX] = 0.0; |
70 |
< |
ul[offsetY] = 0.0; |
71 |
< |
ul[offsetZ] = 0.0; |
51 |
> |
for( i=0; i<nElements; i++){ |
52 |
> |
trq[i] = 0.0; |
53 |
> |
trq[i+1] = 0.0; |
54 |
> |
trq[i+2] = 0.0; |
55 |
> |
|
56 |
> |
Amat[i] = 1.0; |
57 |
> |
Amat[i+1] = 0.0; |
58 |
> |
Amat[i+2] = 0.0; |
59 |
> |
|
60 |
> |
Amat[i+3] = 0.0; |
61 |
> |
Amat[i+4] = 1.0; |
62 |
> |
Amat[i+5] = 0.0; |
63 |
> |
|
64 |
> |
Amat[i+6] = 0.0; |
65 |
> |
Amat[i+7] = 0.0; |
66 |
> |
Amat[i+8] = 1.0; |
67 |
> |
|
68 |
> |
mu[i] = 0.0; |
69 |
> |
|
70 |
> |
ul[i] = 0.0; |
71 |
> |
ul[i+1] = 0.0; |
72 |
> |
ul[i+2] = 0.0; |
73 |
> |
} |
74 |
|
} |
75 |
|
static void destroyArrays(void) { |
76 |
|
delete[] pos; |