1 |
+ |
#include <iostream> |
2 |
+ |
|
3 |
+ |
using namespace std; |
4 |
+ |
|
5 |
|
#include "Atom.hpp" |
6 |
|
|
7 |
|
double* Atom::pos; // the position array |
244 |
|
|
245 |
|
nElements = nNew; |
246 |
|
} |
247 |
+ |
|
248 |
+ |
|
249 |
+ |
void Atom::getPos( double theP[3] ){ |
250 |
+ |
|
251 |
+ |
theP[0] = pos[offsetX]; |
252 |
+ |
theP[1] = pos[offsetY]; |
253 |
+ |
theP[2] = pos[offsetZ]; |
254 |
+ |
} |
255 |
+ |
|
256 |
+ |
void Atom::setPos( double theP[3] ){ |
257 |
+ |
|
258 |
+ |
pos[offsetX] = theP[0]; |
259 |
+ |
pos[offsetY] = theP[1]; |
260 |
+ |
pos[offsetZ] = theP[2]; |
261 |
+ |
} |
262 |
+ |
|
263 |
+ |
void Atom::getVel( double theV[3] ){ |
264 |
+ |
|
265 |
+ |
theV[0] = vel[offsetX]; |
266 |
+ |
theV[1] = vel[offsetY]; |
267 |
+ |
theV[2] = vel[offsetZ]; |
268 |
+ |
} |
269 |
+ |
|
270 |
+ |
void Atom::setVel( double theV[3] ){ |
271 |
+ |
|
272 |
+ |
vel[offsetX] = theV[0]; |
273 |
+ |
vel[offsetY] = theV[1]; |
274 |
+ |
vel[offsetZ] = theV[2]; |
275 |
+ |
} |
276 |
+ |
|
277 |
+ |
void Atom::getFrc( double theF[3] ){ |
278 |
+ |
|
279 |
+ |
theF[0] = frc[offsetX]; |
280 |
+ |
theF[1] = frc[offsetY]; |
281 |
+ |
theF[2] = frc[offsetZ]; |
282 |
+ |
} |
283 |
+ |
|
284 |
+ |
void Atom::addFrc( double theF[3] ){ |
285 |
+ |
|
286 |
+ |
frc[offsetX] += theF[0]; |
287 |
+ |
frc[offsetY] += theF[1]; |
288 |
+ |
frc[offsetZ] += theF[2]; |
289 |
+ |
} |