1 |
+ |
#include <cmath> |
2 |
|
#include "Atom.hpp" |
3 |
|
#include "SRI.hpp" |
4 |
|
#include "AbstractClasses.hpp" |
66 |
|
|
67 |
|
// position whole step |
68 |
|
|
69 |
< |
for( j=atomIndex; j<(atomIndex+3); j=j+3 ) { |
70 |
< |
rj[0] = pos[j]; |
71 |
< |
rj[1] = pos[j+1]; |
72 |
< |
rj[2] = pos[j+2]; |
69 |
> |
rj[0] = pos[atomIndex]; |
70 |
> |
rj[1] = pos[atomIndex+1]; |
71 |
> |
rj[2] = pos[atomIndex+2]; |
72 |
> |
|
73 |
> |
info->wrapVector(rj); |
74 |
|
|
75 |
< |
info->wrapVector(rj); |
76 |
< |
|
77 |
< |
pos[j] += dt * (vel[j] + eta*rj[0]); |
76 |
< |
pos[j+1] += dt * (vel[j+1] + eta*rj[1]); |
77 |
< |
pos[j+2] += dt * (vel[j+2] + eta*rj[2]); |
78 |
< |
} |
79 |
< |
|
80 |
< |
// Scale the box after all the positions have been moved: |
81 |
< |
|
82 |
< |
info->scaleBox(exp(dt*eta)); |
75 |
> |
pos[atomIndex] += dt * (vel[atomIndex] + eta*rj[0]); |
76 |
> |
pos[atomIndex+1] += dt * (vel[atomIndex+1] + eta*rj[1]); |
77 |
> |
pos[atomIndex+2] += dt * (vel[atomIndex+2] + eta*rj[2]); |
78 |
|
|
79 |
|
if( atoms[i]->isDirectional() ){ |
80 |
|
|
127 |
|
} |
128 |
|
|
129 |
|
} |
130 |
+ |
// Scale the box after all the positions have been moved: |
131 |
+ |
|
132 |
+ |
info->scaleBox(exp(dt*eta)); |
133 |
+ |
|
134 |
|
} |
135 |
|
|
136 |
|
void NPTi::moveB( void ){ |